ggen_cli_lib/cmds/mod.rs
1//! Command Router Module - clap-noun-verb v5.3.0 Migration
2//!
3//! This module provides the entry point for clap-noun-verb v5.3.0 with explicit verb registration.
4//! All noun modules with `#[verb("verb_name", "noun")]` functions are automatically discovered and registered.
5//!
6//! ## Architecture: Three-Layer Pattern
7//! ```text
8//! Layer 3 (CLI): cmds (router) -> explicit verb registration
9//! Layer 2 (Integration): auto-discovery -> #[verb] functions -> domain async logic
10//! Layer 1 (Domain): pure business logic
11//! ```
12
13// Command modules - clap-noun-verb v5.3.0 explicit verb registration
14pub mod ai;
15pub mod ci;
16pub mod graph;
17// pub mod hook; // DISABLED: Deferred to v4.1.0 - Depends on marketplace-v2 feature
18// pub mod marketplace; // DISABLED: Deferred to v4.1.0 - RDF-backed marketplace redesign
19// pub mod packs; // DISABLED: Deferred to v4.1.0 - Depends on marketplace-v2 feature
20pub mod ontology;
21pub mod paper;
22pub mod project;
23pub mod template;
24pub mod utils; // ENABLED: FMEA (Failure Mode and Effects Analysis) utility commands
25pub mod workflow;
26
27use ggen_utils::error::Result;
28
29/// Setup and run the command router using clap-noun-verb v3.4.0 auto-discovery
30pub fn run_cli() -> Result<()> {
31 // Handle --version flag before delegating to clap-noun-verb
32 let args: Vec<String> = std::env::args().collect();
33 if args.iter().any(|arg| arg == "--version" || arg == "-V") {
34 log::info!("ggen {}", env!("CARGO_PKG_VERSION"));
35 return Ok(());
36 }
37
38 // Use clap-noun-verb's auto-discovery to find all [verb] functions
39 clap_noun_verb::run()
40 .map_err(|e| ggen_utils::error::Error::new(&format!("CLI execution failed: {}", e)))?;
41 Ok(())
42}