boxer

CLI

Every boxer command and flag, its exit codes, output modes and environment variables.

boxer <command> [flags] [args]

A command with no sandbox name acts on the current scope, which is the git worktree you are in by default. boxer, boxer help, -h and --help print the usage text. boxer with no arguments prints it to stderr and exits 2.

stop, rm, backends, integrations add, install, uninstall, shim install and package accept flags anywhere among their arguments. capsule inspect, capsule replay, fork rm and pack take the name first or last. Every other command wants its flags before any positional argument or --.

Commands

CommandDoes
upCreate and start this scope's sandbox
runRun a command in the sandbox
downDelete this scope's sandbox, one by name, or all
statusThis scope's sandbox, as an exit code and a line
restartRelaunch the start services without recreating the sandbox
lsEvery sandbox on the backend
stop, rmStop or remove sandboxes by name or filter
gcReclaim gone, idle and stopped sandboxes and stale packs
url, openWhere this worktree's server is
backendsWhich backends are installed and answering
integrationsWhich harnesses, orchestrators and tools are wired to boxer
doctorThe resolved configuration and what is wrong with it
briefThe agent-facing summary of this checkout
tasksThe commands [tasks] declares
forkBranch copy-on-write children of a smolvm sandbox
trustApprove this worktree's host-affecting configuration
packSave and reuse named snapshots of a sandbox
capsuleRecord the last run and replay it
logsRead the event log
watchStream sandbox state changes and events
installWrite a harness's hooks, MCP entry and skill
uninstallRemove what install wrote
shimWrite PATH shims
shell, acpRun a harness inside the sandbox
hookThe entry point a harness hook calls
mcpThe MCP server
packageRender the published plugin and skill
completionPrint a shell completion script
versionPrint the version

Identity flags

up, run, down, status, restart, doctor, brief, tasks, fork, fork ls, fork rm, pack save, pack use and pack rm accept these. They matter when isolation is session or subagent, and --harness selects the [harness.<name>] override layer.

FlagDefault
--harness NAME$BOXER_HARNESSThe harness the call comes from
--session ID$BOXER_SESSION_IDThe harness session id
--agent ID$BOXER_AGENT_IDThe subagent id

boxer up

boxer up [--detach | --recreate | --rebuild]

Creates this scope's sandbox if it does not exist, starts it, runs setup and start, and waits for ready. It prints the name, the image and why it was chosen, and the mount. On a running sandbox whose setup failed or whose ready did not pass last time, it tries again rather than reporting it up. --recreate and --rebuild get the new image (pull, build or cache it) and check that the fixed host ports in network.ports are free before deleting anything, so an image that cannot be had, or a port another process holds (START_FAILED, naming the port), leaves the old sandbox as it was. Interrupted (SIGINT, SIGTERM) while it creates or starts the sandbox, launches its start services or waits for ready, it exits 130 or 143 with cause INTERRUPTED. Only a sandbox this up created is deleted; one that was already there is left, with services an interrupted start step had launched stopped and ones already running left running, and the next up tries again. Interrupted during a build, it passes the signal to the builder and removes the tag that build made. A second signal ends boxer at once, without cleaning up.

FlagDefault
--detachfalseProvision in a background boxer and return at once
--recreatefalseDelete and recreate the sandbox
--rebuildfalseDrop the cached environment pack, then recreate. Implies --recreate
--jsonfalsePrint a refusal to resolve the scope as JSON on stdout. Provisioning failures are text on stderr only

boxer run

boxer run -c '<shell line>'
boxer run [flags] -- <program> [args...]
boxer run --task <name>

Runs one command in the sandbox and exits with its exit code. -c runs the line with sh -c. -- runs a program with no shell. Stdin, stdout and stderr pass through unchanged. The sandbox is created first when create_on includes run.

FlagDefault
-c LINEA shell line, run with sh -c. Not with -- arguments
--task NAMEA [tasks] entry. Not with -c or arguments. Unknown names fail with NO_SUCH_TASK
--scope NAMERun in another sandbox, such as a fork child, by key or two-word name. The current directory must still be in a repository
--ttyfalseAllocate a terminal in the guest when stdin is not one. Input written before the guest attaches is kept
--junit PATHSComma-separated JUnit XML paths, relative to the worktree, to summarise after the run. Overrides the task's junit and results.auto
--fail-on-test-failuresfalseExit 1 when the command exited 0 and a test in the reports failed
--jsonfalsePrint a refusal to resolve the scope, an unknown --task or an unknown --scope as JSON on stdout. Other refusals, such as NO_SANDBOX, are text on stderr only

