casting_cli/cli.rs
1/// CLI argument definitions
2use clap::{Parser, Subcommand, ValueEnum};
3use clap_complete::Shell;
4
5/// Tool type for explicit specification
6#[derive(Debug, Clone, Copy, ValueEnum)]
7pub enum TypeArg {
8 /// CLI tool (uses --help)
9 Cli,
10 /// API tool (requires --spec and --base-url)
11 Api,
12 /// Expert/Persona (no tool dependency)
13 Expert,
14 /// Kaiba persona (dynamic prompt from Kaiba API)
15 Kaiba,
16}
17
18#[derive(Parser)]
19#[command(name = "casting")]
20#[command(about = "Cast a Persona onto your CLI", long_about = None)]
21pub struct Cli {
22 #[command(subcommand)]
23 pub command: Commands,
24}
25
26#[derive(Subcommand)]
27pub enum Commands {
28 /// Create a new tool configuration
29 Make {
30 /// Name of the tool or expertise (e.g., "git", "UX Designer")
31 #[arg(value_name = "NAME")]
32 tool: String,
33
34 /// Persona keyword (e.g., "akarui", "teineina")
35 #[arg(long)]
36 persona: Option<String>,
37
38 /// Explicit type specification (auto-detected if not provided)
39 #[arg(long, value_name = "TYPE")]
40 r#type: Option<TypeArg>,
41
42 /// OpenAPI/Swagger spec URL (for API mode)
43 #[arg(long, requires = "base_url")]
44 spec: Option<String>,
45
46 /// Base URL for the API (for API mode)
47 #[arg(long, requires = "spec")]
48 base_url: Option<String>,
49
50 /// Kaiba profile name (for Kaiba mode)
51 #[arg(long)]
52 profile: Option<String>,
53 },
54
55 /// List all configured tools
56 List,
57
58 /// Start REPL mode with Claude Code
59 Repl {
60 /// Name of the tool to wrap (optional for now)
61 #[arg(value_name = "TOOL")]
62 tool: Option<String>,
63 },
64
65 /// Generate shell completion scripts
66 Completion {
67 /// Shell to generate completions for
68 #[arg(value_enum)]
69 shell: Shell,
70 },
71}