airs_memspec/cli/
args.rs

1// CLI arguments and global options
2// Defines the main CLI structure using clap derive macros
3
4use std::path::PathBuf;
5
6use clap::{Parser, Subcommand};
7
8/// AI-focused memory bank management tool (read-only)
9#[derive(Parser, Debug)]
10#[command(name = "airs-memspec")]
11#[command(version, about, long_about = None)]
12#[command(propagate_version = true)]
13pub struct Cli {
14    /// Global options
15    #[command(flatten)]
16    pub global: GlobalArgs,
17
18    /// Available commands
19    #[command(subcommand)]
20    pub command: Commands,
21}
22
23/// Global options available to all commands
24#[derive(Parser, Debug)]
25pub struct GlobalArgs {
26    /// Path to the project directory
27    #[arg(short = 'p', long = "path", global = true)]
28    #[arg(help = "Path to project directory (default: current directory)")]
29    pub path: Option<PathBuf>,
30
31    /// Enable verbose output
32    #[arg(short = 'v', long = "verbose", global = true)]
33    #[arg(help = "Enable verbose output")]
34    pub verbose: bool,
35
36    /// Suppress non-essential output
37    #[arg(short = 'q', long = "quiet", global = true)]
38    #[arg(help = "Suppress non-essential output")]
39    #[arg(conflicts_with = "verbose")]
40    pub quiet: bool,
41
42    /// Disable colored output
43    #[arg(long = "no-color", global = true)]
44    #[arg(help = "Disable colored output")]
45    pub no_color: bool,
46}
47
48/// Available CLI commands
49#[derive(Subcommand, Debug)]
50pub enum Commands {
51    /// Set up memory bank structure and initial configuration
52    #[command(name = "install")]
53    #[command(about = "Set up memory bank structure in the current project")]
54    Install {
55        /// Target directory for installation
56        #[arg(help = "Directory to install memory bank (default: .copilot/instructions)")]
57        target: Option<PathBuf>,
58
59        /// Force installation even if files exist
60        #[arg(short = 'f', long = "force")]
61        #[arg(help = "Overwrite existing files")]
62        force: bool,
63
64        /// Template to use for installation
65        #[arg(short = 't', long = "template")]
66        #[arg(help = "Template name (default: basic)")]
67        #[arg(value_parser = ["basic", "workspace", "multi-project"])]
68        template: Option<String>,
69    },
70
71    /// Display memory bank status and project overview
72    #[command(name = "status")]
73    #[command(about = "Show current memory bank status and project overview")]
74    Status {
75        /// Show detailed information
76        #[arg(short = 'd', long = "detailed")]
77        #[arg(help = "Show detailed status information")]
78        detailed: bool,
79
80        /// Check specific project
81        #[arg(long = "project")]
82        #[arg(help = "Check status of specific project")]
83        project: Option<String>,
84    },
85
86    /// Display current project context and active development focus
87    #[command(name = "context")]
88    #[command(about = "Show active development context and architectural decisions")]
89    Context {
90        /// Display workspace-level context
91        #[arg(short = 'w', long = "workspace")]
92        #[arg(help = "Show workspace-level context and integration points")]
93        workspace: bool,
94
95        /// Display specific sub-project context
96        #[arg(long = "project")]
97        #[arg(help = "Show context for specific sub-project")]
98        project: Option<String>,
99    },
100
101    /// Handle task tracking and viewing operations (read-only)
102    #[command(name = "tasks")]
103    #[command(about = "View tasks and track progress (read-only access)")]
104    Tasks {
105        /// Action to perform
106        #[command(subcommand)]
107        action: TaskAction,
108    },
109}
110
111/// Task tracking actions (read-only)
112#[derive(Subcommand, Debug)]
113pub enum TaskAction {
114    /// List tasks with optional filtering
115    #[command(name = "list")]
116    #[command(about = "List tasks with smart filtering (15 most relevant) or custom filters")]
117    List {
118        /// Filter tasks by status
119        #[arg(short = 's', long = "status")]
120        #[arg(help = "Filter by task status")]
121        #[arg(value_parser = ["all", "active", "pending", "completed", "blocked"])]
122        status: Option<String>,
123
124        /// Filter tasks by sub-project
125        #[arg(long = "project")]
126        #[arg(help = "Filter by sub-project")]
127        project: Option<String>,
128
129        /// Show all tasks (disable smart filtering)
130        #[arg(long = "all")]
131        #[arg(help = "Show all tasks (disable smart default filtering)")]
132        show_all: bool,
133
134        /// Include completed tasks in smart view
135        #[arg(long = "completed")]
136        #[arg(help = "Include completed tasks in results")]
137        include_completed: bool,
138    },
139
140    /// Show detailed task information
141    #[command(name = "show")]
142    #[command(about = "Show detailed task information")]
143    Show {
144        /// Task ID to display
145        #[arg(help = "Task ID (e.g., task_001)")]
146        task_id: String,
147    },
148}