Without --tty, boxer allocates a terminal when both stdin and stdout are terminals. Inside a boxer guest, run executes the command directly, and exits 127 when the program cannot be started. From an agent, prefer --task. It runs a command the repository declared, regardless of what intercept catches.

boxer down

boxer down [--volumes | --all | --scope NAME] [--json]

Deletes this scope's sandbox. A scope with no sandbox is not an error. A --scope name that matches no boxer sandbox is: it exits 1, so a typo is not taken for success. --all goes on past a sandbox it cannot delete, reports it with an error, and exits 1.

FlagDefault
--volumesfalseAlso delete this worktree's named volumes. Works when the sandbox is already gone
--allfalseEvery boxer sandbox on the configured backend
--scope NAMEOne sandbox by key or two-word name, without resolving a worktree. Works after the worktree is gone
--jsonfalsePrint what was removed. With --volumes, volumes_removed counts the volumes deleted, 0 included

With --volumes and no sandbox left, down says had no sandbox; deleted 1 volume, and the JSON has removed: false with volumes_removed: 1.

boxer status

boxer status [--scope NAME] [--json]

Prints this scope's sandbox: state, image, mount, forwarded ports and URLs. The exit code is the state.

ExitState
0running
3exists, stopped
4absent
1refused, or the backend could not be asked
FlagDefault
--scope NAMEAnother sandbox, by key or two-word name. The current directory must still be in a repository
--jsonfalseThe status object

boxer restart

boxer restart

Stops this scope's start services and everything they spawned, launches them again, and waits for ready. The sandbox and what is in it stay: an installed package, a database's files. It acts on this scope only and takes no --scope. Use it after changing something a server reads only at start, or when a service gave up after five quick crashes (see restart).

When a service cannot be signalled, as with docker under Ubuntu's AppArmor, boxer stops and starts the sandbox instead, which ends every process in it and keeps its files. Exits 1 with cause NO_SANDBOX when the sandbox is not running. Takes the identity flags.

boxer ls

boxer ls [-A] [--pr] [--resources] [--no-git] [--json]

Lists boxer's sandboxes on the configured backend with name, key, state, backend, branch, git state (clean, dirty(N) or gone), owner, the first URL or forwarded port, and worktree.

FlagDefault
-A, --all-backendsfalseEvery installed backend
--prfalseEach worktree's pull request, through gh. One network call per worktree
--resourcesfalseMemory, CPU and disk per sandbox
--no-gitfalseSkip reading each worktree's git state
--jsonfalseThe row array

A backend that does not answer is named on stderr, and ls exits 1 after listing the backends that did.

boxer stop and boxer rm

boxer stop [NAME...] [--all | --gone | --stopped] [-A] [-i] [-y] [--json]
boxer rm   [NAME...] [--all | --gone | --stopped] [-A] [-i] [-y] [--volumes] [--json]

stop stops sandboxes without deleting them. rm deletes them and everything boxer kept about them: the run record, the last-used stamp, the lock and any URL. It keeps their named volumes unless you pass --volumes. NAME is a key (sb-7e1852e4a3c3) or a two-word name (swift-crab).

FlagDefault
--allfalseEvery boxer sandbox on the configured backend. With -A, on every backend
--gonefalseSandboxes whose worktree no longer exists
--stoppedfalseSandboxes that are not running
-AfalseLook on every installed backend
-ifalseChoose from a numbered list. The default for a person when nothing is named
-yfalseDo not ask before removing several sandboxes or a filter's matches
--volumesfalserm only. Also delete the sandboxes' named volumes
--jsonfalsePrint what was done

With no name and no filter, an agent or a pipe gets exit 2 and the command to run instead. A name that matches nothing exits 1. So does a backend that does not answer, by name or with --all, --gone or --stopped, which would otherwise look like a host with nothing to act on: it is a BACKEND_UNAVAILABLE refusal whose fix starts the backend, and an error object under --json whose reason carries what the backend said. A sandbox that fails is reported and the rest are still acted on. When rm --volumes deletes a sandbox but not its volumes, the sandbox's row says removed: true with an error, and the command exits 1.

