
Domain Cli
Domain guide for building Rust CLI tools, covering argument parsing, config layering, and terminal output conventions.
- skills.sh installs
- 3.5K
- GitHub stars
- 1.6K
- last updated
- Aug 21, 2026
What it does
- Covers CLI design constraints: stderr for errors, stdout for data, layered config, non-zero exit codes, and Ctrl+C handling
- Includes a clap derive example with subcommands plus a crate map for prompts, progress bars, colored output, TUI, and terminal control
- Enforces the precedence order CLI args, then environment variables, then config file, then defaults
- Designed for Rust developers building command-line tools who need guidance on argument parsing and terminal UX
Install
$ npx -y skills add actionbook/rust-skills --skill domain-cli -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
CLI Domain
Layer 3: Domain Constraints
Domain Constraints → Design Implications
| Domain Rule | Design Constraint | Rust Implication |
|---|---|---|
| User ergonomics | Clear help, errors | clap derive macros |
| Config precedence | CLI > env > file | Layered config loading |
| Exit codes | Non-zero on error | Proper Result handling |
| Stdout/stderr | Data vs errors | eprintln! for errors |
| Interruptible | Handle Ctrl+C | Signal handling |
Critical Constraints
User Communication
RULE: Errors to stderr, data to stdout
WHY: Pipeable output, scriptability
RUST: eprintln! for errors, println! for data
Configuration Priority
RULE: CLI args > env vars > config file > defaults
WHY: User expectation, override capability
RUST: Layered config with clap + figment/config
Exit Codes
RULE: Return non-zero on any error
WHY: Script integration, automation
RUST: main() -> Result<(), Error> or explicit exit()
Trace Down ↓
From constraints to design (Layer 2):
"Need argument parsing"
↓ m05-type-driven: Derive structs for args
↓ clap: #[derive(Parser)]
Details
- Repository
- github.com/actionbook/rust-skills
- Categories
- Rust, CLI & Terminal
- First seen
- May 16, 2026
More from actionbook/rust-skills
All 38- Rust Learner3.4K
- Rust Skill Creator3.4K
- Rust Deps Visualizer3.3K
- Meta Cognition Parallel3.3K
- Rust Daily3.3K
- Domain Embedded3.2K
- Domain Cloud Native3.2K
- Domain Fintech3.1K
- Domain Ml3.1K
- Domain Iot3K
- Rust Router3K
- Core Agent Browser2.3K
- Core Dynamic Skills2.1K
- Core Actionbook2.1K
- Core Fix Skill Docs2.1K
- M15 Anti Pattern9.4K
- Coding Guidelines4.3K
- M10 Performance4K
- M07 Concurrency3.8K
- M06 Error Handling3.8K
- M01 Ownership3.7K
- M05 Type Driven3.7K
- M04 Zero Cost3.7K
- M02 Resource3.7K
Similar to Domain Cli
More Rust
clapbobmatnyc/claude-mpm-skills346 installsProduction Rust CLI patterns with Clap covering subcommands, config layering, exit codes, and testing.
cli-developerjeffallan/claude-skills5.2K installsGuide for building command-line tools with commander, click, typer, or cobra, covering argument parsing and UX.
unix-clipproenca/dot-skills333 installsReference guidelines for building UNIX-style command-line tools with POSIX conventions, exit codes, and stream handling.
golang-clisamber/cc-skills-golang41.5K installsGo CLI development guide covering Cobra and Viper setup, flags, exit codes, I/O, and signal handling.
create-clisteipete/agent-scripts485 installsDesign-first CLI spec covering args, flags, help, output, errors, config, and dry-run, human- and script-friendly.