Docs

CLI cheat sheet

Every shell command in the Go binary. The words you type inside a session are on workflows.

Run a task

CommandWhat it does
captain "<task>"Route one task: triage, pick a leg, run it, assess it
captain with <leg> "<task>"Force one leg for this task (openshell uses the sandbox runner)
captain --prefer quality|speed|save "<task>"Lane preference: quality and save rotate legs; the director picks inside speed
captain --until "<cmd>" [--max-iters 5] "<task>"Loop until the shell command exits 0
captain --no-manager "<task>"Skip the director; pure heuristic ladder
captainInteractive REPL in a terminal

Privacy before you commit

CommandWhat it does
captain leakcheck --staged / --message-file F / --pre-push / FILE…Refuse text that names a private project, paper, person or tool in ~/.config/captain/private-names. Exit 3 lists hits. The captaincode repo enables git hooks that run this on commit and push
captain private-names / add|dismiss|remove NAME… / suggest [DIR]The list leakcheck reads; same as /private in the TUI

OpenShell (experimental)

CommandWhat it does
captain openshell profilesGenerated sandbox inference profiles from the registry
captain openshell qualifyRun the pilot fixture so a profile may be selected for new tasks
captain openshell --resume <run-dir>Resume a checkpointed sandbox sequence

Requires prepared OpenShell env vars. See OpenShell docs and upstream CONFIGURATION.md.

Setup and health

CommandWhat it does
captain doctorBuild identity, toolchain pins, capability probes, leg readiness; warns if CAPTAIN_DIRECTOR names a leg that is not ready
captain doctor --rehearseClean-machine install/upgrade/rollback rehearsal
captain init [--check]Write worker permissions, the captain provider, the slash commands and the env scaffold; --check reports what would change without writing
captain upgrade [--check] [--no-restart]Update claude, cursor-agent, opencode and captain with each tool's own updater; restart services only when nothing is running
captain upgrade --models [--apply]Model pins the ranking flagged as outdated; --apply writes the new pins
captain legs / legs capsActive legs (transport, model, price, prior, context) and their capabilities
captain legs add <id> <provider/model> [flags]Add or update a leg without a rebuild; captain init then adds its TUI entries
captain legs remove <id> / legs reopen <id>Drop or disable a leg; lift a leg's cooldown now
captain priors / priors sync [--apply]Active quality priors and their source; refresh them from the Artificial Analysis coding index
captain adi / adi refreshADI standing per leg (green, red, not measured) and green tuples no leg serves yet
captain state [--last] [<folder>]The per-folder TUI state directory (history, model, preferences)

Routing and decisions

CommandWhat it does
captain director / director <leg> / director resetShow or switch the director ladder
captain whyLast routing decision: candidates, exclusions, policy, charges
captain quotaObserved/inferred quota per leg
captain budgetPer-task budgets (attempts, cost, mode, stopping reason)
captain statsAggregate ledger stats
captain jev / jev classify <task> / jev ask …The Jev decision leg: probe it, see the triage questions with their probabilities, or ask any typed question
captain jev shadow / jev conform [--json]How often Jev agreed with captain per decision point, and whether a backend answers captain's questions
captain gate --status / --check "<cmd>" / --reportThe action gate at the tool boundary: current mode, one command screened by hand, the screenings as a calibration

Watch and control runs

Run controls reach the brain over HTTP and work while a TUI turn streams. runs and show read local history; ui attaches to the worker server.

CommandWhat it does
captain status / captain watchThe live (or last) workflow checklist once, or redrawn until it ends
captain runs [-n 20] [--leg l] [--kind k] [--grep text] [--failed]Run history (alias captain history)
captain show [<id>|last]One run with its full output
captain kill [--loops]Stop the worker run in flight; --loops also ends /repeat
captain stop [--finish|--abort] [--all]End /repeat loops after the current round
captain send [--cwd <dir>] [--leg <leg>] "<prompt>"Queue a prompt into the TUI open in a folder, as if typed
captain uiOpen opencode's own TUI on the worker sessions

Skills

CommandWhat it does
captain skills / skills listThe vetted shelf: what is synced, from which commit, under which license
captain skills sync [--source r] [--commit sha] [--only a,b] [--dry-run]Fetch a first-party catalog at a named commit, vet it, hash it into skills.lock
captain skills select "<task>" / stage / unstageWhat would be stocked for a task and why; stage or clear that shelf by hand
captain skills verifyRecompute every locked hash against disk
captain skills report [--skill <name>]Most stocked, most used, best graded

Evaluation and release

CommandWhat it does
captain eval validate <suite.json>Suite schema; fixtures are reproducible
captain eval verify <suite.json>Non-vacuous fixture gate
captain eval plan <suite.json>The executions the suite would run
captain eval run <suite.json> --out <result.json>Execute arms (uses provider credits)
captain eval review <result.json>List or record blinded verdicts
captain eval report <result.json>Acceptance / cost / latency table
captain release manifest / compat / check / reportRelease manifest, compatibility table, extraction checks, dated evidence report

Tasks, MCP and hosts

CommandWhat it does
captain task fixtureRun task API contract checks against a live brain (submits a test task)
captain task mcpStdio MCP: plan, submit, inspect, events, artifacts, cancel, resume
captain task plan|submit|inspect|events|artifacts|cancel|resume …Same contract over HTTP /v1/task
captain host pi / jido / certHost helpers and certification against a live brain
captain cancel / lifecycle / resumeCancellation and recovery
captain handoff [id]Structured handoff brief

Outcomes and policy

CommandWhat it does
captain outcomes [<task-id>] / outcomes --settleAcceptance evidence, checks, corrections; settle what the evidence decides
captain outcome <task-id> review|correction|regression …Record a human verdict, fix-up time, or a later regression
captain calibrate [--domain d] [--json]Quality/reliability estimates with uncertainty
captain rolesRole economics roll-up
captain policy / policy snapshot|activate|accept|showPolicy snapshots
captain policy canary|promote|rollbackTry a candidate on a share of tasks, compare it per cohort, or restore the last accepted snapshot
captain policy distillExport the labelled routing history a small router would train on
captain refine [--apply|--rollback]Director-proposed leg notes and prior nudges from the ledger; nothing written without --apply

Euclid memory (opt-in)

CommandWhat it does
captain euclid init [--repo]Scaffold ~/.euclid or a repo brain
captain euclid status / checkWhich brains are read and written; the launch check
captain euclid distill [--apply] / bootstrap [--apply]Propose register edits from the run journal, or bootstrap from repo docs; --apply writes your own brain, never the shared one
captain euclid share [--apply] / fold [--dry-run]Make the repo brain shareable; fold promoted notes into it (the CI step)
captain euclid link <repo> / links [--apply]Declare cross-repo links and list proposals
captain euclid ensure / reindex / corpus / probesLaunch-time indexing, index rebuild, corpus roots, benchmark gold sets
captain euclid mcpMemory MCP server (search, ask, recall, registers, note)

Services and plumbing

The launcher runs these; you rarely call them by hand.

CommandWhat it does
captain brainThe brain: routing policy, the endpoint the TUI talks to, the task API
captain proxyThe egress redaction proxy on its own (the brain runs one itself)
captain redact …The redaction engine for the opencode plugin and the Claude Code hook

When CAPTAIN_TASK_TOKEN is set, every /v1/task request needs Authorization: Bearer …. Unset keeps the task API loopback-only. See security.

Flags and details live in the source tree as docs/CLI.md, with settings on configuration.