Skip to main content

Crewship CLI

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.

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):
Extension members from RFC 7807 responses (e.g. 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:
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.

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

crewship logout

Remove the stored authentication token.

crewship whoami

Display the current user and workspace info.
Outputs the user email, server URL, active workspace name, and user role.

Server

crewship start

Start the Crewship server.
A container runtime (Docker, Podman, Colima, OrbStack, Apple Containers) is required to run AI agents. Use --no-docker for dashboard-only mode.

Agent Execution

crewship run

Run an agent with a prompt and stream output to the terminal.
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.

crewship run list

List recent runs across all agents. See also crewship history for a friendlier view with optional prompt previews.
Output columns: ID, AGENT, STATUS, TRIGGER, CREATED, FINISHED

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

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:
See CLI → export for details.

crewship prompt

Local prompt library at ~/.crewship/prompts/<name>.md. Server-free.

crewship open

Open a web UI deep-link in your default browser.
Resources: 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.
Output columns: ID, NAME, CREATED, LAST USED, STATUS

crewship token create

Create a new CLI token.
The name argument defaults to "CLI token" if omitted.
The token value is displayed only once at creation time. Store it securely.

crewship token revoke

Revoke a CLI token.
Revocation is immediate and irreversible — any session or script still using that token stops working at once.

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.
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.
--nuke deletes all existing workspace contents before seeding. There is no undo — only run it against a throwaway dev instance.
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):
The guarantee is uniform: commands that emit structured output honor all three machine formats (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:
  • journal and its subcommands default to text.
  • Structured-record commands with no canonical table — agent debug and system onboarding status — default to json (with yaml/ndjson honoured), and metrics defaults to json (with yaml honoured).
The one documented exception 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.

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 like customersuccessemea42 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.