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:
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):
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). 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).
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.
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.
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.