Proxy commands
apxy start, apxy stop, and apxy status control the proxy. apxy run, apxy shell, apxy env, and apxy browser send a program’s traffic through it.
apxy start
Start the local APXY proxy
Synopsis
Start the APXY proxy server.
On macOS this command automatically:
- Generates the CA certificate (if first run)
- Trusts the CA in your system keychain (prompts for password)
- Enables system-wide HTTP/HTTPS proxy
- Intercepts HTTPS traffic and persists captured requests to traffic logs
Three-tier HTTPS handling: TUNNEL: Cert-pinned domains (—bypass-domains) are tunneled as-is. SKIP: Non-enabled domains are forwarded without MITM body capture. DEEP: Domains with SSL proxying enabled (—ssl-domains or ‘ssl enable’) are saved with full request/response bodies.
Use —ssl-domains to enable body capture for specific domains at startup. Use —mitm-all to capture bodies for ALL domains (full deep inspection). Use —bypass-domains to exclude cert-pinned apps (tunneled, no MITM). Use —no-system-proxy to skip step 3 and use the proxy manually with: curl -x http://localhost:<port> … Use —no-trust-ca to skip step 2 (no keychain or sudo prompt). Clients then need the CA passed explicitly (apxy env, or apxy run sets it for you).
apxy start [flags]Options
--auto-validate automatically validate traffic against imported schemas
--bypass-domains string comma-separated domains to force tunnel even with --mitm-all (e.g. '*.openai.com,*.local')
--cert-dir string certificate directory (default "~/.apxy/certs")
--control-port int control API port (default: proxy port + 1)
-h, --help help for start
--insecure-upstream accept any origin certificate when decrypting HTTPS (by default APXY verifies origin certificates, except for localhost)
--listen-addr string bind address for web UI and control API (use 0.0.0.0 for LAN access) (default "127.0.0.1")
--log-max-records int keep at most this many captured records, the newest (0 for no limit) (default 50000)
--log-retention duration delete captured traffic older than this, at start and every 10 minutes (0 keeps it) (default 24h0m0s)
--max-body int max body capture size in bytes (default 10485760)
--mitm-all MITM all HTTPS traffic (captures all bodies, old behavior)
--network-service string network service to configure (auto-detected if empty)
--no-block-quic don't block QUIC/HTTP3 (allows traffic to bypass the proxy via UDP)
--no-mdns don't advertise proxy via mDNS/Bonjour
--no-system-proxy don't configure system proxy (use -x manually)
--no-trust-ca don't add the CA to the system trust store (no keychain or sudo prompt)
--port int proxy port (default 8080)
--project-dir string project directory for scoped isolation (uses .apxy/ subdir)
--proxy-listen-addr string bind address for the proxy port (default: all interfaces; 127.0.0.1 keeps it off the LAN)
--ssl-domains string comma-separated domains to enable SSL proxying for (e.g. 'api.example.com,*.stripe.com')
--tls-keylog string append TLS session secrets (NSS key log format) to this file so Wireshark can decrypt captures (default: $SSLKEYLOGFILE)
--upstream-proxy string upstream proxy URL for chaining (e.g. http://proxy:3128)
--web-port int web UI port (default: proxy port + 2, 0 to disable) (default -1)
--workspace-ports range range a workspace's own proxy port comes from (apxy browser, apxy device setup): the same port for a workspace every time, random when taken (default 20000-29999)Options inherited from parent commands
--config string config file (default is ~/.apxy/config.yaml)
--error-format string error output format: text|json (default "text")
--help-format string help output format: default|agent (default "default")
--no-project ignore project .apxy/ and use global ~/.apxy (env: APXY_NO_PROJECT=1)
--output string output format: agent|human (default: auto-detect via TTY)
--verbose enable verbose outputSEE ALSO
- apxy - Verify code changes against the HTTP requests they send
apxy stop
Stop the local APXY proxy this workspace started
Synopsis
Stop the running APXY proxy and turn off any system proxy settings it left on. On macOS and Linux it sends SIGTERM so the proxy shuts down cleanly; on Windows it ends the process. With no proxy running it does nothing.
apxy stop stops only a proxy this workspace started: the temporary proxy of apxy run, the proxy of the start_proxy MCP tool, or apxy start run from a script in this workspace. It refuses while apxy run in another workspace still uses that proxy, and it never stops a proxy a person started with apxy start at a terminal, or one another workspace started. The error says who started the proxy and what to do instead, usually to leave it running. apxy status shows who started the running proxy.
—force stops the proxy whoever started it. It is for people only: an agent never passes it.
apxy stop [flags]Examples
apxy stop
apxy status # who started the running proxyOptions
--force stop the proxy even if a person or another workspace started it (for people only; agents never pass it)
-h, --help help for stopOptions inherited from parent commands
--config string config file (default is ~/.apxy/config.yaml)
--error-format string error output format: text|json (default "text")
--help-format string help output format: default|agent (default "default")
--no-project ignore project .apxy/ and use global ~/.apxy (env: APXY_NO_PROJECT=1)
--output string output format: agent|human (default: auto-detect via TTY)
--verbose enable verbose outputSEE ALSO
- apxy - Verify code changes against the HTTP requests they send
apxy status
Show whether the local APXY proxy is running
Synopsis
Check whether the local APXY proxy is running and display its current state, including active rules and traffic stats.
It also prints the workspace this command runs in: APXY_WORKSPACE, then the git worktree of the current directory (named after CONDUCTOR_WORKSPACE_NAME when set), then CONDUCTOR_WORKSPACE_NAME alone. Every agent JSON envelope reports the same value in its “workspace” field.
“owner” says who started the running proxy: “user” for apxy start at a terminal, else “start:”, “run:”, “browser:” or “mcp:” and the workspace ID of the apxy start script, apxy run, apxy browser or start_proxy MCP tool that started it. Only that workspace’s apxy stop stops it. “boot_id” changes every time the proxy starts, “session_ends_at” is when the Free session limit stops it, and “other_active_workspaces” counts the other workspaces that ran an apxy command in the last hour.
Flags: —format output format: json or toon (default: json) —quiet exit 0 once a proxy is ready on —port, 1 if not; no output (for shell scripts). Ready means apxy start has written its PID file, which it does last, and the port answers as an APXY proxy: the proxy apxy run joins.
apxy status [flags]Examples
apxy status
apxy status --format toon
apxy status --quietOptions
--control-url string control API URL (default "http://127.0.0.1:8081")
--format string output format: json|toon (default "json")
-h, --help help for status
--port int proxy port to probe (used with --quiet) (default 8080)
--quiet exit 0 once a proxy is ready on --port (the one apxy run joins), 1 if not; no outputOptions inherited from parent commands
--config string config file (default is ~/.apxy/config.yaml)
--error-format string error output format: text|json (default "text")
--help-format string help output format: default|agent (default "default")
--no-project ignore project .apxy/ and use global ~/.apxy (env: APXY_NO_PROJECT=1)
--output string output format: agent|human (default: auto-detect via TTY)
--verbose enable verbose outputSEE ALSO
- apxy - Verify code changes against the HTTP requests they send
apxy env
Print proxy environment variables for shell sessions
Synopsis
Generate environment variables that configure terminal processes (Go, Node.js, Python, Ruby, cURL, and Java with —lang java) to route traffic through the APXY proxy.
This solves the problem that many tools executed from the terminal don’t respect macOS system proxy settings. By setting HTTP_PROXY, HTTPS_PROXY, and language-specific CA trust env vars, all HTTP clients in the current session will automatically route through APXY.
Usage patterns:
Inject into current shell
eval ”$(apxy env)“
Save as a reusable script
apxy env —script /tmp/apxy_env.sh source /tmp/apxy_env.sh
Target a specific language
eval ”$(apxy env —lang node)“
Java is left out of the default: JAVA_TOOL_OPTIONS makes every JVM
print “Picked up JAVA_TOOL_OPTIONS” and replaces your trust store
eval ”$(apxy env —lang java)“
Skip CA cert trust (proxy routing only)
eval ”$(apxy env —no-cert)”
For one-shot debugging of a single command, prefer:
apxy run pnpm dev apxy run python app.py
All changes are session-scoped and do not modify system configuration.
apxy env [flags]Options
--bypass-domains string additional domains to bypass proxy (comma-separated)
--cert-dir string CA certificate directory (default "~/.apxy/certs")
-h, --help help for env
--lang string target language: all (every runtime except java), go, node, python, ruby, curl, java (default "all")
--no-cert skip CA cert trust env vars (proxy routing only)
--port int proxy port (default 8080)
--script string write env setup script to file instead of stdoutOptions inherited from parent commands
--config string config file (default is ~/.apxy/config.yaml)
--error-format string error output format: text|json (default "text")
--help-format string help output format: default|agent (default "default")
--no-project ignore project .apxy/ and use global ~/.apxy (env: APXY_NO_PROJECT=1)
--output string output format: agent|human (default: auto-detect via TTY)
--verbose enable verbose outputSEE ALSO
- apxy - Verify code changes against the HTTP requests they send
apxy run
Run a command with proxy + CA env vars routed through APXY
Synopsis
Spawn the given command as a child process with HTTP_PROXY, HTTPS_PROXY, and language-specific CA trust env vars (NODE_EXTRA_CA_CERTS, SSL_CERT_FILE, REQUESTS_CA_BUNDLE, JAVA_TOOL_OPTIONS, …) set, so its network traffic is captured by APXY.
Runtime support and known limits: docs/operations/runtime-support.md
If an APXY proxy is already running on the port, the command uses it. Otherwise apxy run starts a temporary proxy. apxy run commands that run at the same time, for example agents in parallel worktrees, share it, and it stops a few seconds after the last of them exits, or right away if they were killed. The temporary proxy needs no setup: it listens on 127.0.0.1 only, leaves the system proxy alone, does not add the CA to the system trust store (no sudo or keychain prompt), and runs without the web UI. Its output goes to ~/.apxy/logs/run-proxy.log. Captured traffic stays in the shared database across proxies for 24 hours, up to the newest 50000 records (apxy start —log-retention and —log-max-records change that).
Flags before ”—” are apxy start flags, for example —port, —mitm-all, or —ssl-domains. HTTPS bodies are captured only for —mitm-all or —ssl-domains hosts. These flags apply to this run’s temporary proxy only and are not saved, so a later apxy run without —ssl-domains tunnels those hosts again. Without leading flags, everything after “run” is the command.
In a git worktree, or with APXY_WORKSPACE or CONDUCTOR_WORKSPACE_NAME set, the proxy URLs carry the workspace ID as their username (http://<workspace-id>:x@127.0.0.1:<port>) and APXY_WORKSPACE is set to that ID. The proxy tags each request from the command with it, so agents in parallel worktrees can tell their traffic apart. Clients that ignore the username, such as Java through JAVA_TOOL_OPTIONS, send untagged traffic.
Before the command starts, apxy run pushes this workspace’s rules file (<worktree>/.apxy/rules.json) and the global rules file to the proxy, and pushes them again within a second after the proxy restarts or a file changes, by hand or by git checkout. An invalid file is not pushed: the proxy keeps the last valid rules and apxy run prints the line or rule to fix.
apxy run exits with the command’s exit status. The env vars exist only in the child process; your shell is not modified.
Examples: apxy run pnpm dev apxy run npm run test — —watch apxy run — node script.js —some-flag
Headless / CI: no daemon, no sudo, capture every HTTPS body
apxy run —mitm-all — npm test apxy logs list
Another port when 8080 is taken
apxy run —port 18080 —ssl-domains api.example.com — python app.py
apxy run [start flags --] <command> [args...] [flags]Options
-h, --help help for runOptions inherited from parent commands
--config string config file (default is ~/.apxy/config.yaml)
--error-format string error output format: text|json (default "text")
--help-format string help output format: default|agent (default "default")
--no-project ignore project .apxy/ and use global ~/.apxy (env: APXY_NO_PROJECT=1)
--output string output format: agent|human (default: auto-detect via TTY)
--verbose enable verbose outputSEE ALSO
- apxy - Verify code changes against the HTTP requests they send
apxy shell
Start an interactive shell with proxy env vars set
Synopsis
Spawn $SHELL (if unset: /bin/sh, or %COMSPEC% on Windows) as a child process with HTTP_PROXY, HTTPS_PROXY, and language-specific CA trust env vars set. All commands typed in the resulting shell route through APXY without any further configuration.
Java vars (JAVA_TOOL_OPTIONS) are set only with —lang java: every JVM started in the shell would print “Picked up JAVA_TOOL_OPTIONS”, and the trust store it sets replaces your own. apxy run sets them for its one command.
When you ‘exit’ the shell, the proxy state is gone — your parent shell is never modified.
Like apxy run $SHELL, but it needs a running proxy.
apxy shell [flags]Options
-h, --help help for shell
--lang string target language: all (every runtime except java), go, node, python, ruby, curl, java (default "all")Options inherited from parent commands
--config string config file (default is ~/.apxy/config.yaml)
--error-format string error output format: text|json (default "text")
--help-format string help output format: default|agent (default "default")
--no-project ignore project .apxy/ and use global ~/.apxy (env: APXY_NO_PROJECT=1)
--output string output format: agent|human (default: auto-detect via TTY)
--verbose enable verbose outputSEE ALSO
- apxy - Verify code changes against the HTTP requests they send
apxy browser
Open a URL in a browser configured to route through APXY
Synopsis
Open the chosen browser at the given URL with its traffic routed through APXY, so its requests appear in ‘apxy logs list’ and ‘apxy wait’.
The default URL is http://localhost:3000 . The browser is auto-detected from your system default; pass —chrome / —safari / —firefox / —edge / —brave / —arc to override.
Chromium-based browsers (Chrome, Edge, Brave, Arc) get a proxy of their own. If no APXY proxy runs on —port, apxy browser starts a temporary one, scoped like apxy run’s: 127.0.0.1 only, no system proxy, no trust store change, no web UI. It holds a lease on that proxy for as long as the browser process runs (read from the profile’s SingletonLock), so the proxy stays up after other agents’ apxy run commands exit. When it cannot find the browser process within 15 seconds, it holds the proxy for an hour instead; run apxy browser again to hold it longer.
In a git worktree, or with APXY_WORKSPACE or CONDUCTOR_WORKSPACE_NAME set, the browser uses a profile of its own, ~/.apxy/<browser>-profile-<workspace-id>, and a proxy port of the workspace, which tags every request with the workspace ID: Chromium refuses a proxy URL with a username, so the tag cannot ride in the URL as it does for apxy run. The port is the same for a workspace every time, picked by its ID from apxy start —workspace-ports (random when another program holds it), and a proxy that restarts reopens it for the browser’s lease, so a browser left open keeps working. apxy browser pushes the workspace’s rules file to the proxy, so its mocks answer the browser; after editing the file by hand, run apxy rules apply. Outside any workspace the profile is ~/.apxy/<browser>-profile and the traffic is untagged.
Each profile is separate from your normal browser session and persists across runs. Chromium hardcode-bypasses localhost, so apxy launches it with —proxy-bypass-list=<-loopback> to capture localhost too.
Safari and Firefox use the system proxy: their traffic reaches APXY only through a proxy started with apxy start with the system proxy on, it is untagged, and only global rules (—global) apply to it.
See also: docs/operations/automatic-env-setup.md for the hostname-trick fallback (apxy.local) that works in any browser without —user-data-dir.
apxy browser [url] [flags]Options
--arc Force Arc
--brave Force Brave
--chrome Force Google Chrome
--edge Force Microsoft Edge
--firefox Force Firefox
-h, --help help for browser
--port int port of the APXY proxy to use, or of the temporary proxy to start when none runs (default 8080)
--safari Force Safari (macOS)Options inherited from parent commands
--config string config file (default is ~/.apxy/config.yaml)
--error-format string error output format: text|json (default "text")
--help-format string help output format: default|agent (default "default")
--no-project ignore project .apxy/ and use global ~/.apxy (env: APXY_NO_PROJECT=1)
--output string output format: agent|human (default: auto-detect via TTY)
--verbose enable verbose outputSEE ALSO
- apxy - Verify code changes against the HTTP requests they send