Back to Templates
Rust CLI
Rust CLI Starter with Clap 4, Tokio, anyhow & cargo-nextest
Rust CLI with clap, testing, and CI
terminal
npx setupkaro init my-cli --template rust-cliZero installNo telemetryMIT License
What's Included
- Clap 4 derive-based CLI with subcommands and arg validation
- Tokio runtime (optional async commands)
- anyhow + thiserror for ergonomic error handling
- clippy (pedantic, nursery, cargo) + rustfmt
- cargo-nextest (fast tests) + cargo-tarpaulin (coverage)
- cargo-audit + cargo-deny for supply chain security
- GitHub Actions: fmt, clippy, test (nextest), audit, build, docker
- Distroless Dockerfile (static binary) + docker-compose
- Generated README with cargo-binstall install instructions
Generated Folder Structure
src/main.rscli.rscommands/errors.rstests/integration_test.rs.github/workflows/ci.ymlDockerfiledocker-compose.ymlCargo.tomlrustfmt.tomlclippy.tomlREADME.md
Quick Start Commands
Generate Project
terminal
npx setupkaro init my-cli --template rust-cliNext Steps
cd my-app
cargo build
cargo run -- --help
Frequently Asked Questions
- Why Clap derive instead of builder pattern?
- Derive API is more ergonomic, less boilerplate, and Clap 4's derive is feature-complete.
- Does it include a TUI framework (ratatui, crossterm)?
- No — this is a standard CLI template. Add `ratatui` or `crossterm` after generation if needed.
- What about cross-compilation?
- The README documents using `cross` for cross-compilation. GitHub Actions builds for linux/amd64, linux/arm64.
- Can I use this for a library crate instead?
- This template is for binaries. For libraries, use `cargo new --lib` and add the lint/test config manually.
Generate Another Template
React + TypeScript
Vite + React + TS with Tailwind and React Router
terminal
npx setupkaro init my-app --template react-tsReplace my-app with your project name.
Ready to generate your Rust CLI project?
One command. Production-ready. Start building in seconds.
terminal
npx setupkaro init my-cli --template rust-cli