Skip to content

Repository files navigation

devinpipe

A local HTTPS intercepting proxy that cuts Devin input context cost by rendering bulky text as dense PNG attachments.

Inspired by pxpipe.

What is it for?

Devin sessions can send large system prompts, tool documentation, and chat history on every request. Those long text blocks are billed as input tokens / ACU.

devinpipe sits between the Devin CLI and api.devin.ai. It rewrites large message / prompt fields into compact PNG pages, uploads them as Devin attachments, and replaces the original text with references to the uploaded images. The model still sees the same context, but you pay for image tokens instead of text tokens — typically much cheaper for dense code, JSON, and transcript history.

Install (one command)

From npm (recommended):

npm install -g devinpipe

Or run without installing:

npx devinpipe --help

From source (one-liner):

curl -fsSL https://raw.githubusercontent.com/VaiYav/devinpipe/main/scripts/install-global.sh | bash

This clones the repo to ~/.local/share/devinpipe, builds it, and symlinks devinpipe into ~/.local/bin.

From source (manual):

git clone https://github.com/VaiYav/devinpipe.git
cd devinpipe
pnpm install
pnpm run build
pnpm install:cli    # symlinks devinpipe into ~/.local/bin

Quick start

devinpipe is opt-in. Start it before devin by wrapping the command:

# One-shot: starts the proxy, runs devin, stops the proxy
devinpipe run devin

# With custom port/host
devinpipe run --port 47822 -- devin --print "hello"

# Or start the proxy as a daemon and use HTTPS_PROXY manually
devinpipe start --port 47822
export HTTPS_PROXY=http://127.0.0.1:47822
devin --print "hello"
devinpipe stop

Open the savings dashboard at http://127.0.0.1:47822/ (or the port you chose) to see tokens saved and every text→image conversion side by side.

Usage guide

Before you start

devinpipe terminates TLS locally, so it needs a trusted root CA on your machine. Install it once:

devinpipe install-ca

You can remove it later with devinpipe uninstall-ca.

CLI commands

  • start [--port <n>] [--host <ip>] — start the HTTPS intercepting proxy.
  • stop — stop a running proxy.
  • status [--port <n>] [--host <ip>] — check whether the proxy is running.
  • run [opts] [--] <command> [args...] — start the proxy, run a command with HTTPS_PROXY, then stop the proxy.
  • install-ca — install the generated root CA into the OS trust store.
  • uninstall-ca — remove the root CA.
  • export <file> — render a text file to PNG pages (page-0.png, ...).
  • dashboard — open the local savings dashboard in a browser.
  • --version, -v — print version.
  • --help, -h — print help.

Offline export (no proxy)

You can render text or files to PNG pages without running the proxy:

devinpipe export src/
cat prompt.txt | devinpipe export --stdin
devinpipe export --git

Each run creates a fresh devinpipe-export-XXXXXX/ folder containing page-*.png, factsheet.txt, manifest.json, and prompt.txt.

Supported Devin endpoints

devinpipe rewrites POST requests to:

  • POST /v3/organizations/{org_id}/sessions
  • POST /v3/organizations/{org_id}/sessions/{devin_id}/messages
  • POST /v1/sessions
  • POST /v1/sessions/{id}/message

Other traffic is forwarded unchanged.

Devin CLI note

The Devin CLI currently talks to https://server.codeium.com using gRPC-Web (protobuf) framing. devinpipe tunnels that traffic unchanged so the CLI still works, but it does not yet transform gRPC-Web payloads.

How it works

  1. You route HTTPS traffic through devinpipe (HTTPS_PROXY or ~/.config/devin/config.json proxy setting).
  2. devinpipe terminates TLS using a local root CA and inspects POST requests to the configured upstream.
  3. Large message / prompt text blocks are rendered to compact PNG pages using the same renderer that powers pxpipe.
  4. PNGs are uploaded via the Devin attachments endpoint and the request body is rewritten to reference them.
  5. Savings and conversion events are logged to ~/.devinpipe/events.jsonl and shown on the local dashboard.

Configuration

Place a ~/.devinpipe/config.json file:

{
  "port": 47822,
  "host": "127.0.0.1",
  "upstream": "https://api.devin.ai",
  "minCompressChars": 6000
}

Development

pnpm install
pnpm typecheck
pnpm test
pnpm run build

See ROADMAP.md for planned features.

License

MIT. Inspired by pxpipe by teamchong.

Portfolio

More about Valentyn Yakovliev: https://vaiyav.online/

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages