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.1")]
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 /// Switch provider and model
27 Switch,
28 /// Ask questions (Ask mode)
29 Ask {
30 /// Question to ask
31 question: String,
32 },
33 /// Suggest and execute commands (Suggest mode)
34 Suggest {
35 /// Request description
36 request: String,
37 },
38}
39
40#[derive(Subcommand, Debug)]
41pub enum ConfigAction {
42 /// Show all configuration
43 Show,
44 /// Reset all configuration to default
45 Reset,
46 /// Set a configuration value
47 Set {
48 /// Configuration key (e.g., llm.timeout, context.max_lines)
49 key: String,
50 /// Configuration value
51 value: String,
52 },
53 /// Get a configuration value
54 Get {
55 /// Configuration key (e.g., llm.provider, llm.model)
56 key: String,
57 },
58 /// Unset (reset to default) a configuration value
59 Unset {
60 /// Configuration key
61 key: String,
62 },
63}