1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(
name = "dot",
about = "minimal ai agent",
version,
disable_version_flag = true
)]
pub struct Cli {
#[command(subcommand)]
pub command: Option<Commands>,
#[arg(
short = 's',
long = "session",
help = "resume a previous session by id"
)]
pub session: Option<String>,
/// Output format for headless mode
#[arg(short = 'o', long = "output", default_value = "text", value_parser = ["text", "json", "stream-json"])]
pub output: String,
/// Print only the final text response (no tool output)
#[arg(long = "no-tools", default_value_t = false)]
pub no_tools: bool,
/// Multi-turn interactive headless mode (read prompts from stdin line by line)
#[arg(short = 'i', long = "interactive")]
pub interactive: bool,
/// Print version
#[arg(short = 'v', long = "version")]
pub print_version: bool,
/// Simulate first run (show welcome screen)
#[arg(long = "first-run", hide = true)]
pub first_run: bool,
}
#[derive(Subcommand)]
pub enum Commands {
Login,
Config,
/// List configured MCP servers and their tools
Mcp,
/// List installed extensions
Extensions,
/// Install an extension from a git URL
Install {
/// Git URL or local path to the extension
source: String,
},
/// Uninstall an extension by name
Uninstall {
/// Name of the extension to remove
name: String,
},
/// Connect to an ACP agent
Acp {
/// Agent name (configured in config.toml)
name: String,
},
/// Run in headless mode (no TUI). Use "bg" as first arg for background mode.
Run {
/// The prompt to send (prefix with "bg" for background mode, omit to read from stdin)
prompt: Vec<String>,
/// Output format: text, json, stream-json
#[arg(short = 'o', long = "output", default_value = "text")]
output: String,
/// Print only the final text response (no tool output)
#[arg(long = "no-tools", default_value_t = false)]
no_tools: bool,
/// Resume a previous session
#[arg(short = 's', long = "session")]
session: Option<String>,
/// Multi-turn interactive mode (read prompts from stdin line by line)
#[arg(short = 'i', long = "interactive")]
interactive: bool,
},
/// List background tasks
Tasks,
/// View a background task's status and output
Task {
/// Task ID to view
id: String,
},
/// Show version information
Version,
}