ggen-cli - Command-line interface for ggen code generation
This crate provides the command-line interface for ggen, using clap-noun-verb for automatic command discovery and routing. It bridges between user commands and the domain logic layer (ggen-domain).
Architecture
- Command Discovery: Uses clap-noun-verb v3.4.0 auto-discovery to find
all
\[verb\]functions in thecmdsmodule - Async/Sync Bridge: Provides runtime utilities to bridge async domain functions with synchronous CLI execution
- Conventions: File-based routing conventions for template-based command generation
- Node Integration: Programmatic entry point for Node.js addon integration
Features
- Auto-discovery: Commands are automatically discovered via clap-noun-verb
- Version handling: Built-in
--versionflag support - Output capture: Programmatic execution with stdout/stderr capture
- Async support: Full async/await support for non-blocking operations
Examples
Basic CLI Execution
use cli_match;
# async
Programmatic Execution
use run_for_node;
# async