Cli

From vinnie357/claude-skills · View interactive version

Cli is an AI agent skill from the GitHub repository vinnie357/claude-skills. Guide for building Rust command-line applications. Use when parsing CLI arguments with clap, adding progress bars or verbosity flags, testing a CLI binary as a subprocess, choosing process exit codes, or reporting errors to end users with anyhow context.

How to use this skill

Skill file

Rust CLI Applications

Argument parsing, user-facing output, exit codes, signal handling, and subprocess testing for command-line tools.

For argument parsing, error context, output, signals, exit codes, and testing patterns, see references/cli.md.

Example

use clap::Parser;

#[derive(Parser)]
struct Cli {
    pattern: String,
    path: std::path::PathBuf,
}

fn main() {
    let cli = Cli::parse(); // derives parsing, validation, and --help
}

The full argument-parsing, error-context, output, signals, exit-code, and testing patterns are in references/cli.md.

This skill covers CLI-specific ecosystem crates. For custom error enum design (thiserror) shared with non-CLI code, see rust:error-handling. For unit and integration test structure not specific to CLI binaries, see rust:testing.

See /core:anti-fabrication — crate versions and behavior claims in this skill are verified against crates.io and the upstream Rust CLI Book, not assumed.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.