Skip to main content

opi_coding_agent/
cli.rs

1//! CLI argument parsing (S8.4).
2
3use std::path::PathBuf;
4
5use clap::Parser;
6
7/// opi — AI coding agent.
8#[derive(Debug, Parser)]
9#[command(name = "opi", version, about = "AI coding agent")]
10pub struct Cli {
11    /// Model spec, e.g. anthropic:claude-sonnet-4.
12    #[arg(short = 'm', long)]
13    pub model: Option<String>,
14
15    /// Config file path.
16    #[arg(short = 'c', long)]
17    pub config: Option<PathBuf>,
18
19    /// System prompt file.
20    #[arg(short = 's', long)]
21    pub system: Option<PathBuf>,
22
23    /// Single prompt mode (non-interactive).
24    #[arg(long)]
25    pub non_interactive: bool,
26
27    /// Allow mutating tools (write, edit, bash) in non-interactive mode.
28    #[arg(long)]
29    pub allow_mutating: bool,
30
31    /// Enable debug tracing.
32    #[arg(short = 'v', long)]
33    pub verbose: bool,
34
35    /// Initial prompt (positional).
36    #[arg(trailing_var_arg = true, allow_hyphen_values = true)]
37    pub prompt: Vec<String>,
38}