
rust-cli
Design, implement, test, and release production Rust command-line applications, including command contracts, subcommands, configuration precedence, stdin/stdout/stderr, exit codes, file safety, daemon IPC, terminal handling, packaging, and process-level tests. Use when users ask for a Rust CLI, command parser, clap integration, Unix-style pipelines, daemon clients, PTY/TUI behavior, shell completion, or CLI release engineering.
- Installs
- 102
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/full-stack-skills/rust-skills --skill rust-cli- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads rust-cli automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Rust CLI Delivery
Treat the command-line interface as a stable user protocol rather than embedding business logic directly in main. Complete an end-to-end loop from contract confirmation, implementation to real process verification.
Confirm Constraints
Before making changes, confirm requirements, existing help text, scripts, READMEs, tests, and release configurations:
- Command name, subcommands, arguments, defaults, mutual exclusions, compatibility requirements;
- Human output format versus machine output (quiet mode, verbose, JSON, colorless);
- Input priority for stdin, files, and arguments; stdout/file write destinations;
- Exit codes corresponding to success, usage errors, data errors, transient failures;
- Supported platforms, shells, TTY/pipes environments, MSRV, dependency versions;
- Configuration file precedence over environment variables over command-line options.
If critical contracts are missing, infer the minimal compatible solution from existing behavior and tests while explicitly stating assumptions. Do not arbitrarily alter flags, output text, or exit codes.
Workflow
1. Establish Behavior Baseline
Check entry points and build boundaries:
rustc --version --verbose
cargo metadata --no-deps --format-version 1
cargo test --all-targets
cargo run -- --help
Record at least one successful invocation with its parameters, stdout, stderr, and exit code; record at least one failed invocation. Existing snapshots or shell callers serve as compatibility constraints.
2. Define Command Contracts
Write a behavior matrix first, then implement parsing logic. Distinguish:
- Required positional arguments, optional arguments, repeatable options, subcommands;
- User input errors versus runtime errors;
- Normal data output versus diagnostic output;
- Interactive vs non-interactive modes;
- Stable machine format versus evolvable human-readable formats.
When using parsers like clap, rely on official documentation for locked repository versions. Do not mix derive attributes or APIs from different major versions based on memory.
3. Separate Parsing, Execution, and Presentation
Keep the entry point thin:
Process parameters & environment
-> Parse into Options/Command
-> Call testable run(command, io, context)
-> Map domain results to output and ExitCode
Let domain logic return structured results or errors; only decide color codes, newlines, stderr messages, and exit codes at boundaries. Avoid calling process::exit directly in deep functions, reading global environment variables indiscriminately, or printing unconditionally.
4. Implement I/O with Configuration Priority
- Inject input/output adapters using
BufRead,Write, or explicit wrappers for testable pipe behavior; - Write normal results to stdout; diagnostic and progress messages go to stderr;
- Do not mix logs, colors, or progress bars when consuming pipes from stdout;
- Enable interactive prompts only after detecting a TTY, providing an option to override this behavior;
- Use
Path/PathBuf; do not manually concatenate platform-specific paths.
Explicitly define precedence: CLI > Environment Variables > Configuration Files > Defaults. Write tests for conflicts where applicable. When writing files, consider partial writes, atomic replacement strategies, existing file policies, and permission sensitivities. Read Command Contract & I/O if specific command matrices, standard streams, or configuration patterns are needed.
5. Design Operable Errors
- Provide short, contextual, actionable error messages for expected failures;
- Do not print debug stacks or sensitive values to terminal users by default;
- Retain the full error chain for detailed modes and logging purposes;
- Map error categories into stable exit codes;
- Handle broken pipes correctly: do not generate noise when downstream filters close prematurely.
Do not use unwrap()/expect() on user input, files, network operations, or configuration failures.
6. Verify with Real Processes
Ensure coverage of at least the following scenarios:
--helpand--version;- A successful execution path;
- Unknown parameters, missing arguments, conflicting options;
- Separation between stdout and stderr streams;
- Precise exit codes;
- stdin pipe or temporary file behavior;
- Configuration precedence without TTY support;
- Path risks involving spaces, non-UTF-8 content, or platform differences (when applicable).
Prioritize testing compiled binaries over parsing functions alone. Read CLI Testing & Release if test coverage and release artifacts are required. General test stratification is delegated to rust-testing.
7. Validate Distribution Forms
Enforce repository-level gates:
cargo fmt --all -- --check
cargo check --all-targets
cargo test --all-targets
cargo clippy --all-targets -- -D warnings
cargo build --release
If cross-platform or specific target support is declared, verify in the corresponding environment or CI matrix. Packaging, features, workspace configuration, cross-compilation, and release details are handled by rust-cargo-build.
8. Handle Daemon, IPC, Terminal Modes
When a CLI includes persistent daemons, local IPC, PTYs, TUIes, or similar: do not keep all code in the binary crate. Separate parsing logic, protocol DTOs, platform layers, clients, servers, and public SDKs accordingly. Write end-to-end tests for handshake versions, capability negotiation, frame sizes, race conditions during auto-startup, signals, attach upgrades, shutdown sequences, and tool/boundary selection per Daemon & IPC Terminal Toolkit.
Completion Criteria
Report completion only when all of the following are satisfied:
- Command contracts and compatibility assumptions are clearly defined;
- Business logic is separated from process boundaries;
- Real-process tests exist for stdout, stderr, exit codes, and configuration precedence;
fmt,check,test, and Clippy pass;- Supported platforms and distribution artifacts have evidence of support; unverified parts are explicitly marked.
Handoff Boundaries
| Primary Concern | Assigned To |
|---|---|
| Ownership, path semantics, I/O trait definitions or error types | rust-stable |
| Test stratification, coverage, fuzzing, benchmarks | rust-testing |
| Cargo features, workspace configuration, cross-compilation, packaging, release | rust-cargo-build |
| Tokio tasks, cancellation, signals, async lifetimes | rust-concurrency |
| HTTP services | rust-web |
On-Demand Resources
- Command Contract & I/O: Read when designing parameters, standard streams, configuration, and exit codes.
- CLI Testing & Release: Read before writing real-process tests or preparing for release.
- Daemon & IPC Terminal Toolkit: Read when building local daemons, control protocols, PTYs, TUIes, or cross-platform terminal applications.
- Example Scenarios: Read if end-to-end task templates are required.
examples/golden-cli/: Use offline compilation to verify stdout, stderr, and exit codes for golden examples.
References
FAQ
What does the rust-cli skill do?
Design, implement, test, and release production Rust command-line applications, including command contracts, subcommands, configuration precedence, stdin/stdout/stderr, exit codes, file safety, daemon IPC, terminal handling, packaging, and process-level tests. Use when users ask for a Rust CLI, command parser, clap integration, Unix-style pipelines, daemon clients, PTY/TUI behavior, shell completion, or CLI release engineering.
How do I install rust-cli?
Run npx skills add https://github.com/full-stack-skills/rust-skills --skill rust-cli in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/rust-cli/ (personal) or .claude/skills/rust-cli/ (project).
Which AI agents can use rust-cli?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is rust-cli safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains rust-cli?
It is published by full-stack-skills in full-stack-skills/rust-skills. It has 102 recorded installs.
More from full-stack-skills/rust-skills
rust-testing
full-stack-skills/rust-skills
Open the skill to read its SKILL.md instructions.
rust-style-clippy
full-stack-skills/rust-skills
Open the skill to read its SKILL.md instructions.
rust-concurrency
full-stack-skills/rust-skills
Open the skill to read its SKILL.md instructions.
rust-performance
full-stack-skills/rust-skills
Open the skill to read its SKILL.md instructions.
rust-code-review
full-stack-skills/rust-skills
Open the skill to read its SKILL.md instructions.
rust-cargo-build
full-stack-skills/rust-skills
Open the skill to read its SKILL.md instructions.
Popular backend & apis skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
entra-app-registration
microsoft/azure-skills
Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.
google-agents-cli-adk-code
google/agents-cli
This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).
embedded-captions
heygen-com/hyperframes
Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet anchor rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.
entra-agent-id
microsoft/azure-skills
Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant) including the Microsoft Entra SDK for AgentID sidecar. USE FOR: Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmipath token exchange, agent OBO, Workload Identity Federation for agents, polyglot agent auth, Microsoft.Identity.Web.AgentIdentities. DO NOT USE FOR: standard Entra app registration (use entra-app-registration), Microsoft Foundry agent authoring (use microsoft-foundry).
neon
neondatabase/agent-skills
Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the branch-first workflow. Use when building an app or backend on Neon, or when "Neon" or "Lakebase Postgres" is mentioned. Child skill neon-postgres wins for an existing DATABASEURL, SQL, schema, inspect, or search. Child skill neon-auth wins for login, users, sessions, identity routing, and Managed Better Auth setup. Child skill neon-realtime wins for live queries in reactive apps and agents. Also use for object storage, S3, buckets, serverless functions, function triggers, cron, AI gateway, LLM calls, realtime, logs, Loki, Grafana, observability, postgres, database, backend, Claimable Neon, neon.new, or a no-signup database.