boxer gc

boxer gc [--all] [--dry-run] [--json]

Deletes sandboxes whose worktree is gone, fork children whose parent is gone, the named volumes of worktrees gone for 7 days, and packs past idle_timeout or beyond packs_keep_last. A running sandbox unused for its own repository's idle_timeout is stopped, or deleted with idle_action = "delete". It skips a sandbox a command is provisioning, a parent whose fork child is in use, and a pack a create is using. It never deletes a named pack. It looks only at the configured backend; a sandbox left on another one after backend changed is named the next time this worktree's sandbox is created. On smolvm it also stops and removes the machine a killed pack create booted, which smolvm does not list, and ends a smolvm _boot-vm process left running after its machine's directory was deleted. It removes a boxer machine's directory that smolvm has not listed for an hour, which a create ended partway leaves, with any boot process still running from it, and smolvm's pack-staging-* directories over an hour old, with any half-pulled image in them, while no pack create is running. boxer cleans up the same way itself when it is interrupted while caching an image or creating a sandbox, and down removes such a directory for its own sandbox and ends a boot process still running from it, whether or not smolvm still lists the machine. Only smolvm's own processes are ended. It removes a per-worktree build tag (boxer-<hash>-<key>) whose sandbox and worktree are both gone, which an interrupted build or a failed create leaves. With nothing to take, it prints nothing to reclaim.

FlagDefault
--allfalseIgnore idle_timeout. Also take every stopped sandbox and every unreferenced pack. Running sandboxes are kept
--dry-runfalsePrint what it would delete
--jsonfalseThe decision array

boxer url and boxer open

boxer url [PORT]
boxer open [PORT]
boxer url --all
boxer open --all

Prints the address of this worktree's server, which is its [urls] name or else http://127.0.0.1:<host port>, or the address the forward names, such as http://[::1]:<host port>. A fork child forwards no ports of its own. PORT is the guest port. The default is the first forwarded port, sorted as text. open also opens the address in a browser when a person is at the terminal. The command exits 4 when this scope has no sandbox. It exits 1 when the sandbox forwards no ports, or not the one you named.

--all lists every running sandbox's servers on the configured backend, one name<TAB>address line each, and works outside a repository. open --all also opens each one. It exits 1 when no running sandbox forwards a port.

boxer backends

boxer backends [NAME] [--probe] [--json]

Lists smolvm, docker, podman and container: installed or not, version, answering or not, boundary, allowlist support, sandbox count, and known misconfigurations. NAME shows one. Exit 1 when the configured backend is missing or not answering, or a probe failed. Exit 2 for an unknown name.

FlagDefault
--probefalseCreate a sandbox from mirror.gcr.io/library/alpine:3.20 in a throwaway repository on each answering backend, run a command that writes to the worktree, check the host sees it, and delete everything
--jsonfalseThe backend array

boxer integrations

boxer integrations [--json]
boxer integrations add <name> [--user] [--agent NAME] [--source REPO]

Alias boxer harnesses. It lists:

  • every harness, with whether its program is on PATH and whether boxer's files are installed in this repository and for this user
  • the orchestrators conductor and git-hook
  • the tools portless, gh and npx

A harness whose installed files came from another boxer release is marked stale, and boxer install <harness> refreshes them. The skill column is per harness: the skill where that harness reads skills, in the repository or for the user. It only reads: a harness counts as installed by its own entries, in this worktree, not by a file it shares with another harness. Codex is the exception to "this worktree": in a linked worktree it reads the main repository's hooks, so those are the ones its row counts. conductor is installed when its settings carry boxer's block and every harness shim they name is there, and partial when one is missing.

add installs one integration. A harness name, all, git or conductor runs boxer install. skill runs npx skills add <source> --skill boxer, and plugin runs npx plugins add <source>. See skills and plugins.

FlagDefault
--userfalseInstall for this user. For skill, passes -g. For plugin, drops -s project. For a harness, runs boxer install --user
--agent NAMEFor skill, the agents, passed as npx skills -a. For plugin, the target, passed as -t
--source REPOBarakChamo/boxerWhere the skill and plugin are published
--jsonfalseThe integration array. Not with add

