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

When stdin is a pipe and a positional prompt is also given, the positional becomes the instruction and stdin becomes the context.

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.

See also