airsprotocols_mcpserver_filesystem/cli/args.rs
1//! Command line argument definitions for AIRS MCP-FS
2//!
3//! This module contains all CLI argument structures and command definitions using clap.
4//! It provides a clean separation of argument parsing concerns from command handling logic.
5
6// Layer 1: Standard library imports
7use std::path::PathBuf;
8
9// Layer 2: Third-party crate imports
10use clap::{Parser, Subcommand};
11
12// Layer 3: Internal module imports
13// (None needed for pure argument definitions)
14
15#[derive(Parser)]
16#[command(name = "airsprotocols-mcpserver-filesystem")]
17#[command(about = "AIRS MCP-FS: Security-first filesystem bridge for Model Context Protocol")]
18#[command(version)]
19pub struct Cli {
20 #[command(subcommand)]
21 pub command: Option<Commands>,
22}
23
24#[derive(Subcommand)]
25pub enum Commands {
26 /// Setup AIRS MCP server directory structure
27 Setup {
28 /// Custom configuration directory (default: ~/.airsprotocols-mcpserver-filesystem/config)
29 #[arg(long, help = "Custom configuration directory")]
30 config_dir: Option<PathBuf>,
31
32 /// Custom logs directory (default: ~/.airsprotocols-mcpserver-filesystem/logs)
33 #[arg(long, help = "Custom logs directory")]
34 logs_dir: Option<PathBuf>,
35
36 /// Whether to overwrite existing directories
37 #[arg(long)]
38 force: bool,
39 },
40 /// Generate example configuration files
41 Config {
42 /// Output directory for configuration files
43 #[arg(short, long, default_value = ".")]
44 output: PathBuf,
45
46 /// Environment to generate config for
47 #[arg(short, long, default_value = "development")]
48 env: String,
49
50 /// Whether to overwrite existing files
51 #[arg(long)]
52 force: bool,
53 },
54 /// Run the MCP server (default when no command specified)
55 Serve {
56 /// Custom configuration directory (overrides AIRSPROTOCOLS_MCPSERVER_FS_CONFIG_DIR)
57 #[arg(long, help = "Custom configuration directory")]
58 config_dir: Option<PathBuf>,
59
60 /// Custom logs directory (overrides AIRSPROTOCOLS_MCPSERVER_FS_LOG_DIR)
61 #[arg(long, help = "Custom logs directory")]
62 logs_dir: Option<PathBuf>,
63 },
64}
65
66impl Default for Commands {
67 fn default() -> Self {
68 Commands::Serve {
69 config_dir: None,
70 logs_dir: None,
71 }
72 }
73}