Crewship CLI
Thecrewship command-line interface is the supported way to drive a Crewship instance from your terminal — and the same surface agents use to operate Crewship themselves. It covers everything from running an agent and tailing the journal to managing crews, skills, credentials, routines, and workspace administration.
This page is the index: global flags and authentication first, then the top-level commands grouped by what they do. Multi-subcommand areas (agent, crew, issue, routine, workspace, integration) each have their own dedicated page.
Global Flags
Every command inherits these persistent flags:
In addition:
CREWSHIP_DEFAULT_AGENT env var sets the default agent for crewship ask / crewship explain. Resolution order: command-line flag → env var → config key.
Exit codes & machine-readable errors
Every command exits with a classified code, so scripts and agents can branch on the kind of failure without parsing error prose:crewship wait keeps its own run-outcome codes (0 completed / 1 failed / 2 cancelled / 3 timeout / 4 connection error) — those describe the run’s terminal state, not a command failure. See the Wait page.
When the output format is json, ndjson, or yaml, errors are emitted on stderr as a structured envelope in that same format (stdout stays reserved for success output):
missing_integrations) pass through under error.extensions.
Discovering the CLI surface
crewship commands dumps the full command tree — every command, subcommand, and flag — as a machine-readable manifest. This is the recommended way for an agent to learn the CLI in one call instead of scraping --help page by page:
crewship api. Discovery works offline.
Authentication
crewship init
Initialize Crewship with the first admin user on a fresh database.
This command only works on an empty database (no existing users). It creates an admin user with OWNER role and returns a CLI token.
crewship login
Authenticate the CLI with a Crewship server.
The token is saved to
~/.crewship/cli-config.yaml.
CREWSHIP_TOKEN (headless auth)
For CI jobs and agent containers, export CREWSHIP_TOKEN instead of running crewship login — no config file needed:
--server exfiltration) does not apply.
crewship logout
Remove the stored authentication token.
crewship whoami
Display the current user and workspace info.
Server
crewship start
Start the Crewship server.
Agent Execution
crewship run
Run an agent with a prompt and stream output to the terminal.
crewship run list
List recent runs across all agents. See also crewship history for a friendlier view with optional prompt previews.
crewship ask
Low-friction one-shot prompt against a default agent. Inherits the same --with-*, --save, --markdown, --dry-run, --estimate, and --paste flags as run. The agent is resolved from --agent flag → CREWSHIP_DEFAULT_AGENT env var → default-agent config key → interactive picker (TTY) → error. --agents <list> runs the same prompt against multiple agents in parallel.
crewship ask with no positional arg or default to launch a huh picker that lists every agent in the workspace. The picker offers to save the choice as the new default.
crewship retry
Re-run a previous run. Recovers the original first user prompt from the chat history and starts a new run on the same agent.
crewship copy-prompt
Recover the original prompt of a previous run without running anything. Pairs naturally with crewship retry --new-prompt for tweak-and-rerun loops.
crewship explain
Summarize what happened in a run via the default agent. Fetches journal entries scoped to the run’s agent + start window and asks the agent for a 3-6 bullet summary.
crewship watch
Live-tail the Crew Journal. Top-level alias for journal --follow.
crewship inspect
Show a structured journal timeline of a run (no LLM, instant). Sibling of explain.
crewship apply
Apply a YAML manifest describing a crew or workspace (agents + skills + credentials + sidecar services). Idempotent, plan-then-confirm. See CLI → apply and Guides → Workspace Manifests.
crewship export
Two distinct shapes:
crewship prompt
Local prompt library at ~/.crewship/prompts/<name>.md. Server-free.
crewship open
Open a web UI deep-link in your default browser.
inbox (dashboard, home), activity, agents, agent <slug>, crews, crew <slug>, chat <agent-slug>, mission <id>, journal, approvals, integrations, routines, issues [id], runs, settings, admin, audit, credentials.
crewship chat
Print the full message history of a chat session as a rendered transcript.
crewship agent files | inbox | git-log
Per-agent introspection beyond agent debug:
crewship triage | recurring | saved-view | mcp-calls | metrics
Thin surfaces over existing API endpoints — --filter for jq, --format json|yaml for scripts.
crewship lint | doctor --fix | config validate
Local hygiene:
crewship logs
View agent logs.
Observability
crewship activity
View the cross-crew activity feed including assignments, peer conversations, and escalations.
crewship audit
View audit logs for the workspace.
crewship cost
Single-screen spend summary: total, top spenders, per-crew rollup, active subscription plans.
For per-crew or per-agent rollups in full fidelity, see
crewship paymaster.
crewship recall
Free-text search across the Crew Journal. Renders matched entries as snippet cards with the search term highlighted.
Hits the
/api/v1/journal?q= FTS5 endpoint. Server caps the query at 200 chars.
crewship history
Recent runs across the workspace with timestamp, agent, status, and trigger. Optional prompt preview per run.
Token Management
crewship token list
List all CLI tokens.
crewship token create
Create a new CLI token.
name argument defaults to "CLI token" if omitted.
crewship token revoke
Revoke a CLI token.
crewship token validate
Validate the current CLI token.
Diagnostics
crewship version
Print version information including commit hash, build date, Go version, and OS/architecture.
crewship doctor
Check system requirements and health: container runtime detection, data directory, and database status.
crewship completion
Generate shell completion scripts.
Shell completion setup
Shell completion setup
Bash:Zsh:Fish:
Seed Data
crewship seed
Seed demo data via the API. Creates a complete demo environment: admin user, workspace, crews, agents with system prompts, credentials, integrations, and sample issues.
On a fresh database,
seed automatically bootstraps the first admin user. On an existing database, it requires authentication via crewship login.Output Formats
All list and detail commands support--format (-f), and so does every
mutation that hands you back something the next command needs (see
Mutations that return their result):
json, yaml, ndjson) equivalently on stdout, and under a machine format
errors go to stderr as a structured envelope in that same format (see
Exit codes & machine-readable errors above).
Keys are identical across formats: a field named created_at under -f json is
created_at under -f yaml too, so yq .created_at on the YAML output and
jq .created_at on the JSON output read the same value. A
few commands have a different default than table:
journaland its subcommands default totext.- Structured-record commands with no canonical table —
agent debugandsystem onboarding status— default tojson(withyaml/ndjsonhonoured), andmetricsdefaults tojson(withyamlhonoured).
An empty result is [], never null
Any command whose answer is a list emits an empty array when it finds nothing —
never a bare null. This matters more than it looks: Go marshals an unfilled slice as
null, so before this was fixed centrally a list command answered [] on a populated
workspace and null on an empty one, which meant crewship prompt list -f json | jq '.[]'
worked while you were developing against seeded data and failed with
Cannot iterate over null on a fresh install.
[]; an absent object is still null, because {} and null
mean different things for a record and nothing iterates an object the way .[]
iterates an array.
Where stdout is not a document
--format describes how a result is rendered. Four kinds of command put something
else on stdout, and for them the flag has nothing to convert:
The one documented exception on the error side is
crewship wait: it owns its
run-outcome exit codes and prints [wait] error: diagnostics to stderr as plain text
even under a machine --format (no structured error envelope). See the
Wait page.
Success receipts belong on stderr
A command that changes something prints its confirmation (✓ Integration enabled) to
stderr, so stdout stays clean for whatever the command returns. The answer to “did
it work” is the exit code. Some mutation commands still print their receipt on stdout;
that is a known cleanup, and TestMutationReceiptsOnStdoutDoNotGrow in
cmd/crewship keeps the population from growing.
Mutations that return their result
A mutation whose result the caller has to read — the identifier the server just minted, or the new state of the thing that changed — renders that result on stdout under-f json / yaml / ndjson, in the same shape the matching read command emits,
so one parser handles both. Under the default table the human receipt on stderr is
unchanged. The population is closed and guarded
(TestMutatingCommandsReturnTheirResultMachineReadably in cmd/crewship):
Mutations outside this table are not on the guarded contract. Most are a bare receipt
whose real answer is the exit code and print nothing on stdout under
-f json; a few
(admin gdpr delete, backup self-test, backup rotate, …) already render a
receipt object. Do not script against the machine output of a
mutation that is not in the table — check the command’s own page first.
Resolving resource references
Anywhere a command takes an agent, crew, skill, or credential reference, you can pass either the record id or the human identifier — the slug for agents, crews, and skills (display names don’t resolve), and the name for credentials and integrations (which have no slug) — including slugs that happen to look like ids. CUID-shaped input is first verified with a single lookup; on a miss the CLI falls back to slug/name resolution, so a slug likecustomersuccessemea42 resolves
correctly instead of failing as an unknown id. A reference that resolves to nothing
exits with the not-found code (3) rather than a confusing server-side error.
Trace and automation workflows
The orchestration surfaces answer four related operational questions:- What caused this?
crewship chain <anchor>follows the causal graph around an issue, run, routine, assignment, or journal entry. Use--format jsonwhen a script needs the graph. See thechainreference. - Why did this run start?
crewship routine records <slug>exposes run provenance such aschain_depth,chain_origin, and the automation that fired the run. See the routine reference. - What will start future work?
crewship automation list|create|update|enable|disable|deletemanages workspace rules that enqueue routines from journal events. Automations enqueue deferred work; they do not execute routines inline. See theautomationreference and automations guide. - Does the crew match its declared runtime?
crewship crew container-status <slug-or-id>compares configured and effective container limits and explains whether an operator needs to act. Use--format jsonfor scripts. See the crew reference.
chain when the origin is unknown, inspect routine records to identify
the trigger, then use the journal or run detail command for the complete evidence.
Other commands (run --help for details)
The list below covers top-level commands that ship in the binary but
don’t yet have a dedicated page on this site. Most are stable; some
are internal or experimental. Use crewship <command> --help for the
full flag list while we work through expanding the per-command
reference.
Anything missing from this table that you reach for often is a docs
bug — open an issue or PR.
AI client integration
The binary bundles an MCP server and Agent Skill. Usecrewship ai connect codex
or crewship ai connect claude for native client registration. For other clients,
crewship ai config prints a token-free MCP configuration. See AI clients
for skill installation, supported transports and write permissions.