boxer doctor

boxer doctor [--json]

Prints the version, the backend's capabilities, the git checkout, every configuration file read, each resolved setting with the file or variable it came from, the scope, the image, the sandbox, the environment pack, shims, hook signals, disk use, refused hosts, and warnings about configurations that look correct but do not work. Exit 1 when the configuration could not be resolved.

boxer brief

boxer brief [--json]

Prints the brief the hooks inject and the MCP resource serves: the mount, the mode, the intercept and passthrough lists, and each declared task.

boxer tasks

boxer tasks [--json]

Prints each [tasks] entry's name and description, or its command when it has none.

boxer fork

boxer fork --prepare [--count N] [--json]
boxer fork [--count N] [--json]
boxer fork ls [--json]
boxer fork rm <name> | --all

Branches copy-on-write children off this scope's smolvm sandbox. Children share this worktree. See forking. Stdout carries only the children's names.

FlagDefault
--preparefalseCreate the sandbox if needed and restart it as a branch source. Ends what runs in it
--count N1How many children this scope should have. Existing children count, so a repeat creates none
--jsonfalseAn array of the new children's names

fork ls lists this scope's children. fork rm <name> removes one child and fork rm --all removes all of them. A name that is not a fork child exits 2.

boxer trust

boxer trust
boxer trust --show

Approves this worktree's host-affecting configuration. The worktree is mounted read-write, so code in the sandbox can rewrite boxer.toml or devcontainer.json, which boxer reads on the host. A repository file's value for the keys that reach the host or loosen the sandbox is held back until a person who has seen the configuration runs this. Each key is held under its own condition:

Held back when the repository's valueKeys
differs from yours at allprep (commands or target), build, smolfile, network.dns, telemetry.path, telemetry.endpoint, [harness.*], and [urls] while it is on
adds an entry yours does not havemounts, secrets, env_passthrough, network.ports, passthrough, network.allow_hosts and network.allow_presets (only when the network is allowlist; with it on or off they do nothing), and each devcontainer.json ${localEnv:NAME}
is a local path that differs from yoursimage (starting ./, ../, / or ~/, or ending in .tar, .tar.gz or .tgz: smolvm boots a host directory or archive)
turns it on where yours is off, or has managers other than yourscache
loosens yoursmode = "off", a lower min_free_gb, an enforcement of hook or audit when yours is stricter, on_sandbox_unavailable = "passthrough", a container backend, isolation = "repo", integration = "inside", an intercept and intercept_also that together miss one of the programs yours intercept, a wider network.mode, a shorter idle_timeout or reclaim_every, a smaller packs_keep_last, and auto_reclaim = true when yours is off

