Skip to main content

project_map_cli_rust/cli/
commands.rs

1use clap::{Parser, Subcommand};
2
3#[derive(Parser)]
4#[command(name = "project-map")]
5#[command(about = "Agent-Native architectural awareness CLI", long_about = None)]
6pub struct Cli {
7    #[command(subcommand)]
8    pub command: Commands,
9}
10
11#[derive(Subcommand)]
12pub enum Commands {
13    /// Build or refresh the project map index
14    Build {
15        #[arg(short, long, default_value = ".")]
16        root: String,
17        #[arg(short, long, default_value = ".project-map.json")]
18        out: String,
19    },
20    /// Alias for build
21    Refresh {
22        #[arg(short, long, default_value = ".")]
23        root: String,
24        #[arg(short, long, default_value = ".project-map.json")]
25        out: String,
26    },
27    /// Find a symbol across the codebase
28    Find {
29        #[arg(short, long)]
30        query: String,
31    },
32    /// Get a dense architectural overview of a specific file
33    Context {
34        #[arg(short, long)]
35        path: String,
36    },
37    /// Analyze the architectural impact of a symbol
38    Impact {
39        #[arg(short, long)]
40        fqn: String,
41    },
42    /// Returns current workspace context and available commands
43    Status,
44    /// Extract raw code for a specific symbol using AST parsing
45    Fetch {
46        #[arg(short, long)]
47        path: String,
48        #[arg(short, long)]
49        symbol: String,
50    },
51    /// Check the blast radius (dependencies) of a symbol
52    Blast {
53        #[arg(short, long)]
54        path: String,
55        #[arg(short, long)]
56        symbol: String,
57    },
58    /// Semantic keyword search over the codebase index
59    Search {
60        query: String,
61    },
62    /// Start the MCP server
63    Mcp,
64}