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}
15
16#[derive(Parser)]
17#[command(name = "casting")]
18#[command(about = "Cast a Persona onto your CLI", long_about = None)]
19pub struct Cli {
20 #[command(subcommand)]
21 pub command: Commands,
22}
23
24#[derive(Subcommand)]
25pub enum Commands {
26 /// Create a new tool configuration
27 Make {
28 /// Name of the tool or expertise (e.g., "git", "UX Designer")
29 #[arg(value_name = "NAME")]
30 tool: String,
31
32 /// Persona keyword (e.g., "akarui", "teineina")
33 #[arg(long)]
34 persona: Option<String>,
35
36 /// Explicit type specification (auto-detected if not provided)
37 #[arg(long, value_name = "TYPE")]
38 r#type: Option<TypeArg>,
39
40 /// OpenAPI/Swagger spec URL (for API mode)
41 #[arg(long, requires = "base_url")]
42 spec: Option<String>,
43
44 /// Base URL for the API (for API mode)
45 #[arg(long, requires = "spec")]
46 base_url: Option<String>,
47 },
48
49 /// List all configured tools
50 List,
51
52 /// Start REPL mode with Claude Code
53 Repl {
54 /// Name of the tool to wrap (optional for now)
55 #[arg(value_name = "TOOL")]
56 tool: Option<String>,
57 },
58
59 /// Generate shell completion scripts
60 Completion {
61 /// Shell to generate completions for
62 #[arg(value_enum)]
63 shell: Shell,
64 },
65}