Skip to main content

crewship ask

ask is the low-friction prompt — type a question, get an answer, no agent slug to remember. The agent resolves from --agent, then the CREWSHIP_DEFAULT_AGENT env var, then the saved default-agent config key, then (in a TTY) an interactive picker. Designed for shell pipelines like git diff | crewship ask --stdin "review this". Defined in cmd/crewship/cmd_ask.go.
A new chat is created per invocation (origin tagged CLI, so the web UI sidebar shows a violet CLI chip). To send follow-ups to an existing chat, use crewship run --chat <chat-id> instead. Auth: requires crewship login plus a workspace context. Both checks are skipped in offline modes (--dry-run, --estimate).

The no-subcommand shortcut

ask is also reachable straight from the root command, so a quick question doesn’t need a subcommand at all:
A bare one- or two-word invocation is treated as a mistyped subcommand, not a prompt. Commands are <noun> <verb> (crewship routine list), so a typo is almost always one or two slug-shaped tokens — and dispatching those to an agent silently starts a paid run instead of failing. A CLI typo in a script must exit non-zero, not spend money, so:
Three or more bare words are still sent as a prompt (crewship why is this slow), as is any single argument containing whitespace (crewship "say hi"). To force a short prompt through, use -p — it always bypasses the guard: crewship -p "schedule list".

Flags

--dry-run and --estimate are mutually exclusive with the chat-creation path: nothing hits the server.

Examples

Smallest case

If default-agent isn’t set and stdin is a TTY, the CLI opens a picker. After choosing once, it offers to save the pick as the default so subsequent ask calls are zero-config.

Pipe stdin as the prompt

With no prompt argument, piped stdin is read to EOF and becomes the prompt. Once a prompt is given (positional or --prompt), stdin is not read unless you pass --stdin: then the positional is the instruction and stdin is appended as context. Without --stdin the CLI never touches stdin, so a harness, CI step or cron job whose stdin is a pipe nobody closes cannot hang it; when stdin is a pipe or a file it prints a one-line [stdin not read …] hint on stderr instead.

Compose context flags

Every --with-* flag is appended as a fenced markdown block; the assistant sees them in order.

Fan out to multiple agents

Runs all three agents in parallel against the same prompt. Each agent’s stream is interleaved with a coloured prefix so you can scan who said what.

Dry-run the assembled prompt

Useful for double-checking which context blocks survived deduplication before paying for inference.

Estimate cost without running

Prints input-token count and a rough cost figure based on the workspace’s pricing config.

Save the response for later

--save writes the unstyled markdown via an atomic tempfile — a crashed run leaves the previous file intact rather than truncating it.

Read the prompt from stdin

Configuration

Set the default agent once:
Saved to ~/.crewship/cli-config.yaml. Unset by passing an empty string or deleting the key.

Common errors

  • no default agent set. Use --agent <slug>, --agents <list>, or run 'crewship config set default-agent <slug>' — non-TTY mode (CI, piped stdin) and no agent specified.
  • prompt is required (positional, --prompt, stdin pipe, or --with-* flag) — the assembled prompt was empty.
  • no agents available in this workspace — the picker fired but GET /api/v1/agents came back empty.
  • agent busy: <message> — that agent already had a live run, so the send was rejected and nothing ran. In a fan-out it fails only that agent’s slot; the others still answer.

See also