Reference for every toolbox command and subcommand. Source of truth: the cobra help text in cmd/*.go (toolbox <cmd> --help); this file adds the semantics the one-line help can't carry.
--configEvery command accepts --config <file> to bypass the normal config discovery and load exactly one file (highest precedence in the loading order).
Start an interactive shell session in the toolbox container. With no argument it targets the current working directory; toolbox shell <name> opens a named shell, toolbox shell <abs-dir> opens a one-shot session on that directory.
| Flag | Description |
|---|---|
-p, --publish <spec> |
Publish a host port (repeatable, docker-style syntax — see below). |
-B, --bridge-loopback |
Forward published ports to container loopback (see below). |
--oauth <tool> |
Expand a known tool's OAuth port recipe (repeatable: cf, codex, glab, oci, sonar, wrangler). |
--profile <name> |
Isolate the whole ~/.toolbox/ credential + state set under a named profile (see Profiles). |
--share <tool,...> |
Under --profile, keep the named tools on the host root instead of the profile (repeatable/comma-separated). Requires --profile. |
--peer |
Let Claude Code sessions in other toolbox containers see and message this one — off by default, --peer asks for it for one run (see Peer messaging). |
--create |
Auto-bootstrap a missing named shell in ~/.toolbox.yaml. |
--path <dir> |
Directory to use with --create (default $HOME/toolbox-shells/<name>). |
--profile <name> runs the shell against an isolated copy of the whole
~/.toolbox/ credential and state set, rooted at ~/.toolbox/profiles/<name>/.
Every CLI in the shell (claude, codex, gh, gcloud, …) then reads and writes that
profile's own auth — the way to keep a second account apart from your default:
toolbox shell --profile work # log in to claude/codex/gh here → stored under the "work" profile
toolbox shell # default identity, untouched by the profile
Isolation is all-or-nothing, not per-tool. To keep specific tools shared with
the host while isolating the rest, list them with --share (repeatable, matches
toolbox mounts names; a prefix like cf covers its split mounts):
toolbox shell --profile work --share gh,docker # gh + docker stay host-shared, everything else isolated
A profile shell runs in its own container, so it coexists with the default shell for the same directory. SSH keys and git config always stay shared with the host, and the host bridge keeps working under a profile. See profiles in mounts for what is isolated and why.
Cross-container Claude Code peer messaging is off by default. Turned on,
ListAgents / SendMessage reach a session running in a different toolbox
container — handing a task to a session already open on another repo, without
mounting that repo here. --peer asks for it for one run; --peer=false
declines it against a config that turns it on. Both are the per-run override of
the peer_messaging config key.
toolbox shell --peer # in repo A
toolbox shell --peer # in repo B — the two sessions see each other
toolbox shell # in repo C — the default: this one stays isolated
Both ends must participate: the containers join one anchor container's PID
namespace and share the toolbox-cc-socks Docker volume as their socket
directory. The shared namespace also means they can see each other's process
table — the reason it is not the default.
A participating session runs in its own container, distinct from the isolated
one for the same directory — the setting is folded into the container name, after a .
separator no shell name can produce (toolbox-named-infra.peer). The namespace
is fixed at container creation, so flipping the flag on a container that
already exists means stopping that container first; the shell warns when it
spots the mismatch, in either direction, and names the exact
toolbox stop to run. The anchor is hidden from
toolbox list and swept up by toolbox stop --all.
Rationale, and why docker exec is the better tool for fire-and-forget
delegation: ADR 0003.
By default the container has no host port bindings — it talks to the outside world through bind-mounted sockets, not TCP. When a tool inside the container needs to receive a connection from the host (typical case: an OAuth callback from glab, gh, or gcloud that listens on http://localhost:<port>), pass --publish/-p to toolbox shell:
# Forward host port 7171 to the same port in the container.
toolbox shell -p 7171
# Repeatable, full docker-style syntax supported.
toolbox shell -p 3000:3000 -p 127.0.0.1:9229:9229 -p 5353/udp
Accepted formats mirror docker run -p (<port>, <host>:<container>, <ip>:<host>:<container>, optional /tcp|/udp suffix). When the host IP is omitted it defaults to 127.0.0.1 — the port is reachable from your machine only, not the LAN.
Port bindings are fixed at container creation. toolbox shell -p <port> only takes effect when the container is first created — ContainerCreate writes the port set, and Docker doesn't accept post-hoc port changes. Run toolbox stop before re-invoking toolbox shell -p … to add or change bindings. Mismatch detection lives in sessionplan.MissingPublishPorts. When the listener inside the container binds 127.0.0.1 rather than 0.0.0.0, see the loopback bridge.
A host port already taken is a pre-flight error. Because the binding cannot be added later, toolbox shell refuses to create a container whose publish set collides with a port another container already publishes, rather than letting the daemon fail with Bind for 127.0.0.1:<port> failed: port is already allocated. The message names the port set and the holding container; when the holder is another toolbox, it also says that the login can simply be completed inside that session — credentials live on shared ~/.toolbox bind mounts. The check is best-effort: it reads the Docker container list, so a port held by a plain host process is still only caught by the daemon at creation time. Decision lives in sessionplan.ConflictingPublishPorts, daemon read and wording in internal/container.
In-container CLIs that bind their OAuth callback to 127.0.0.1:<port> (codex, vanilla wrangler) are unreachable from the host browser even with toolbox shell -p <port>:<port> — the host browser hits ERR_EMPTY_RESPONSE and no token is written. Docker's port forward delivers packets to the container's eth0 interface; a listener bound to container loopback never sees them. The -B / --bridge-loopback flag fixes that:
host browser ── Docker -p ──▶ eth0:<port> ──[ socat ]──▶ 127.0.0.1:<port> ──▶ CLI
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bridged inside the container by init.d/70
When -B is set together with at least one -p, sessionplan.Plan emits TOOLBOX_LOOPBACK_BRIDGE_PORTS=<comma-joined> and internal/build/assets/init.d/70-loopback-bridge.sh spawns one socat TCP-LISTEN:<port>,bind=$ETH_IP,fork,reuseaddr TCP:127.0.0.1:<port> per port. The bridge binds the container's external interface IP (hostname -i) explicitly so it can coexist with the CLI's own 127.0.0.1:<port> listener. It does not coexist with a wildcard listener: once socat holds eth0:<port>, a later 0.0.0.0:<port> bind on the same port fails EADDRINUSE (Linux refuses wildcard over a specific bind regardless of SO_REUSEADDR — verified live with oci). Wildcard-binding CLIs must therefore not use -B on their port; the plain -p forward already reaches them.
--oauth presetsStandard recipes (static-port loopback CLIs). The --oauth <tool> preset flag on toolbox shell expands a known tool name to its documented recipe (sessionplan.ExpandOAuth, map in internal/sessionplan/oauth.go) — expansion only ever adds to explicit -p/-B flags, and an unknown tool errors before container creation listing the supported set:
toolbox shell --oauth codex # = -B -p 1455:1455 codex ChatGPT-OAuth login
toolbox shell --oauth wrangler # = -B -p 8976:8976 wrangler login
toolbox shell --oauth sonar # = -B -p 64120-64130:64120-64130 sonar auth login
The explicit spelling stays available for ports not in the preset map:
toolbox shell -B -p 9999:9999
some-cli auth login ... # CLI binds 127.0.0.1:9999
A static range also works (sonar): the CLI binds 127.0.0.1 on the first free port in 64120-64130 (SonarLint Core's EmbeddedServer range — SonarQube rejects callback ports outside it, so a random OS-assigned port is not an option upstream). nat.ParsePortSpec expands the range and init.d/70 spawns one socat per port; the bridge binds eth0, so it never steals the loopback port the CLI itself wants.
Wildcard-bind carve-out. oci session authenticate binds 0.0.0.0:8181 (cli_setup_bootstrap.py: server_address = ('', 8181)), so Docker's plain port-forward reaches it directly and the bridge is not only unnecessary but harmful — socat on eth0:8181 makes oci's wildcard bind fail with Could not complete bootstrap process because port 8181 is already in use. glab auth login is the same style: it binds 0.0.0.0:7171, so plain -p 7171:7171 completes the callback and -B would break it (EADDRINUSE on eth0:7171):
toolbox shell --oauth oci # = -p 8181:8181 (no -B — oci binds 0.0.0.0)
toolbox shell --oauth glab # = -p 7171:7171 (no -B — glab binds 0.0.0.0)
Authenticate glab from one container at a time. ~/.config/glab-cli is a single host-shared mount, so /usr/local/bin/glab in the image is a shim that serializes every glab call on a lock over that mount (why). An interactive glab auth login holds the lock for as long as you take in the browser, and other containers stop waiting after 10 seconds and proceed unlocked — which is exactly the window where two of them can trade a single-use refresh_token and leave you with oauth2: "invalid_grant" and a full re-login on every host. The lock cannot fix a race you start on purpose: finish the login before running glab elsewhere. Device flow (glab auth login --hostname <host> --device) avoids the callback port entirely and needs no --oauth glab at all, but holds the lock the same way.
cf is a loopback-bind range too: it picks its callback port from startPort: 8877, maxPortAttempts: 10, binds 127.0.0.1, and advertises a localhost redirect_uri — the same shape as sonar, so the whole range is published and bridged. It carries no dist patch: cf binds loopback natively, and the historical build-time sed that rewrote the callback host localhost → 0.0.0.0 was dropped — upstream now sends that literal as the redirect_uri, so the rewrite made Cloudflare reject the 0.0.0.0 callback as an unregistered redirect url. cf login recipe:
toolbox shell --oauth cf # = -B -p 8877-8886:8877-8886 (loopback-bind range, range syntax via nat.ParsePortSpec)
Dynamic-port CLIs with no fixed range (gcloud, gws, tofu) cannot be pre-bound — the bridge needs a known container port to forward, so they get no --oauth recipe (use a wrapper / device-code flow).
OAuth CLI survey:
| CLI | Listener style | Strategy |
|---|---|---|
oci |
0.0.0.0:8181 (static, wildcard) |
plain publish: --oauth oci = -p 8181:8181 (no -B — socat would collide with the wildcard bind) |
glab |
0.0.0.0:7171 (static, wildcard) |
plain publish: --oauth glab = -p 7171:7171 (no -B — socat would collide with the wildcard bind) |
wrangler |
localhost:8976 (static) |
bridge: --oauth wrangler = -B -p 8976:8976 (vanilla wrangler, no sed) |
codex |
localhost:1455 (static, default ChatGPT-OAuth flow) |
bridge: --oauth codex = -B -p 1455:1455; device-code (codex login --device-auth) exists but is an opt-in beta, not the default |
sonar |
127.0.0.1:64120-64130 (static range, first free; server rejects out-of-range ports) |
bridge: --oauth sonar = -B -p 64120-64130:64120-64130; token persisted via SONARQUBE_CLI_KEYCHAIN_FILE (libsecret absent in container) |
cf |
127.0.0.1:8877-8886 (range, first free; localhost redirect_uri) |
bridge: --oauth cf = -B -p 8877-8886:8877-8886 (no sed — binds loopback natively) |
gcloud |
localhost:8085+ (dynamic) |
wrapper / device-code |
gws |
127.0.0.1:0 (ephemeral) |
wrapper / device-code |
tofu |
random port ≥1024, range from server discovery document (dynamic) | not pre-bindable; device-code/wrapper-style — no bridge recipe |
az |
dynamic | device-code (--use-device-code) |
gh / claude |
none — device-code | no listener; no port forward needed |
Limitations:
ContainerCreate. toolbox shell -B … on a container created without -B is a no-op — same UX as -p. Run toolbox stop first.127.0.0.1:<port> (IPv4). Node CLIs that listen('localhost') bind ::1 (IPv6) rather than 127.0.0.1 and never receive the callback (browser shows ERR_EMPTY_RESPONSE, the CLI times out), so the image sets ENV NODE_OPTIONS=--dns-result-order=ipv4first to force localhost to resolve IPv4-first — cf, wrangler and codex all rely on this.-B without -p is not an error. The init.d script logs a one-line loopback bridge: enabled but no -p ports published — skipping warning so the misconfiguration is visible.-B bridges every published port (TOOLBOX_LOOPBACK_BRIDGE_PORTS enumerates the full publish set, init.d/70 spawns socat per port). Combining a bridged preset with a wildcard-bind one (e.g. --oauth wrangler --oauth oci) therefore puts socat on eth0:8181 too and breaks oci's wildcard bind — same for glab (socat on eth0:7171 would break its 0.0.0.0:7171 bind). cf is itself bridged now (loopback-bind range, like wrangler/sonar), so it composes safely with other bridged presets but conflicts with the wildcard-bind ones — authenticate cf alongside oci/glab in separate sessions.EADDRINUSE because another in-container process already binds eth0:<port>) is logged to ~/.toolbox-state/init/70-loopback-bridge.log and the loop continues with the remaining ports. The bridge never aborts boot.socat is part of the always-on base apt-install set (~350KB) — no per-tool opt-out. The bridge feature is system-level, not a catalog tool.See also: publishing ports, image build internals (socat ships in the always-on base apt layer), bridge (inverse direction — container→host browser opens).
List every toolbox container on the host (alias: toolbox ls), across all directories, with the workspace path bound at /workspace and its status:
NAME WORKSPACE STATUS
toolbox-api-1a2b3c4d /home/u/api Up 2 hours
toolbox-named-infra /home/u/infra Up 10 minutes
The peer-messaging anchor is excluded — it is infrastructure, not a shell anyone opened. Containers are created with AutoRemove, so a shell that has exited is gone and the list shows the sessions running right now. A Detached Shell is the exception: its status ends in (detached), and it keeps running with no terminal attached until toolbox stop <name> or toolbox stop --all removes it. When none exist it prints No toolbox containers.. Pair it with toolbox stop to clean up a shell you spot in another directory.
Start the Orca Shell: a detached container running Orca's server at the Orca desktop app's version (or the release --version names), on host 127.0.0.1:6768. Returns once the server is ready and the Orca desktop app lists it as the environment toolbox (toolbox-<profile>); how pairing works. The workspace is the absolute dir argument, or orca_workspace, or else the running Orca Shell's. Guide: orca.md.
| Flag | Description |
|---|---|
--version <v> |
Server release, digits and dots (1.4.262 or v1.4.262); anything else is refused before container work. Default: the installed Orca desktop app's version (where it comes from). |
--profile <name> |
Run the Orca Shell for this profile (toolbox-orca-<name>). |
--share <tools> |
Under --profile, as for toolbox shell. |
On a running Orca Shell it creates nothing: it says the shell is already running, at which version, prints the endpoint, and pairs as a fresh start does; when that server has stopped, it fails and names the log.
toolbox orca shell [--profile <name>] [--share <tools>] opens a terminal in the running Orca Shell; exiting it leaves Orca running. With no Orca Shell running it fails and points at toolbox orca. Pass the --share the Orca Shell was started with: a recreate on the way in (refresh, reload) uses it.
toolbox orca stop [--profile <name>] removes the Orca Shell; with none it exits 0 without a word, so scripts can call it unconditionally.
toolbox orca pair [--profile <name>] removes the running Orca Shell's environment from the desktop app and adds it again from a fresh pairing offer.
Start the Herdr Core Shell: a detached container hosting herdr-core for the Herdr desktop app, added to the host's herdr-core (hc) as the machine toolbox (toolbox-<profile>), reached with docker exec and with herdr-core's own hc installed in it. The workspace is the absolute dir argument, or herdr_workspace, or else the running Herdr Core Shell's; on a running one the command reports its workspace, which the Shell keeps, and a different one requested is reported as a mismatch. When the running Shell's image is behind the local store or the registry, it lists what a replacement would end and offers to replace it (a Detached Shell Refresh; no tty, no offer). A machine herdr-core already knows on the Shell's connection is left alone on a running Shell that still holds herdr-core's binary, and updated on a container this run created or one that lost the binary (a Session Reload); a machine of that name on another connection is refused, naming its target, unless --reregister replaces it. When herdr-core cannot register the machine on a Shell this run created, the Shell is removed and herdr-core's reason is the error. Without hc on the host the Shell stays up and the hc machine add command to run later is printed. Guide: herdr.md.
| Flag | Description |
|---|---|
--profile <name> |
Run the Herdr Core Shell for this profile (toolbox-herdr-<name>). |
--share <tools> |
Under --profile, as for toolbox shell. |
--reregister |
Remove the machine from the host's herdr-core and add it again, reinstalling hc in the Shell. |
toolbox herdr stop [--profile <name>] removes the Herdr Core Shell; its state in ~/.toolbox/herdr-core stays. With none it exits 0 without a word.
toolbox herdr shell [--profile <name>] [--share <tools>] opens a terminal in the running Herdr Core Shell; with none running it points at toolbox herdr and creates nothing.
Stop and remove toolbox containers. Mirrors toolbox shell's targeting: no argument stops the container bound to the current directory; toolbox stop <name> stops a named shell's container; toolbox stop <abs-dir> stops the one-shot session for that directory.
An argument that is already a full container name — as printed by toolbox list or by the peer-mismatch warning — is stopped verbatim: toolbox stop toolbox-named-infra.peer. That is the handle on a container whose name carries a discriminator this command cannot re-derive from a shell name, a --peer opt-in or a --profile, and it beats reaching for --all. (A named shell whose own name starts with toolbox- is the one ambiguous case; it resolves to the container name as typed.)
| Flag | Description |
|---|---|
--all |
Stop every toolbox container on the host, the peer-messaging anchor included (cannot be combined with a positional argument). |
toolbox stop and --all only ever reach containers toolbox created. A docker compose up run inside a shell — a test suite's stack, typically — goes through the host's Docker socket and lands on the host daemon as an Orphaned Sibling: it outlives the shell, and so does its <project>_default network. Clean them up with Compose itself, which finds a project by its labels without the compose file:
docker compose ls -a # every Compose project on the host, stopped ones included
docker compose -p <project> down # its containers and networks
docker compose -p <project> down -v # ...and its named volumes: only when the data is disposable
docker network prune --filter label=com.docker.compose.project # Compose networks no container uses any more
The last line also takes the network of any stack currently down, proximo's included; the next up recreates it. Leave the proximo project out of down: it is the proximo stack (its containers carry a proximo.role label) and proximo up / proximo down own it. Toolbox ships no bulk sweep for these on purpose: Compose labels say who created a container, not whether it is a leftover or a dev stack still in use.
A compose up failing with "all predefined address pools have been fully subnetted" is the usual first sign that leftover project networks have piled up.
Build the toolbox Docker image from the embedded context (Dockerfile + assets are compiled into the binary, so it runs anywhere). The build overwrites the local cache of the canonical tag, so the next toolbox shell picks it up — see image selection for how it interacts with image / registry_mirror / pull and how to restore the upstream copy.
| Flag | Description |
|---|---|
--no-cache |
Disable the Docker build cache. |
Print the toolbox version.
Write an annotated .toolbox.yaml (same content as toolbox config example) in the current directory, mode 0600. Refuses to overwrite an existing file unless --force is given.
Inspect and scaffold .toolbox.yaml. Key semantics live in configuration.
| Subcommand | Description |
|---|---|
show [--origin] |
Print the fully-resolved configuration. |
example |
Print an annotated .toolbox.yaml template (generated from the live catalog and default mount set). |
path |
Show the config layers in precedence order with found/none markers. |
edit |
Open the highest-precedence config file in $EDITOR. |
set [--image] [--registry-mirror] [--pull] [--where] [--dry-run] |
Set the scalar keys (empty value resets the key). |
doctor |
Validate the configuration without modifying it. |
ui |
Interactively view and edit .toolbox.yaml across the Global and Repo layers (requires a TTY). |
toolbox config show --origin annotates each rendered key git-config-style with the layer that set it: (default), (~/.toolbox.yaml), (./.toolbox.yaml), or (--config <path>). Provenance is computed by re-running the pure config.Merge once per layer (defaults / +global / +project) and crediting each key to the highest layer whose value differs from the layer below (configedit.Compute); --config short-circuits to a defaults-vs-explicit diff, matching Plan. Granularity: per entry name for shells/mounts, container-level for everything else. The extra viper passes only run for --origin/doctor, never on the toolbox shell hot path. config show renders every config key (the config.SchemaKeys() field set — a coverage test fails if a new field goes unrendered): tri-state toggles (bridge/host_terminal_relay/proximo/managed_statusline/image_reclaim) print as auto when unset, agent prints its resolved default, and empty collections print as {}/[]. The deprecated browser_bridge alias is shown only as the canonical bridge. Output is deterministic (map keys sorted) and, without the flag, byte-identical to the --origin renderer fed a nil provenance (golden-tested) — users pipe it.
toolbox config doctor is a strict read-only superset of the load path's validation tail (configedit.Doctor): it surfaces Plan/Merge errors, flags unknown top-level keys per layer (key set derived from Config's mapstructure tags, with Levenshtein suggestions), warns on the legacy tools: block (→ tools-removal), checks shells.<name>.path (empty = error, missing dir = warning — it may be created by --create), and runs mountplan.Merge (failure = error, duplicate resolved targets = warning; mountplan doesn't dedupe, the last bind wins silently at the Docker layer). Exit 1 iff at least one error-severity finding.
config path lists the layers in precedence order with found/none markers; config edit opens $EDITOR (fallback vi) on the highest-precedence existing file — explicit --config > walked-up project > global — creating ~/.toolbox.yaml with the documentation header when none exists. Both reuse the config.LoadLayers / config.WalkUpProjectConfig exports extracted from Plan (a pure refactor: Plan ≡ Merge(LoadLayers(...)), regression-tested).
toolbox config ui launches an interactive terminal UI (bubbletea) for browsing and editing configuration across two layers, Global (~/.toolbox.yaml) and Repo (the walked-up .toolbox.yaml, created on first save when none exists) — switch with tab. It is a thin presentation layer, not a second config engine: every value and its owning layer come from the same config.Plan / configedit.Compute the CLI already uses, every save is gated by configedit.Doctor and written through the comment-preserving configio path (config set's writer), so comments and key order survive and an invalid edit is rejected without touching the file.
The key list is provenance-annotated — each key shows its effective value and the layer that supplies it (default / global / repo / env), colour-coded; a collection whose entries span more than one layer is tagged mixed. Provenance (which layer wins) and the selected scope tab (which layer you write) are distinct axes, so the detail pane shows both: value (effective) is the merged result, and the in <scope> line is the selected layer's own value — or (unset — inherits <layer>) when that layer does not set the key. Switching tab re-reads this per-scope line, so the two layers are genuinely browsable side by side. Editing a key the current scope does not set is announced as creating an override (a deliberate fork, not a surprise), and r on such a key is a no-op that says so rather than silently doing nothing. Values coming from a TOOLBOX_* env var are shown read-only (writing a file value the env var still overrides would only confuse). Each key gets an editor matched to its type: bounded select for enums (pull / shell, current value marked), free text for strings (image / registry_mirror / mounts_root), a three-way toggle for the optional bools (bridge / proximo / managed_statusline / image_reclaim) where unset is persisted by removing the key (distinct from false — e.g. proximo unset = auto-detect), a catalog-driven multi-select for inherit_host_auth, row editors for the env / shells maps, and a multi-select disable editor for the default mounts; collection keys list their entries in the detail pane. A live preview shows the pending edit as a diff against the current file: the edit's own mutation rendered over the real document, so it stays truthful about the writers that read the document before deciding — a mounts disable patch folded into a richer user entry, a shells rename that keeps its env: block. An edit that would change nothing says so instead of showing an unchanged fragment. r resets the selected key to its default in the current scope (the same key-removal path as tri-state unset). The deprecated browser_bridge is never shown as its own row — its value surfaces through bridge.
For mounts, the structured editor covers the common operation (disable a default mount) and e opens the target file in $EDITOR (fallback vi) as an escape hatch for cases the structured editor does not cover — richer patch/replace/append entries — re-reading the file on return. The command requires an interactive terminal on both stdin and stdout; run without a TTY (piped or in CI) it exits non-zero with a clear message and changes nothing.
Edit the mounts: list / mounts_root: key without hand-editing YAML. The writers take --where and --dry-run. Full semantics: mounts.
| Subcommand | Description |
|---|---|
list [--defaults-only] |
List the effective mount set, each entry classified against the defaults. |
add <name> --source <host-path> --target <container-path> [--readonly] [--where] [--dry-run] |
Add a mount entry, or replace the default of that name. |
disable <name> [--where] [--dry-run] |
Disable a mount by name. |
remove <name> [--where] [--dry-run] |
Remove a user mount entry. |
root <path> [--where] [--dry-run] |
Set mounts_root, retargeting the default mount sources (empty path resets the key). |
Manage named shell shortcuts (the shells: block). The writers take --where and --dry-run. Full semantics: shells.
| Subcommand | Description |
|---|---|
list |
List the configured named shells. |
get <name> |
Show one named shell's resolved entry. |
add <name> --path <dir> [--create-dir] [--env K=V …] [--where] [--dry-run] |
Add (or replace) a named shell. |
set <name> --env K=V […] [--where] [--dry-run] |
Set env overlay keys on a named shell. |
remove <name> [--purge-dir] [--where] [--dry-run] |
Remove a named shell entry; --purge-dir also removes its directory. |
Manage the host-side bridge daemon (browser / editor / proximo forwarder). Subcommands: install, uninstall, status (plus the hidden daemon the supervisor runs). browser-bridge survives as a deprecated alias. Full semantics: bridge.
Generate shell completion scripts: toolbox completion [bash|zsh|fish].
Every config-writing subcommand (toolbox shells add|set|remove, toolbox mounts add|disable|remove|root, toolbox config set) accepts --where global|local (default global), mirroring the per-user/per-repo duality of the load order:
global → configio.GlobalConfigPath() (~/.toolbox.yaml). Default because shells/mounts are naturally per-user.local → the walked-up project .toolbox.yaml (config.WalkUpProjectConfig, the same walk-up Plan uses), so the existing project file is patched in place rather than shadowed by a stray ./.toolbox.yaml. Only when the walk-up finds nothing is ./.toolbox.yaml created in the CWD.Resolution lives in configedit.Resolve (internal/configedit/where.go). Every writer reports the touched file as <path>: created|updated|unchanged (idempotent re-runs render byte-identically and report unchanged). Files created by a writer start with a header comment pointing at toolbox config example (configedit.Render, D7: the header policy lives in configedit, keeping configio a policy-free leaf). Every write also passes the config doctor before it lands: the candidate document is rendered in memory, validated as the top of the layer stack it belongs to (minus whatever the other layer already reports on its own), and only then written — so a rejected edit reports the finding, exits non-zero and leaves the file byte-identical (nothing is created either). config edit is the exception, because $EDITOR writes the file directly: it runs the same checks after the editor exits, prints the findings and exits non-zero, but never reverts what you saved. See config provenance & doctor and, to see a write before running it, dry runs.
Resetting a scalar. Passing an empty value to a scalar writer (toolbox config set --image "", toolbox mounts root "") removes the key from the targeted file rather than writing it empty. An explicit empty value is an override that means "no override": it would still shadow whatever the layer below sets and leave a key behind for the next reader to puzzle over. One rule for every top-level scalar (configedit.Scalar), so a reset behaves the same wherever you spell it.
Every subcommand that accepts --where also accepts --dry-run: it prints on stdout the whole file the write would produce and touches nothing — no file created, no file modified, exit 0. The output is the candidate document and nothing else, so it pipes and diffs:
toolbox config set --pull never --dry-run | diff ~/.toolbox.yaml -
toolbox mounts add scratch --source ~/scratch --target /scratch --dry-run > candidate.yaml
It is a preview of the command, not merely of its rendering: the candidate goes through the same doctor gate the write does, so an edit that would be rejected fails the dry run with the same message and prints nothing. What passes is what would land — byte for byte, header on creation included, because configedit.Preview is configedit.ApplyChecked minus its final write rather than a second rendering that has to be kept in step with it.
The two writer flags that reach past the config file are named instead of performed, on stderr so stdout stays the document: shells add --create-dir says which directory it would create, shells remove --purge-dir which one it would delete.
The shell --create bootstrap has no --dry-run — it writes shells.<name>.path as a side effect of entering a shell, not as a writer command. To see that entry first, dry-run the writer that applies the same mutation: toolbox shells add <name> --path <dir> --dry-run.