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
use std::path::PathBuf;
use clap::{Parser, Subcommand};
#[derive(Parser, Debug, Clone)]
#[clap(author, about, version)]
pub struct Args {
/// Optional path to overwrite the config
#[arg(short, long, default_value = "kwaak.toml")]
pub config_path: PathBuf,
/// Skip initial indexing and splash screen
#[arg(short, long, default_value_t = false)]
pub skip_indexing: bool,
/// Subcommands corresponding to each mode
#[clap(subcommand)]
pub command: Option<Commands>,
}
#[derive(Subcommand, Debug, Clone, Default)]
pub enum Commands {
/// Initializes a new kwaak project in the current directory
Init,
/// Start the TUI (default)
#[default]
Tui,
/// Query the indexed project
Query {
#[arg(short, long)]
query: String,
},
/// Run an agent directly
RunAgent {
#[arg(short, long)]
initial_message: String,
},
/// Index the current project
Index,
/// Tests a tool
TestTool {
tool_name: String,
tool_args: Option<String>,
},
/// Print the configuration and exit
PrintConfig,
/// Clear the index and cache for this project and exit
ClearCache,
}