Setup Rust CLI
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Scaffold a complete, buildable, agent-friendly Rust command-line tool at the repository root: a Cargo workspace whose
library holds all behavior behind a thin main.rs, sample commands that are each tested, an optional Ratatui
terminal UI, quality configuration, and an xtask that generates man pages, shell completions and the Antora CLI
reference.
Purpose
iru-setup-rust-cli writes the catalog’s Rust CLI scaffold contract, which the Rust coding and gate skills and
Setup CLI GitHub Workflows later detect and call. The root Cargo.toml holds the tool package
(version 0.1.0-dev on gitflow, edition 2024, a computed rust-version, an explicit , workspace lints with
missing_docs, unsafe_code = "forbid" and Clippy pedantic, and a release profile with fat LTO), next to
rust-toolchain.toml, rustfmt.toml, deny.toml and .cargo/config.toml (the cargo xtask alias).
The library implements the shared CLI contract: a clap 4 derive tree with global flags (--format text|json|jsonl,
--json, --no-color, --no-input, -q, -v, --log-format, --config) and <BIN>_* environment variables,
an exit-code enum (0 to 7, 130, 143), a thiserror error with a JSON error envelope on stderr, per-stream colour
rules, prompts only on a terminal, flags then environment then TOML config then defaults, and signal handling. The
sample commands are greet, completion, schema, version and --version; with ui: tui a Ratatui browse
picker is added. Tests are in-process tests of run, assert_cmd and snapbox golden-file end-to-end tests, aiming at
about 98% line coverage measured with cargo-llvm-cov (80% bar).
The skill announces whether it is scaffolding from scratch or updating an existing tool. For every file group it
owns that already exists it warns and asks Update / Keep as is / Replace / Stop (or applies on-existing), never
overwrites hand-written source, and treats a foreign Cargo layout as foreign. Crate versions are looked up live on
crates.io with a verified fallback table. It writes no CI workflow, .gitignore, README, changelog, LICENSE or
Sonar file; those belong to the sibling skills chained by Setup CLI Repository.
Plugin
Shipped by the iru-cli plugin of the ai-catalog marketplace (install with /plugin install iru-cli@ai-catalog; see Plugins).
Inputs
All inputs are optional key: value lines in args, normally passed by
Setup CLI Repository; any key not supplied is asked interactively.
| Argument | Required | Description | Default |
|---|---|---|---|
|
Yes (unless supplied via |
Executable name ( |
Repository directory basename, lowercased |
|
No |
Cargo package (and crates.io) name; checked for availability on crates.io when |
|
|
Yes (unless supplied via |
One sentence ending in a period; becomes the package description, the crate doc’s first line and the |
None |
|
No |
|
|
|
No |
|
|
|
No |
Minimum supported Rust version for |
Computed (1.85 for |
|
No |
|
|
|
No |
SPDX expression, or no license (proprietary, |
Asked; |
|
Yes (unless supplied via |
Populate the package |
None |
|
No |
Repository identity; the URL defaults to |
Inferred from |
|
No |
Shared pipeline vocabulary; |
Asked when stand-alone |
|
No |
|
|
|
No |
|
|
|
No |
|
Derived from a root |
|
No |
|
|
Outputs
-
Cargo.toml(workspace with the tool package and thextaskmember) and a generated, committedCargo.lock. -
rust-toolchain.toml,rustfmt.toml,deny.tomland.cargo/config.toml. -
src/main.rs,src/lib.rs,src/cli.rs,src/exit.rs,src/error.rs,src/output.rs,src/term.rs,src/config.rs,src/signals.rs,src/tests.rsandsrc/commands/{mod,greet,completion,schema,version}.rs. -
With
ui: tui:src/commands/browse.rsandsrc/tui/{mod,app,ui,ui_screenshots}.rs, whose list renders only the rows that fit. -
With
ui: tui, per the catalog’s UI contract:.ui-quality.ymlat the repository root, and UI tests that capture every picker state in each direction as.ui-screenshots/screen/App/<state>--<direction>--no-color.txt(a gitignored output; see Setup Rust Gitignore) with the asserted accessibility checks. These additions were written without a Rust toolchain and are flagged unverified in the skill until the firstui: tuirun. -
tests/cli.rs,tests/golden/greet-ada.jsonand a generatedtests/golden/schema.json. -
xtask/Cargo.tomlandxtask/src/main.rs, plus generated man pages and completions undertarget/dist/and the CLI reference pagedocs/modules/ROOT/pages/cli-reference.adoc(ortarget/dist/cli-reference.adocwhen the Antora module does not exist yet). -
A report of the mode (from scratch, updated or stopped), the resolved identity,
ui, version, MSRV, license, the per-group action (including.ui-quality.ymlforui: tui) (created, updated, replaced, kept as is), crate versions used (live versus fallback), each verification result, anything unverified, ignoredargskeys, suggested Antora pages, and explicit warnings (review generated files, commitCargo.lockand golden files, register new commands, run the gitignore skill, addLICENSE, Sonar and crates.io prerequisites).
Execution flow
Dependencies
Invokes
None as catalog skills. iru-setup-rust-cli is a leaf skill; it reads its own reference/ templates and runs cargo,
rustup, curl and git directly.
Invoked by
-
Setup CLI Repository — the command-line tool bootstrap orchestrator runs it as the Rust scaffold step, passing the resolved shared inputs through
args. Theiru-setup-repositoryfront door reaches it through that orchestrator.
Related agents
-
iru-gate-runner— Step 7 may run the long-output verification commands (build, Clippy, tests, coverage) through this agent so only pass/fail and key figures come back.
Source
SKILL.md on GitHub — the file this page was generated from.