Skip to main content

rho_coding_agent/
cli.rs

1use std::path::PathBuf;
2
3use clap::{Parser, Subcommand};
4
5use crate::reasoning::ReasoningLevel;
6
7#[derive(Parser, Debug)]
8#[command(name = "rho")]
9pub struct Cli {
10    #[arg(long)]
11    pub provider: Option<String>,
12    #[arg(long)]
13    pub model: Option<String>,
14    #[arg(long)]
15    pub config: Option<PathBuf>,
16    #[arg(long, value_parser = ["api-key", "codex", "anthropic-api-key", "github-copilot"])]
17    pub auth: Option<String>,
18    /// Do not send rho's system prompt, including AGENTS.md and skill context.
19    #[arg(long)]
20    pub no_system_prompt: bool,
21    /// Do not expose any tools to the model.
22    #[arg(long)]
23    pub no_tools: bool,
24    /// Override reasoning level: off, minimal, low, medium, high, xhigh, or max.
25    #[arg(long)]
26    pub reasoning: Option<ReasoningLevel>,
27    /// Resume an existing session by UUID or UUID prefix. Omit the ID to choose from a picker.
28    #[arg(short = 'R', long, value_name = "ID", num_args = 0..=1)]
29    pub resume: Option<Option<String>>,
30    #[command(subcommand)]
31    pub command: Option<Command>,
32}
33
34#[derive(Subcommand, Debug)]
35pub enum Command {
36    /// Run one non-interactive automation prompt and print the final answer.
37    Run {
38        /// Read additional prompt text from stdin.
39        #[arg(long)]
40        stdin: bool,
41        /// Prompt text to send to the agent.
42        #[arg(value_name = "PROMPT", num_args = 0..)]
43        prompt: Vec<String>,
44    },
45    /// Log in to a provider from a browser or device-code flow.
46    Login {
47        /// Provider to authenticate, for example openai-codex or github-copilot.
48        #[arg(value_name = "PROVIDER")]
49        provider: String,
50        /// Use Codex OAuth device-code login instead of opening a local browser callback.
51        #[arg(long)]
52        device_auth: bool,
53    },
54    /// Update rho using the detected installation method.
55    Update,
56}