claude_native/cli.rs
1use std::path::PathBuf;
2
3use clap::Parser;
4
5/// Scan a project and score how Claude Native it is.
6#[derive(Parser, Debug)]
7#[command(name = "claude-native", version, about)]
8pub struct Cli {
9 /// Path to the project directory to scan (defaults to current directory)
10 #[arg(default_value = ".")]
11 pub path: PathBuf,
12
13 /// Only show failures and suggestions (hide passing rules)
14 #[arg(short, long)]
15 pub failures_only: bool,
16
17 /// Output format
18 #[arg(short = 'o', long, default_value = "terminal")]
19 pub format: OutputFormat,
20
21 /// Bootstrap the project: generate CLAUDE.md, .claudeignore, .claude/settings.json
22 #[arg(long)]
23 pub init: bool,
24
25 /// Auto-fix: apply all quick-win suggestions (create missing files, append ignore patterns)
26 #[arg(long)]
27 pub fix: bool,
28
29 /// Show estimated score improvement without making changes
30 #[arg(long)]
31 pub diff: bool,
32
33 /// Watch for file changes and re-score automatically
34 #[arg(long)]
35 pub watch: bool,
36
37 /// Output a shields.io badge URL for your README
38 #[arg(long)]
39 pub badge: bool,
40
41 /// Run as MCP server (JSON-RPC over stdio)
42 #[arg(long)]
43 pub mcp: bool,
44
45 /// Install pre-commit hook (blocks commits below score threshold)
46 #[arg(long, value_name = "MIN_SCORE")]
47 pub hook: Option<u32>,
48
49 /// Like --init but also generates .cursorrules and copilot-instructions.md
50 #[arg(long)]
51 pub init_all: bool,
52
53 /// Record score to .claude-native-history.json and show trend
54 #[arg(long)]
55 pub history: bool,
56}
57
58#[derive(Debug, Clone, clap::ValueEnum)]
59pub enum OutputFormat {
60 Terminal,
61 Json,
62}