Three modes, one CLI
Every serious AI CLI ships three execution modes, and they map onto fundamentally different jobs. Recognize which mode you want before typing a flag — most "the CLI doesn't work for me" stories are mode confusion.
Interactive (default). A live REPL. You type, it streams a response, you redirect mid-thought, you press Esc to interrupt. This is where exploration, debugging, and mid-task pivots happen. Conversation state is in memory; close the terminal and it's gone unless you resume by id.
Print / exec / non-interactive. Single-shot, exits when done, writes to stdout. The same model running, but no UI, no streaming, no follow-up. This is the mode you script around: claude -p, codex exec, gemini -p. It pipes, it composes with other tools, it cron-jobs. If you find yourself copy-pasting a prompt twice, switch to print mode.
Automation / cloud. Long-running, no human in the loop. Background agents, GitHub Actions runs, scheduled jobs. Same engine, but with pre-approved tools (--allowedTools) so there's nothing to click on. Automation is print mode plus a permission story plus a logging story.