crewship run
run invokes a named agent and streams its response over WebSocket. Unlike ask, the agent slug is positional (no default-agent fallback) and the command supports interactive sessions, follow-ups on an existing chat, and shell-friendly streaming. Defined in cmd/crewship/cmd_run.go.
CLI, so the web UI sidebar tags it). Pass --chat <chat-id> to continue an existing thread. Auth: crewship login plus workspace context. Both checks are skipped in --dry-run / --estimate offline modes.
Subcommands
| Command | Purpose |
|---|---|
run <agent-slug> [prompt] | Start (or continue) a streamed run. |
run list | List recent runs across every agent in the workspace (GET /api/v1/runs). |
Flags
| Flag | Default | Effect | ||||
|---|---|---|---|---|---|---|
-p, --prompt <text> | (unset) | Prompt text, @path to read a file, or @- for stdin. | ||||
--interactive | false | Drop into a REPL after the first prompt. Ctrl-D exits, Ctrl-C cancels the current turn. | ||||
--chat <chat-id> | (unset) | Continue an existing chat instead of creating one. | ||||
--no-stream | false | Wait for completion and print the final text only. | ||||
-q, --quiet | false | Suppress [agent: …] / [thinking] / [done] stderr chatter. | ||||
--timeout <secs> | 0 | HTTP timeout (0 = unbounded). | ||||
--with-git-diff | false | Append git diff as context. | ||||
--with-git-staged | false | Append git diff --staged. | ||||
--with-git-log | false | Append the last 20 commits. | ||||
--with-git-status | false | Append git status -s. | ||||
--with-file <path> | (unset) | Append file contents. Repeatable. | ||||
--with-cmd <shell> | (unset) | Append the stdout of a shell command. Repeatable. | ||||
--paste | false | Append the system clipboard (pbpaste / wl-paste / xclip / xsel). | ||||
--dry-run | false | Print the assembled prompt and exit. No auth, no server. | ||||
--estimate | false | Print token-count + cost estimate and exit. | ||||
--markdown | false | Force markdown ANSI styling. | ||||
--no-markdown | false | Disable markdown ANSI styling. | ||||
--save <path> | (unset) | Tee the agent’s text (no ANSI) to path via an atomic tempfile — committed on a clean done, discarded on error. | ||||
--plan | false | Plan mode — step-by-step plan without executing tools. | ||||
--effort <level> | (unset) | Reasoning effort: `minimal | low | medium | high | xhigh`. |
--show-thinking | false | Surface reasoning blocks on stdout (un-truncated). |
Examples
Run an agent
Read the prompt from a file
Continue an existing chat
--chat skips the POST /api/v1/agents/{id}/chats step and sends the prompt straight to the existing session over agent:{agentId} WS.
Stdin as context
Interactive REPL
cancel message over WS) without killing the REPL. A second Ctrl-C exits.
Cancel-friendly streaming
Save the answer to disk
cat adr.md is safe.
List recent runs
--format json for piping (crewship run list --format json | jq '.[] | select(.status=="FAILED")').
Streaming protocol
run subscribes to session:{chatId} and posts via agent:{agentId}. Event types it renders:
| Event | Where it goes | Visible |
|---|---|---|
text | stdout (sanitised; markdown-styled if enabled) | always |
thinking | stderr (truncated) or stdout (--show-thinking) | unless --quiet |
tool_call | stderr, [tool] … | unless --quiet |
tool_result | stderr, [result] … | --verbose only |
status | stderr, [status] … | unless --quiet |
error | stderr, [error] …; exit non-zero | always |
done | stderr, [done]; commit --save tempfile | unless --quiet |
crewship run x "y" || alert) catch it.
Common errors
prompt is required (provide as argument, --prompt flag, or use --interactive)— every path requires content unless you’re starting a REPL.ws read: ...— the WebSocket dropped beforedone. Most often a server restart.agent error: <message>— the model or a tool returned a hard error event. The exit code is non-zero and the message is sanitised before display.save commit: ...—--savetempfile couldn’t be atomically renamed (disk full, permission denied). Reported separately from a stream error so neither one masks the other.
See also
crewship ask— one-shot variant with default-agent resolution.crewship chat— re-read the chat after the run.crewship agent— manage agents, includingstopandlogs.- Runs API —
GET /api/v1/runs.