# Rust CLI Studio

> Design and scaffold production Rust CLIs with clap subcommands, layered config loading, structured errors, and release packaging via guided planning.

Rust CLI Studio is a paid AI agent skill on Agensi by Sheeyassh. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $4 (one-time purchase)
- Creator: [Sheeyassh](https://www.agensi.io/creators/s1reyash)
- Version: 1.0
- Last updated: 2026-11-26
- Security: scan passed (2026-11-26); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/rust-cli-studio
- Tags: code-quality-review, rust, cli, clap, developer-tools

## About this skill

Design and scaffold production Rust CLIs with clap subcommands, layered config loading, structured errors, and release packaging via guided planning. Guides you through an interview-driven planning workflow before writing code, turning vague CLI ideas into modular Rust binaries powered by `clap` derive macros. Covers nested subcommands, layered TOML/JSON/YAML config resolution, `anyhow`/`thiserror` error boundaries, colored terminal output, optional Tokio async runtimes, and Cargo release packaging.

### What it does
- **Existing CLI Architecture Audit & Extension Plan** Inspects `Cargo.toml`, `src/cli.rs`, and `src/lib.rs` in an existing Rust repo, surfaces missing config precedence, error-boundary leaks, or UX gaps, and plans clean subcommand additions.
- **Config, Output & Error-Handling Hardening** Upgrades ad-hoc CLI utilities with layered TOML/JSON/YAML config loading, `--json`/colored output flags (`NO_COLOR` compliant), and clean `thiserror` domain errors wrapped by `anyhow` at the binary edge.
- **Interview-Driven Greenfield CLI Scaffolding** Runs a four-round requirements interview (commands, subcommands, config/output, async/errors) and outputs a complete multi-module Rust CLI layout ready for `cargo test` and GitHub Releases.
- **Deterministic Deliverables** Produces an approved architecture plan followed by modular Rust CLI files (`Cargo.toml`, `src/main.rs`, `src/cli.rs`, `src/lib.rs`, and config/error modules) plus `assert_cmd` integration tests, release workflow configs, and verified `cargo clippy` and `cargo test` results.

### How it works
1. **Pre-Flight & Scope Audit** verifies workspace boundaries, inputs, and required tools (`filesystem-read`, `filesystem-write`, `git`, `shell-exec`) before modifying any files.
2. **Core Workflow Execution** runs **Existing CLI Architecture Audit & Extension Plan**, **Config, Output & Error-Handling Hardening** using modular, non-destructive steps.
3. **Quality Gate Enforcement** applies skill-specific checks including *Atomic Commit Hygiene & Safe History Verification*, *Architecture Modularity & Automated Regression Gate*.
4. **Verification & Reporting** validates every deliverable against the 7-point checklist and emits an evidence-backed summary.

### Frameworks & tools
Supports `git`, `github`, `json`, `rust`, `yaml`. Uses agent tools: `filesystem-read`, `filesystem-write`, `git`, `shell-exec`. Prerequisites: Rust & Cargo toolchain (optional), Git repository (optional). Compatible with Claude Code, Cursor, Windsurf, Antigravity, Codex CLI, and MCP-enabled agents.

### Why this beats prompting it yourself
Teams building Rust CLIs often start coding `main.rs` prematurely and end up rewriting flag parsing, config precedence, exit codes, and `lib.rs`/`main.rs` boundaries mid-project. This skill inspects existing `Cargo.toml`, `src/main.rs`, `src/cli.rs`, `.cargo/config.toml`, and `rust-toolchain.toml` files first, then interviews you across four targeted rounds before generating any code. It prevents common mistakes like leaking `anyhow::Error` from library crates, neglecting `--json` machine output, or breaking `cargo install` distribution. Instead of ad-hoc prompting, Rust CLI Studio enforces Atomic Commit Hygiene & Safe History Verification, Architecture Modularity & Automated Regression Gate, Rust Cli Studio Pre-Flight & Deterministic Output Gate alongside a deterministic 7-point verification checklist.

### Use cases
- New developer tools needing a `clap` v4 derive CLI with subcommands, shell completions, and `cargo install` packaging
- Existing single-file `src/main.rs` utilities adding nested subcommands and a clean `src/lib.rs` library boundary
- DevOps CLIs requiring layered config precedence (CLI flags > env vars > TOML/YAML config file) and `--json` stdout formatting
- Async network CLIs integrating `tokio`, structured `thiserror` exit codes, and human-friendly `anyhow` diagnostics

### Known limitations
Focuses on terminal CLI binaries and Cargo/GitHub Release packaging; does not build GUI desktop apps or mobile targets. Requires an interactive planning step (or upfront answers) when subcommand UX, config formats, or async requirements are unspecified. Code signing certificates and private Homebrew tap credentials must be supplied separately in your CI secrets.

## Requires

- Optional: Rust & Cargo toolchain
- Optional: Git repository

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Rust CLI Studio skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Why does this skill interview me before writing Rust code?

Changing subcommand trees, config precedence, or sync-versus-async runtimes mid-build forces invasive rewrites. Four short interview rounds lock those choices upfront so the crate compiles cleanly on the first pass.

### Can it extend an existing Rust CLI instead of starting from scratch?

Yes. Phase 1 detects existing `Cargo.toml`, `src/cli.rs`, and `src/lib.rs` files and tailors the interview and plan to fit your existing crate layout.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
