The crewship 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.
Workspace ID or slug. Also via CREWSHIP_WORKSPACE env var.
--format
-f
string
table
Output format: table, json, yaml, ndjson, or quiet. A few commands still accept a legacy --json bool — it is a deprecated alias for --format json.
--verbose
-v
bool
false
Verbose output.
--no-color
bool
false
Disable ANSI colors.
--server-allow-mismatch
bool
false
Allow sending the stored auth token to a --server host that differs from the one it was issued for. Also via CREWSHIP_ALLOW_SERVER_MISMATCH env var.
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.
Every command exits with a classified code, so scripts and agents can branch on the kind of failure without parsing error prose:
Code
Meaning
0
Success
1
Unclassified error
2
Validation failure (HTTP 400 / 422)
3
Not found (HTTP 404)
4
Auth failure (HTTP 401 / 403, not logged in, token-host mismatch)
5
Conflict (HTTP 409)
6
Rate-limited (HTTP 429)
7
Server error (HTTP 5xx)
8
Network failure — the request never produced a response
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):
{ "error": { "message": "API error (404): agent not found", "status": 404, "detail": "agent not found", "exit_code": 3 }}
Extension members from RFC 7807 responses (e.g. missing_integrations) pass through under error.extensions.
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:
Token-host binding. Your CLI bearer token is bound to the host it was
issued for (the server stored in ~/.crewship/cli-config.yaml). If --server
or CREWSHIP_SERVER points a command at a different host, the CLI refuses to
attach the token and aborts the request before it hits the network — so a
copy-pasted crewship --server http://attacker.example me can never leak your
credential to an attacker-controlled host. When you intentionally retarget
(SSH tunnel, the server moved), either re-run crewship login --server <url>
to rebind the token or pass --server-allow-mismatch /
CREWSHIP_ALLOW_SERVER_MISMATCH=1.
The env token wins over any stored config/profile token and is scoped to the shell. Unlike the persisted token it is not host-bound: you provided it for this exact environment, so the token-host guard (which protects the on-disk credential from --server exfiltration) does not apply.
Run an agent with a prompt and stream output to the terminal.
crewship run <agent-slug> [prompt]crewship run viktor "Create a REST API"crewship run viktor --prompt @task.txtcrewship run viktor --prompt @- # read prompt from stdincat error.log | crewship run viktor "what's wrong?" # auto-append stdin as contextcrewship run viktor "review" --with-git-diffcrewship run viktor "explain" --with-file notes.md --with-file plan.mdcrewship run viktor --interactivecrewship run viktor --chat <chatId> "follow-up question"
Flag
Short
Type
Default
Description
--prompt
-p
string
Prompt text, @file.txt, or @- for stdin.
--interactive
bool
false
Interactive chat mode (REPL).
--chat
string
Continue an existing chat by chat ID.
--no-stream
bool
false
Wait for completion, show only the final result.
--quiet
-q
bool
false
Only output text, suppress meta info.
--timeout
int
0
Timeout in seconds (0 = no timeout).
--with-git-diff
bool
false
Append git diff (working tree) as context.
--with-git-staged
bool
false
Append git diff --staged as context.
--with-git-log
bool
false
Append last 20 commits as context.
--with-git-status
bool
false
Append git status -s as context.
--with-file
[]string
Append file contents as context (repeatable).
--with-cmd
[]string
Append shell command output as context (repeatable).
--paste
bool
false
Append system clipboard as context.
--save
string
Tee response to this path (atomic write, no ANSI).
--dry-run
bool
false
Print assembled prompt and exit without sending.
--estimate
bool
false
Print token count + cost estimate and exit.
--markdown
bool
auto on TTY
Force markdown ANSI styling.
--no-markdown
bool
false
Disable markdown ANSI styling.
In interactive mode, press Ctrl+C to cancel the current run. Press Ctrl+D to exit the session.Stdin is auto-detected when piped — git diff | crewship run viktor "review" works without an explicit flag. Piped data is appended after the positional prompt under a --- stdin --- separator. Each context block is capped at 64 KiB and labelled.
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 "what time is it?"git diff | crewship ask "review this change"crewship ask "summarize" --with-file notes.mdcrewship ask --agent viktor "explain how the journal works"crewship ask --prompt @- # full prompt from stdin# One-time setup so future asks don't need --agent:crewship config set default-agent viktor
Run 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.
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 retry r_abc # same agent, same prompt, NEW chatcrewship retry r_abc --continue # append to the SAME chatcrewship retry r_abc --new-prompt "be more specific"
Flag
Type
Default
Description
--new-prompt
string
Override the original prompt.
--continue
bool
false
Append to the original chat instead of starting fresh.
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.
Recent runs across the workspace with timestamp, agent, status, and trigger. Optional prompt preview per run.
crewship historycrewship history --limit 50crewship history --since 7d --status failedcrewship history --prompts # also fetch first user prompt per run
Flag
Type
Default
Description
--limit
int
20
Max runs to list.
--since
string
24h
Time window (filtered client-side).
--status
string
Filter by status (running, completed, failed).
--agent
string
Filter by agent slug or ID.
--prompts
bool
false
Fetch first user prompt per run (slower; one extra GET each).
Seed demo data via the API. Creates a complete demo environment: admin user, workspace, crews, agents with system prompts, credentials, integrations, and sample issues.
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.
Command
Purpose
Note
crewship admin
Operate on the local DB directly when crewshipd is stopped (reset password, promote, list users)
Run the default agent in read-only PLAN mode (architect mode; no tools, no changes)
—
crewship project
Manage projects (and project milestone subcommands) inside the issue tracker
—
crewship recap
AI-generated summary of a chat session (recap <chat-id>)
—
crewship resume
Pick up an existing CLI session by chat-id, run-id, or PR URL
—
crewship session
List and revoke the caller’s active browser sessions (list / revoke)
—
crewship setup
Finish onboarding on an already-authenticated instance (first crew template + adapter + CLI token)
—
crewship shell
Interactive REPL: each line is a prompt to the default agent (slash-commands control state)
—
crewship slash
Run a saved slash-command shortcut against the default agent
—
crewship template
Manage agent and crew templates
—
crewship tui
Launch the interactive terminal UI
—
crewship wait
Block until a run, mission, or waitpoint reaches a terminal state
—
crewship workspace
List, switch, and manage workspaces
Touched briefly in Authentication above
crewship me / today / now
Quick-action dashboards composed from multiple REST endpoints (me = your missions/approvals/runs, today = today’s runs + spend, now = live status board)
—
Anything missing from this table that you reach for often is a docs
bug — open an issue or PR.