1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
use clap::{Parser, Subcommand};
use std::path::PathBuf;
#[derive(Parser)]
#[command(name = "sysmap")]
#[command(author, version, about = "Intelligent project mapping for AI agents and humans")]
#[command(propagate_version = true)]
pub struct Cli {
/// Disable colored output
#[arg(long, global = true)]
pub no_color: bool,
/// Quiet mode - minimal output
#[arg(short, long, global = true)]
pub quiet: bool,
/// Verbose mode - extra detail
#[arg(short, long, global = true)]
pub verbose: bool,
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
/// Initialize a new project map
#[command(visible_alias = "i")]
Init {
/// Directory to map (defaults to current directory)
#[arg(default_value = ".")]
path: PathBuf,
/// Overwrite existing .sysmap directory
#[arg(short, long)]
force: bool,
},
/// Display compressed project summary
#[command(visible_alias = "s")]
Summary {
/// Output as JSON
#[arg(long)]
json: bool,
/// Output as YAML
#[arg(long)]
yaml: bool,
/// Show character and token counts
#[arg(long)]
counts: bool,
},
/// Display directory tree with pattern awareness
#[command(visible_alias = "t")]
Tree {
/// Subdirectory to show (defaults to project root)
path: Option<PathBuf>,
/// Maximum depth (default: 3)
#[arg(short, long, default_value = "3")]
depth: usize,
/// Show collapsed directories expanded
#[arg(short, long)]
all: bool,
/// Show character and token counts per file
#[arg(long)]
counts: bool,
},
/// Update existing map incrementally
#[command(visible_alias = "u")]
Update {
/// Force full rebuild instead of incremental
#[arg(long)]
full: bool,
},
/// Search the map for files
#[command(visible_alias = "f")]
Find {
/// Search term (filename, pattern, or keyword)
query: String,
/// Filter by file extension (py, rs, js, etc.)
#[arg(short = 't', long = "type")]
file_type: Option<String>,
/// Filter by language (python, rust, javascript, etc.)
#[arg(short = 'l', long = "lang")]
language: Option<String>,
/// Filter by purpose (entry, module, test, config)
#[arg(short = 'p', long = "purpose")]
purpose: Option<String>,
/// Show character and token counts
#[arg(long)]
counts: bool,
/// Show dependencies for matched files
#[arg(long)]
deps: bool,
},
/// Show file dependencies
#[command(visible_alias = "d")]
Deps {
/// File to analyze
file: PathBuf,
/// Show what depends ON this file (reverse lookup)
#[arg(short, long)]
reverse: bool,
/// Output as JSON
#[arg(long)]
json: bool,
},
}