Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
clap-noun-verb
Machine-grade CLI framework for AI agents and autonomous systems
Current Version: v5.3.2 | Changelog | Phase 2 Features
Architecture First: CLI is interface, not application. Separate domain logic from CLI.
Documentation by Use Case
🎓 Learning from Scratch?
Start: Your First CLI in 5 Minutes → Tutorial Series — 10 progressive lessons (5 mins - 3 hours)
🔧 Solving a Problem?
Start: How-To Production Guides → Deployment, monitoring, configuration, security
📖 Looking Up an API?
Start: Reference: #[verb] Macro → All Reference Docs — Types, errors, CLI runner
🤔 Understanding Design?
Start: Architecture Philosophy → Why domain separation, type-first thinking, agent-grade CLIs
Architecture Principle
The Golden Rule: CLI validates, domain computes, integration connects.
┌─────────────┐
│ CLI Layer │ ← clap-noun-verb (this crate)
│ (thin, UI) │
└──────┬──────┘
│
┌──────▼──────────┐
│ Integration │ ← Glue code (minimal)
└──────┬──────────┘
│
┌──────▼──────────┐
│ Domain Logic │ ← Your business logic (pure, testable)
│ (pure, tested) │
└─────────────────┘
Why this matters:
- CLI layer is thin validation and routing
- Domain logic is pure Rust functions (testable, reusable)
- Integration glues CLI to domain
- Tests focus on domain, not CLI parsing
Installation
[]
= "5.3"
For development: also add clap-noun-verb-macros = "5.3"
2-Minute Example
use ;
use Result;
use Serialize;
// Business logic (pure, testable)
// CLI wrapper (thin, delegating)
Usage:
}
Key: Delegate to pure domain logic immediately. CLI only validates.
v5.2.0 Features (Phase 2)
Typer-like Doc Comment Syntax for argument relationships:
/// # Arguments
/// * `format` - Output format [env: OUTPUT_FORMAT] [default: json]
/// * `json` - Export as JSON [group: format]
/// * `yaml` - Export as YAML [group: format]
/// * `output` - Output file [requires: format] [value_hint: FilePath]
New tags in v5.2.0:
[group: name]- Exclusive argument group[requires: arg]- Argument dependency[conflicts: arg]- Mutually exclusive arguments[env: VAR]- Read from environment[default: value]- Default value[value_hint: type]- Shell completion hint[hide]- Hide from help[help_heading: name]- Organize help output[global]- Propagate to subcommands[exclusive]- Can't combine with other args
See Phase 2 Analysis for complete details.
Key Highlights
✅ Type-Safe By Construction - Compile-time validation of commands ✅ Zero-Cost Abstractions - Generics & macros, no runtime overhead ✅ Domain-Separated - Thin CLI layer + pure domain logic ✅ Agent-Ready - JSON output, introspection, MCP compatible ✅ Production Tested - 100% pass rate, comprehensive examples
Contributing
Issues and PRs welcome: github.com/seanchatmangpt/clap-noun-verb
License
Licensed under either of Apache License 2.0 or MIT license at your option.