6. CLI Reference
rayu [options] [command] [prompt]
- No command + no
--print→ interactive session (TUI). --print "..."(or piped stdin) → non-interactive single run.- A
command(e.g.mcp,update) runs that subcommand.
Common options
Run rayu --help for the complete, current list.
Note on Rayu providers:
--modelaccepts any model id your active provider serves (e.g.meta/llama-3.3-70b-instruct). To pick the provider, use/connect, the savedproviders.json, or theRAYU_OPENAI_*env vars (see Providers). Anthropic aliases (sonnet,opus,haiku) only apply to the Anthropic provider.
Subcommands
Output formats (--print)
text— plain text result (default).json— a single JSON result object withresult,usage,total_cost_usd,num_turns,session_id, etc.stream-json— newline-delimited JSON events as they arrive (pair with--input-format stream-jsonfor streaming input).
rayu --print --output-format json "list the modules" | jq .result
Permission modes & safety
By default Rayu asks before running tools that modify files or execute commands.
--permission-mode acceptEdits— auto-accept file edits.--permission-mode plan— plan first, don't execute.--permission-mode bypassPermissions(or--dangerously-skip-permissions) — run everything without prompting. Only use in a sandbox / disposable environment with no sensitive data or network access. In non-interactive--printmode this is often required for tool-using runs (there is no prompt to approve).
Exit codes
0— success.1— error (e.g. API error, no input provided to--print, invalid args).
Next: Slash Commands →