Rust CLI design constraints and patterns for argument parsing, configuration layering, and user feedback.
Works with
Type-safe argument parsing with clap derive macros; supports subcommands, help text, and environment variable integration
Configuration precedence rule: CLI args override environment variables, which override config files and defaults
Proper error handling with stderr/stdout separation, non-zero exit codes, and Result-based error propagation
Progress bars, colored output, and
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versiondomain-cliExecute the skills CLI command in your project's root directory to begin installation:
Fetches domain-cli from zhanghandong/rust-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate domain-cli. Access via /domain-cli in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
979
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
979
stars
Layer 3: Domain Constraints
| 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 |
RULE: Errors to stderr, data to stdout
WHY: Pipeable output, scriptability
RUST: eprintln! for errors, println! for data
RULE: CLI args > env vars > config file > defaults
WHY: User expectation, override capability
RUST: Layered config with clap + figment/config
RULE: Return non-zero on any error
WHY: Script integration, automation
RUST: main() -> Result<(), Error> or explicit exit()
From constraints to design (Layer 2):
"Need argument parsing"
↓ m05-type-driven: Derive structs for args
↓ clap: #[derive(Parser)]
"Need config layering"
↓ m09-domain: Config as domain object
↓ figment/config: Layer sources
"Need progress display"
↓ m12-lifecycle: Progress bar as RAII
↓ indicatif: ProgressBar
| Purpose | Crate |
|---|---|
| Argument parsing | clap |
| Interactive prompts | dialoguer |
| Progress bars | indicatif |
| Colored output | colored |
| Terminal UI | ratatui |
| Terminal control | crossterm |
| Console utilities | console |
| Pattern | Purpose | Implementation |
|---|---|---|
| Args struct | Type-safe args | #[derive(Parser)] |
| Subcommands | Command hierarchy | #[derive(Subcommand)] |
| Config layers | Override precedence | CLI > env > file |
| Progress | User feedback | ProgressBar::new(len) |
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(name = "myapp", about = "My CLI tool")]
struct Cli {
/// Enable verbose output
#[arg(short, long)]
verbose: bool,
#[command(subcommand)]
command: Commands,
}
#[derive(Subcommand)]
enum Commands {
/// Initialize a new project
Init { name: String },
/// Run the application
Run {
#[arg(short, long)]
port: Option<u16>,
},
}
fn main() -> anyhow::Result<()> {
let cli = Cli::parse();
match cli.command {
Commands::Init { name } => init_project(&name)?,
Commands::Run { port } => run_server(port.unwrap_or(8080))?,
}
Ok(())
}
| Mistake | Domain Violation | Fix |
|---|---|---|
| Errors to stdout | Breaks piping | eprintln! |
| No help text | Poor UX | #[arg(help = "...")] |
| Panic on error | Bad exit code | Result + proper handling |
| No progress for long ops | User uncertainty | indicatif |
| Constraint | Layer 2 Pattern | Layer 1 Implementation |
|---|---|---|
| Type-safe args | Derive macros | clap Parser |
| Error handling | Result propagation | anyhow + exit codes |
| User feedback | Progress RAII | indicatif ProgressBar |
| Config precedence | Builder pattern | Layered sources |
| When | See |
|---|---|
| Error handling | m06-error-handling |
| Type-driven args | m05-type-driven |
| Progress lifecycle | m12-lifecycle |
| Async CLI | m07-concurrency |
Prerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
microsoft/playwright-cli
googlecolab/google-colab-cli
makenotion/skills
davila7/claude-code-templates
intellectronica/agent-skills
am-will/codex-skills
domain-cli reduced setup friction for our internal harness; good balance of opinion and flexibility.
domain-cli is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
Registry listing for domain-cli matched our evaluation — installs cleanly and behaves as described in the markdown.
I recommend domain-cli for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
domain-cli has been reliable in day-to-day use. Documentation quality is above average for community skills.
domain-cli reduced setup friction for our internal harness; good balance of opinion and flexibility.
domain-cli has been reliable in day-to-day use. Documentation quality is above average for community skills.
Keeps context tight: domain-cli is the kind of skill you can hand to a new teammate without a long onboarding doc.
Solid pick for teams standardizing on skills: domain-cli is focused, and the summary matches what you get after install.
domain-cli reduced setup friction for our internal harness; good balance of opinion and flexibility.
showing 1-10 of 59