doum_cli/cli/
args.rs

1use clap::{Parser, Subcommand};
2
3#[derive(Parser, Debug)]
4#[command(name = "doum-cli")]
5#[command(author = "junhyungL")]
6#[command(version = "0.3.0")]
7#[command(about = "AI-powered terminal assistant - Ask about OS commands", long_about = None)]
8pub struct Cli {
9    #[command(subcommand)]
10    pub command: Option<Commands>,
11
12    /// Auto mode: Automatically select mode based on input
13    #[arg(value_name = "INPUT")]
14    pub input: Option<String>,
15}
16
17#[derive(Subcommand, Debug)]
18pub enum Commands {
19    /// Configuration management
20    Config {
21        #[command(subcommand)]
22        action: Option<ConfigAction>,
23    },
24    /// Secret management (API keys, tokens)
25    Secret {
26        /// Provider name (openai, anthropic)
27        provider: Option<String>,
28    },
29    /// Switch provider and model
30    Switch {
31        /// Provider name (optional)
32        provider: Option<String>,
33        /// Model name (optional)
34        model: Option<String>,
35    },
36    /// Ask questions (Ask mode)
37    Ask {
38        /// Question to ask
39        question: String,
40    },
41    /// Suggest and execute commands (Suggest mode)
42    Suggest {
43        /// Request description
44        request: String,
45    },
46}
47
48#[derive(Subcommand, Debug)]
49pub enum ConfigAction {
50    /// Show all configuration
51    Show,
52    /// Reset all configuration to default
53    Reset,
54    /// Set a configuration value
55    Set {
56        /// Configuration key (e.g., llm.timeout, context.max_lines)
57        key: String,
58        /// Configuration value
59        value: String,
60    },
61    /// Get a configuration value
62    Get {
63        /// Configuration key (e.g., llm.provider, llm.model)
64        key: String,
65    },
66    /// Unset (reset to default) a configuration value
67    Unset {
68        /// Configuration key
69        key: String,
70    },
71}