Files
archlens/crates/presentation/src/cli.rs
Gabriel Kaszewski fdd85011a4
Some checks failed
CI / Check / Test (push) Failing after 1m33s
Architecture Docs / Generate diagrams (push) Successful in 3m21s
feat: implement all P1/P2/P3/P4 improvements from issue backlog
P1 correctness:
- filter test files by default (--include-tests to opt in)
- per-module diagrams show cross-module dependency arrows
- qualified type names (Module::TypeName) fix false edges from duplicate names

P2 output richness:
- method parameter types and return types in class diagrams (Rust + Python)
- Python pyproject.toml project analyzer (--level project for monorepos)

P3 unique value:
- boundary rules in archlens.toml ([rules] allow/deny, --strict enforcement)

P4 nice to have:
- dependency weight labels on module arrows (--no-weights to disable)
- --watch mode with 500ms debounce
- D2 renderer adapter (--format d2)
- interactive self-contained HTML viewer (--format html)
- git-aware incremental analysis (--since <ref>)
2026-06-17 09:51:45 +02:00

74 lines
1.4 KiB
Rust

use std::path::PathBuf;
use clap::{Parser, Subcommand};
#[derive(Parser, Debug)]
#[command(
name = "archlens",
about = "Generate architecture diagrams from source code"
)]
pub struct Cli {
#[command(subcommand)]
pub command: Option<Command>,
#[arg(default_value = ".")]
pub path: PathBuf,
#[arg(long, default_value = "module")]
pub level: String,
#[arg(long, default_value = "mermaid")]
pub format: String,
#[arg(long)]
pub output: Option<String>,
#[arg(long)]
pub config: Option<String>,
#[arg(long)]
pub scope: Option<String>,
#[arg(long)]
pub exclude: Vec<String>,
#[arg(long)]
pub include_tests: bool,
#[arg(long)]
pub no_weights: bool,
#[arg(long)]
pub watch: bool,
#[arg(long, value_name = "REF")]
pub since: Option<String>,
#[arg(long)]
pub split_by_module: bool,
#[arg(long)]
pub strict: bool,
#[arg(
long,
help = "Check if output matches existing file, exit 1 if different"
)]
pub check: bool,
#[arg(short, long, action = clap::ArgAction::Count)]
pub verbose: u8,
}
#[derive(Subcommand, Debug)]
pub enum Command {
Init {
#[arg(default_value = ".")]
path: PathBuf,
},
Diff {
#[arg(help = "Path to existing diagram file to compare against")]
existing: PathBuf,
},
}