That includes the first configuration in a fresh clone. Until then the sandbox still runs, with your own values for those keys (boxer's defaults, ~/.config/boxer/boxer.toml, BOXER_* variables), which are never held back. A value outside those conditions, such as a longer idle_timeout or a dropped mount, and every other key (a registry image, cpus, memory, tasks, ready), takes effect without approval. cpus and memory, and a devcontainer's hostRequirements that set them, only size the sandbox: they reach no host path, command or shared name, so they are not held. Security says what each key reaches.

--show lists the keys that need approval with the value the repository gives each, says whether this configuration is already approved, and exits without approving. A ${localEnv:NAME} is listed by the host variable's name, and its value is never printed: a held value that uses one is shown with ${localEnv:NAME} where the host's value goes once approved (the file's own default when the host has no such variable), so a mount of ${localEnv:HOME}/.ssh reads that way rather than as /.ssh. --show exits 0 when the configuration is approved or has nothing to approve, and 1 while approval is pending. Trust is per worktree, whatever the isolation, and a changed set of those keys has to be approved again. up and run print a warning naming the keys while they are held back, and the MCP server puts it at the top of the first tool result of a session. BOXER_TRUST=1 approves every configuration without a prompt, for CI and other places the repository is yours to begin with.

FlagDefault
--showfalseList the keys that need approval, their values and whether they have approval, without approving. Exit 1 while approval is pending

boxer pack

boxer pack save <name>
boxer pack ls [--json]
boxer pack use <name>
boxer pack rm <name>

A named pack is a snapshot of a sandbox's filesystem, not its processes. See packs you name.

Subcommand
save <name>Snapshot this scope's sandbox. smolvm snapshots only a stopped machine, so the sandbox is stopped and started again around it: a command running in it is cut off, and its services restart. NO_SANDBOX when there is none
lsList saved packs, newest first
use <name>Recreate this scope's sandbox from one. NO_SUCH_PACK when it was never saved, before anything is deleted
rm <name>Delete one. Exit 1 when there is no such pack, or while a sandbox is being created from it

boxer checks a pack name before use because it becomes a path segment. An invalid name exits 2.

boxer capsule

boxer capsule new [-o PATH]
boxer capsule inspect <path> [--json]
boxer capsule replay <path> [--allow-dirty] [--allow-drift] [--apply-patch]

A capsule records the last command run in this scope well enough to run it again. See capsules.

FlagDefault
new -o PATHcapsule.tomlWhere to write it. A dirty worktree also gets <name>.patch beside it
inspect --jsonfalsePrint the manifest as JSON
replay --allow-dirtyfalseReplay even though this worktree has uncommitted changes
replay --allow-driftfalseReplay even though HEAD differs from the captured one
replay --apply-patchfalseApply the capsule's patch with git apply first

replay exits 0 when the failure reproduced, which means the same exit code and, when the capsule lists failing tests, the same failing tests. It exits 1 when it did not reproduce or was refused.

boxer logs

boxer logs [--scope NAME] [-n N] [--json]

Prints the event log when the file sink is on. Exit 1 when there is no log.

FlagDefault
--scope NAMEOnly events for this sandbox key
-n N0Only the last N events. 0 prints all
--jsonfalseAn array of events

boxer watch

boxer watch [-A] [--interval 1s] [--json]

Streams sandbox state changes on the configured backend, and events from the file sink when it is on, until interrupted. Exit 1 when the backend cannot be listed.

FlagDefault
-A, --all-backendsfalseEvery installed backend, as ls -A
--interval D1sHow often to compare listings
--jsonfalseOne object per line

boxer install

boxer install <harness>... [--user]
boxer install all [--user]
boxer install git
boxer install conductor

Writes the files a harness reads so its commands reach the sandbox: hooks or a plugin, and, where the harness takes them, an MCP entry, an instruction file and the skill. Each harness's setup page lists exactly what it writes. Run it inside the repository.

TargetWrites
claude-code, codex, gemini-cli, grok, kimi, dsh, opencode, piThat harness's project files
copilotRefused at project level: Copilot reads no project file. Use --user
allEvery harness above except copilot
gitA post-checkout hook running boxer up --detach in each new worktree. Not part of all
conductor.conductor/settings.toml, pointing Conductor at harness shims, with a setup script that warms the sandbox; and the claude, codex and opencode shims it names, in the shim install directory
FlagDefault
--userfalseWrite the user files instead: ~/.claude/settings.json, ~/.codex/config.toml, or ~/.copilot (hooks, skill and MCP entry). claude-code, codex and copilot only. all --user is those three

A JSON file boxer merges into keeps its content and its order: every value, number and key order stays as written and only boxer's entries change. A formatted file, one value per line, also keeps its indent style (read from its member lines, so a space before the opening brace is not taken for the indent), line endings and final newline, so boxer uninstall gives the same bytes back. A config.toml, .conductor/settings.toml, git hook, AGENTS.md or GEMINI.md keeps every byte outside boxer's block or section, including its line endings and whether it ends in a newline, and uninstall gives the same bytes back. boxer's own lines are CRLF when every line of the file is, and LF otherwise. The exceptions, each by design:

  • A compact (minified) JSON file keeps its content and key order, but the objects boxer changed may be laid out again, one value per line. So is an object or list written on one line inside a formatted file, such as "hooks": {"Stop": []}, once boxer adds to it or removes from it, and it stays laid out that way after uninstall.
  • In a JSON file with mixed line endings, the lines between the members of an object boxer changed get LF; the values it did not change keep theirs.
  • A hooks table, hook event or mcpServers table that was empty before install, such as {}, is removed with boxer's entries on uninstall (see boxer uninstall).
  • An opencode.json that boxer created keeps its $schema line after uninstall.

boxer never replaces a value it does not own. Where it adds to an object (hooks, a hook event's list, mcpServers, mcp, tools.exclude) and finds a value of another type there, such as "hooks": [], "hooks": null or "mcpServers": ["legacy"], install is refused, naming the key and what it holds. So is a file with comments or trailing commas (JSONC), rather than rewritten without them; a config.toml that boxer's hooks tables would make invalid; and anything at a path boxer reads or writes that is not a readable regular file (a FIFO, a socket, a directory, a symlink loop), or a symlink to a file that does not exist: writing through it would create a file that uninstall could not tell from yours. Every file is checked before any is written, and a write that fails puts back the files already written and removes the ones it created, so a refused or failed install leaves every file as it was. That holds across harnesses: when one of all, or of claude-code codex, is refused, none is installed. The error names the file and the command to run again.

boxer's section in AGENTS.md or GEMINI.md is found by its heading and release line, so an install replaces one an older release wrote, in place. boxer's hook is recognised by the exact command it writes, boxer hook followed by one of the harness names boxer's hook speaks (boxer hook claude-code, boxer hook gemini-cli), so a hook of yours that mentions boxer, or a boxer hook audit wrapper of your own, is left alone.

git honours core.hooksPath. When that names something other than a directory, such as /dev/null, git runs no hooks at all, so git is refused with the command that turns them back on.

Under husky 9, git writes to .husky/post-checkout, the file husky runs with sh, so it needs no executable bit and its mode is left as it is. Anywhere else, a post-checkout that is not executable is one git skips, so git refuses it rather than enable your hook along with boxer's block: make it executable or remove it, then run the install again.

boxer install takes the integration's name (claude-code, gemini-cli). boxer shell takes the program's (claude, gemini).

boxer uninstall

boxer uninstall <harness>... [--user]
boxer uninstall all [--user]
boxer uninstall git
boxer uninstall conductor

Removes what the same boxer install wrote, and only that. Files boxer created go. In files it merged into (.claude/settings.json, .mcp.json, AGENTS.md, opencode.json), only boxer's entries go and the rest of the file is kept, including your own hooks in a group boxer's hook shares, and a group or event you left empty. A merged file left empty is deleted, unless git tracks it: then it is kept, and named in the output. Directories left empty are removed. A boxer section in AGENTS.md or GEMINI.md from any release comes out. Conductor's settings come back byte for byte. Running it twice is harmless, and a refusal part-way, such as a malformed .mcp.json, puts back everything it had already removed.

boxer keeps no record of what a file held before install, so a few things cannot be told apart and are not restored exactly:

  • A hooks table, hook event or mcpServers table that was empty before boxer added to it is removed with boxer's entries, and so is the file when nothing else is in it and git does not track it.
  • A config.toml, .conductor/settings.toml or post-checkout that was empty before install (for post-checkout, holding only #!/bin/sh) is removed with boxer's block, unless git tracks it.
  • A directory that existed before install and is empty after uninstall is removed with the directories boxer created, except the user directories themselves (~/.claude, ~/.codex, ~/.copilot, or the directory their variable names), which stay even when install --user created them. A core.hooksPath directory outside the repository that install created stays.

Some files serve several harnesses: .mcp.json's boxer server (Claude Code, Grok), the skill in .agents/skills/boxer (Codex, Grok, Kimi, DSH) and the AGENTS.md section (OpenCode, pi). Each is kept while another harness that uses it is still installed, and removed with the last of them.

Left for you, and named in the output: the tools.exclude entry in Gemini CLI's settings, which may be yours too; the hooks you appended to ~/.kimi-code/config.toml by hand; and an opencode.json left holding only $schema, which boxer cannot tell from one you wrote.

FlagDefault
--userfalseRemove what install --user wrote. claude-code, codex and copilot only. git and conductor refuse it with exit 2

boxer shim install

boxer shim install [dir]
boxer shim install --harness a,b [dir]
boxer shim install --shell [dir]

Writes files on PATH that forward to boxer. See PATH shims.

FlagDefault
(none)One shim per intercept entry, each running boxer run
--harness LISTComma-separated inside harnesses. Shims named after their programs, each running boxer shell
--shellfalseboxer-bash, a bash whose every command runs in the sandbox, for a harness with a configurable shell path
dir$XDG_DATA_HOME/boxer/shims, else ~/.local/share/boxer/shimsWhere to write

--harness takes the program names (claude, gemini) or the install names (claude-code, gemini-cli). --shell and --harness write different files, so together they are refused: run them as two commands.

Each shim is an executable script whose second line marks it as boxer's (it starts # boxer shim:, # boxer harness shim: or # boxer shell wrapper:), and the directory carries a marker file, .boxer-shims or .boxer-harness-shims. boxer writes a name, the marker's included, only when nothing is there or what is there is one of its own files; it replaces a symlink to one of its files with the file and never writes through a symlink. Anything else, such as a harness installer's symlink to the real binary, a script of yours named npm, or a FIFO or directory at the marker's name, is refused before any shim is written, with the fix: give the shims a directory of their own, the default one or another empty directory, and put it first on PATH. A write that fails part-way, such as on a read-only directory or an immutable file, puts back every file it wrote and removes the directories it made, so the directory is left as it was, and the error says what to fix. Without flags, shims for programs no longer in intercept are removed: only a file that is exactly the program shim this or an earlier release wrote for its name, so a shim you have edited stays. An intercept = ["*"] names no program, so it writes no program shims and says so.

boxer-bash forces a terminal in the guest only for an interactive shell, one started without -c or a script, which is how a harness that reads the prompt drives it over pipes. boxer-bash -c '<line>' gets a terminal only when its own stdin and stdout are terminals. On docker, podman and Apple container, whose exec -t refuses or hangs on a stdin that is not a terminal, the guest opens the terminal with script(1); an image without one that keeps the exit status (Alpine has none, and busybox's has no -e) runs the shell without a terminal and prints a boxer: warning:. When boxer's own stdin is a terminal, the runtime attaches it directly. An image without bash runs the same arguments in sh, with a boxer: warning: saying so.

boxer removes its own shim directories from PATH when it starts, so it never calls itself through a shim.

boxer shell and boxer acp

boxer shell <harness> [-e KEY=VALUE]... [-- args...]
boxer acp <harness> [-e KEY=VALUE]...

shell runs the harness itself in the sandbox, with a terminal when you have one. acp runs its ACP server in the sandbox with stdio piped. Both set integration = "inside". See running the harness inside.

FlagDefault
-e KEY=VALUEA variable for the guest process, passed by name so its value is not in a command line. -e KEY passes the host's value. Repeatable

Harnesses are claude, codex, copilot, fx, gemini, grok, kimi, opencode and pi. fx and pi have no ACP server.

boxer hook

boxer hook <harness>

The command a harness hook runs. It reads the hook's JSON on stdin and answers on stdout. Harnesses are the install names: claude-code, codex, copilot, dsh, gemini-cli, grok, kimi, opencode and pi (not the shorter shell names such as claude). An unknown harness exits 1. A tool call boxer cannot read is refused in the harness's own deny form, with exit 0. That covers input that is not JSON or is cut short, and a command, tool name, event name or cwd of the wrong type. A wrong type in a field the decision does not use, such as a numeric session id, is read as text. A payload with no event name that calls the shell tool is handled as a tool call. BOXER_MODE=off turns the refusal off. Inside a guest the hook does nothing.

boxer mcp

boxer mcp [--harness NAME]

Serves MCP over stdio. See MCP server.

FlagDefault
--harness NAMEApply the [harness.<name>] overrides

boxer package

boxer package plugin|skills|<harness>|all [--out DIR]

Renders what boxer publishes. You need it only to release boxer.

TargetRenders
pluginThe Agent Plugins package in <out>/boxer
skillsskills/boxer/ and site/public/.well-known/, relative to the current directory. Ignores --out
<harness>The files one client reads, in <out>/<harness>
allAll of the above
FlagDefault
--out DIRdistOutput directory

The output is the same for every user apart from the version. Configuration reaches the agent at run time through boxer brief, the hooks and the MCP resource.

boxer completion

boxer completion bash|zsh|fish

Prints a completion script for the command names.

boxer version

boxer version

Also --version and -v. Prints the release version, else the module version go install recorded, else dev.

Exit codes

CodeMeaning
0Success. For status, running. For capsule replay, the failure reproduced
1Refused or failed. For trust --show, approval is pending
2Usage error, such as an unknown command, a bad flag, a flag the command does not take (restart --scope) or a missing argument
3For status, url and open, the sandbox exists and is stopped
4For status, url and open, this scope has no sandbox
nFor run, the command's own exit code
124For run --task, the task's timeout ended the command; boxer killed it and everything it started in the sandbox
130, 143For run, boxer was interrupted (SIGINT, SIGTERM). It sends the same signal to the command and everything it started in the sandbox, and kills what is left two seconds later. It waits up to 10 seconds for that, and a second signal ends it at once. The same for run and up interrupted during setup or image_setup, with cause INTERRUPTED; the step runs again on the next command. Interrupted while it creates or starts a sandbox, launches its services or waits for ready, boxer deletes the sandbox only if this command created it, also with cause INTERRUPTED; restart interrupted the same way keeps the sandbox

A refusal prints boxer: <reason> on stderr with scope, worktree, cause and fix lines. The causes are listed under errors. With on_sandbox_unavailable = "passthrough", run runs the command on the host when the sandbox cannot be provisioned, and exits 127 when the program cannot be started there.

Output modes

ls, stop, rm, backends and integrations format their output in one of three modes. open starts a browser only in human mode.

ModeWhenOutput
humanstdout is a terminal and no agent is detectedColour, aligned tables, hints, a confirmation before rm of several sandboxes
agentan agent is detected, CI is set, or stdout is not a terminalPlain text, hints as next: <command> lines, never a prompt
json--json or BOXER_OUTPUT=jsonOne JSON document on stdout

boxer detects an agent when CLAUDECODE, BOXER_AGENT or BOXER_INSIDE is set. A command that would have asked a person refuses in agent mode and says what to pass. BOXER_OUTPUT=json also switches every other command that has a JSON form.

Environment variables

Variables that set a boxer.toml key, such as BOXER_BACKEND, are listed in the configuration reference. These have no key.

VariableEffect
BOXER_OUTPUTjson, text (also agent, plain) or human. Overrides the detected output mode
BOXER_AGENTAny value marks an agent whose shell has a terminal
NO_COLORNo colour in human mode. TERM=dumb does the same
BOXER_HARNESS, BOXER_SESSION_ID, BOXER_AGENT_IDDefaults for the identity flags
BOXER_SMOLVMPath to the smolvm binary. Default smolvm on PATH
BOXER_PORTLESSPath to the portless binary. Default portless on PATH
PORTLESS_PORTPort boxer starts the portless proxy on. Default 1355. Below 1024, boxer refuses and asks you to start the proxy yourself
BOXER_PACKSDirectory for environment packs. Default $XDG_STATE_HOME/boxer/packs, else ~/.local/state/boxer/packs
BOXER_TRACEA path. Turns the event file sink on there, whatever [telemetry] says. See events
BOXER_NO_RECLAIM1 skips the background sweep auto_reclaim starts
BOXER_TRUST1 approves every repository configuration without boxer trust, for CI and other places the repository is yours. Any other value (true, yes) approves nothing, and every command that reads the configuration warns once that it does not
XDG_CONFIG_HOMEHolds the user boxer/boxer.toml. Default ~/.config
XDG_STATE_HOMEHolds boxer's state, packs and event log. Default ~/.local/state
XDG_DATA_HOMEHolds the default shim directory. Default ~/.local/share
XDG_CACHE_HOMEOn Linux, holds the per-user scope locks (boxer/locks), shared by every boxer of the user whatever its XDG_STATE_HOME. Default ~/.cache; on macOS the locks are under ~/Library/Caches

boxer sets these for the processes it starts.

VariableWhereValue
BOXER_INSIDEEvery guest process1. A boxer in the guest runs commands directly
BOXER_PORTSboxer shell and boxer acpGuest port to host port, 3000=61234 8080=61240
BOXER_URLSboxer shell and boxer acp, when [urls] names portsGuest port to URL, 3000=https://fix-ui.myapp.localhost:1355
BOXER_TARGET_OS, BOXER_TARGET_CPU, BOXER_TARGET_LIBC, BOXER_TARGET_FLAGSprep.commands, on the hostThe guest platform
BOXER_WORKTREEprep.commandsThe worktree's host path

On this page