The pane CLI
pane is a separate binary that does everything the window does: read captures,
create and toggle rules, pair devices, pull logcat. It exists for the places a
GUI cannot go — scripts, CI, automated UI tests, and sessions where an agent is
at the keyboard (see Agents and MCP).
If the desktop app is running, commands go to it over its local control socket and the open window reflects them immediately. If it is not, the CLI opens the same data directory directly.
Install
The CLI is not part of the app bundle — it ships as its own file. Grab it from a release:
| Platform | Release asset |
|---|---|
| macOS Apple Silicon | pane-cli-darwin-aarch64 |
| Linux x86_64 | pane-cli-linux-x86_64 |
curl -fsSL -o pane https://github.com/thothlab/pane-app/releases/latest/download/pane-cli-darwin-aarch64chmod +x pane && mv pane /usr/local/bin/pane --versionOr build it from source, which guarantees it matches your app:
make cli-install # = cargo build --release -p pane-cli + install# or by hand:cargo build --release -p pane-cli./target/release/pane-cli install # symlinks onto PATH as `pane`install links into /usr/local/bin, falling back to ~/.local/bin when that
is not writable. Somewhere else: install --dir <DIR>.
The two commands everything starts with
$ pane doctorinstance attached to a running Paneproxy running 127.0.0.1:8888 38 capturesadb /Users/you/Library/Android/sdk/platform-tools/adbca 7c4db809d727457e…devices 2 paired · 1 attachedOne call answers: is there an instance? is the proxy up? was adb found? is the CA valid? are devices paired? Every “why is nothing working” starts here.
pane schema # the whole command tree, both filter grammars and exit codes, as JSONschema is the machine-readable version of this page, and it is the more
authoritative one: it is generated from the CLI itself, so when it and the docs
disagree, it wins.
Output format
Human-readable columns by default. For scripts:
export PANE_FORMAT=json # once per sessionpane --json doctor # or per callThe rule is simple: stdout is a clean pipe for | jq, and everything else —
warnings, explanations, errors — goes to stderr. captures body writes raw body
bytes to stdout and its truncation note to stderr, so redirecting to a file
never corrupts it.
Captures: the drill-down ladder
Each rung costs roughly ten times the previous one. Start at the top, especially when context is tight.
$ pane captures count --filter 'host:api.example.com status:500..599'2$ pane captures list --filter 'status:500..599' --limit 5SID METHOD STATUS HOST PATH MS BYTES RULEc97cc13d POST 500 api.example.com /v2/orders 412 2184cb21e58 GET 503 api.example.com /v2/orders/8821 30011 244$ pane captures get c97cc13d # the full row plus request/response headers$ pane captures body c97cc13d --res --max-bytes 4096 | jq .error--filtertakes the same string as the GUI search bar — see Filtering captures.--fields id,status,url_pathkeeps only what you need;--fullemits the whole DTO instead of the summary projection.- Bodies truncate to 8 KiB. For large payloads use
--out FILE(writes everything, prints nothing), not--max-bytes 0. captures bodydefaults to the response;--reqfor the request body,--base64for binary.
Hand a request to someone else, or reproduce it outside Pane:
pane captures export c97cc13d --format curl # a one-linerpane captures export c97cc13d --format har --out req.harcaptures clear --yes wipes everything — useful between scenarios so an
assertion cannot match a previous run.
Watching live
$ pane captures tail --filter 'host:api.example.com' --count 1 --timeout 30{"event":"ready","filter":"host:api.example.com","count":1,"timeout":30}{"event":"capture","id":"c97cc13d-…","method":"POST","url_path":"/v2/orders", "status":500,"state":"completed","duration_ms":412,"matched_rule_name":null}{"event":"end","reason":"count","captures":1,"elapsed_ms":1014}NDJSON, where the first line is always ready and the last is always end.
Wait for ready, then trigger the app: otherwise you race the first request,
which people usually paper over with a sleep — and that is where flaky scripts
come from. --count is the assertion, --timeout (whole seconds, no suffix) the deadline;
falling short is exit 7.
tail is one of the few commands that need a running instance — without one
it exits 3. So do proxy stop, devices add, devices rm, logcat attach and
logcat detach; everything else — reading captures, editing rules, collections —
works with the app closed.
Rules
pane rules lspane rules mock --host api.example.com --path '/v2/orders*' --method POST \ --status 500 --body '{"error":"internal"}' --name orders-500pane rules from-capture c97cc13d --status 500 --name orders-500mock creates a stub rule in one line (defaults: --status 200,
--mime application/json); from-capture reuses the host, path and method of a
real capture. Large bodies come from --body-file fixtures/x.json. --disabled
creates it switched off.
Always pass --name. It is the selector for enable | disable | rm and the
value for rule: in filters. Without it the name defaults to host+path, which is
awkward to assert on.
Toggling, one at a time or in bulk:
pane rules enable orders-500 # by name substring or idpane rules disable --all # reset to a known statepane rules enable --collection base # every rule in one collectionpane rules enable --ungrouped # everything outside a collectionThe bulk flags are not sugar: sweeping a real library one rule at a time is one process launch per rule, and each one re-lists everything to resolve its selector.
Sharing a set of mocks uses the same pane-rules format the GUI reads and
writes, bodies inline:
pane rules export --out fixtures/all-rules.jsonpane rules import fixtures/all-rules.json --dry-run # look firstpane rules import fixtures/all-rules.jsonImport always creates new entities; it never overwrites by name.
Collections
A collection is one scenario. Switching scenario wholesale:
$ pane collections lsID STATE RULES NAMEb2d5f2a0 off 8 base — 500 ₽ baselinea647e8c1 off 8 noamount — QR with no amount
$ pane collections only noamountpane: only `noamount — QR with no amount` is live — 8 rule(s) enabled, everything else offonly means “disable everything, then enable this collection”. That is how to
move between scenarios: leaving the previous collection enabled means two rules
match the same host and path, the higher-priority one answers, and an assertion
on state:stubbed still goes green while proving nothing.
collections rm <sel> --yes deletes a collection and moves its rules to
Ungrouped; --with-rules deletes them too.
Different scenarios on different devices
By default a rule covers every device, so only switches the scenario on all of
them at once — right on one phone, wrong on four. --device <sel> narrows the
change to a single device; the others keep running what they were running.
$ pane devices lsID STATE PLATFORM NAMEa91f3c02 ready android Google Pixel 7 · Android 14 · r-0XXH77b1e4de ready android Google sdk_gphone64 · Android 14 · r-5554
$ pane rules disable --all --device pixelpane: disabled 14 of 21 rules for a91f3c02pane: 14 rule(s) are now pinned to named devices — a device paired from here on will not get them (undo with `pane rules enable --all`)$ pane collections only checkout --device pixel$ pane collections only errors --device 77b1e4deThe rule library stays shared: the same rule is simply on for one device and off
for another, so there is no need to duplicate it per phone. The flag is
understood by rules enable | disable | mock and
collections enable | disable | only.
pane rules ls --device <sel> shows the list as that device sees it: a LIVE
column instead of STATE, plus a SCOPE column — all for shared rules, N dev for pinned ones. Rows are never hidden: “why didn’t my mock fire” has to be
answerable from one command, not from guessing what got filtered out.
The device selector is a name substring, serial or id — the same string
--filter 'device:…' takes. __host__ is this Mac’s own traffic.
Verify with device: on both sides too, or the other phone’s traffic answers for
this one:
$ pane captures count --filter 'device:pixel state:stubbed rule:checkout-ok'1$ pane captures count --filter 'device:pixel rule:orders-500'0Devices, logcat, CA, proxy
pane devices attached # what is plugged in right now (exit 4 = nothing)pane devices add emulator-5554 # pair; needs a running proxypane devices rm <sel> --yes
pane logcat attach --serial emulator-5554pane logcat query --serial emulator-5554 --filter 'app:dev.shop.app level:E' --limit 20pane logcat pids --serial emulator-5554pane logcat clear --serial emulator-5554 --yes
pane ca show # fingerprint and validitypane ca export --format pem --out ca.pem # also: der, qr, mobileconfig
pane proxy statuspane proxy start --port 8888pane proxy stop # also reverts proxy settings on devicesThe logcat filter grammar is tag: msg: level: pid: app: plus ~regex; a bare
word matches tag or message, and level takes V D I W E F S and ranges like
W..F. app: is resolved to PIDs by the CLI. More in
the Logcat window.
Selectors
Anywhere a command wants an <id> or <sel>, it accepts a full id, a unique
id prefix, or a name substring of a rule, collection or device. Ambiguity
is an error listing the candidates — the CLI never picks for you.
Nothing prompts. Destructive commands need --yes.
Exit codes
| Code | Meaning |
|---|---|
| 0 | ok |
| 1 | error |
| 2 | usage (argument parsing) |
| 3 | no running instance / proxy stopped |
| 4 | no device, or adb missing |
| 5 | not found |
| 6 | bad filter |
| 7 | timeout, or --count not reached — a failed assertion |
| 8 | conflict (port in use, precondition failed) |
7 is the interesting one: not a tool failure but a verdict, which makes it easy
to build set -e scripts on.
The data directory
pane doctor --data-dir /tmp/scratch-paneexport PANE_DATA_DIR=/tmp/scratch-paneThe default is the platform location: ~/Library/Application Support/tech.thothlab.pane
on macOS, ~/.local/share/pane on Linux. A separate directory means a separate
database, a separate lock and a separate instance — which is exactly how to run
experiments without touching your real capture history.
Next
- Headless Pane —
pane proxy runfor CI and scripts. - Agents and MCP — the same operations as tools for an LLM agent.
- Filtering captures — the
--filtergrammar.