Desktop App
CLI tool
The Spatial CLI is the terminal-first interface for automation, scripting, and non-interactive execution loops.
What it is
The CLI runs Spatial sessions from terminal and emits NDJSON events suitable for pipes, wrappers, and automation scripts.
- Prompt mode example: `spatial -p "do something" -m build`
- Automation mode example: `spatial --stdin-only`
Key options
- `--prompt` / `-p`: initial prompt text.
- `--mode` / `-m`: agent mode (`plan`, `build`, `yolo`).
- `--model`: model ID override.
- `--cwd`: working directory.
- `--stdin-only`: drive requests from stdin instead of initial prompt.
- `--unattended`: auto-approve behavior for unattended flows.
- `--builtin-whitelist`: built-in command whitelist toggle.
CLI vs Desktop app
- Use CLI for scripts, scheduled jobs, CI helpers, and terminal-native automation.
- Use Desktop app for richer UX: preview workflows, widget sidebar, popout chat, and visual session/project management.
- Both are useful: prototype workflows in app, then codify repetitive flows in CLI scripts.
Requirements
CLI provider auth requires either `ANTHROPIC_API_KEY` or `GATEWAY_API_KEY` in environment variables.