Rust CLI taste

By Fatih Kadir Akın (profile) · From prompts.chat · License: CC0 1.0 · Added October 28, 2026

# Rust CLI taste
- Parse arguments with clap using the derive API and doc comments as help text. Confidence: 0.95
- Return anyhow::Result from main and add context to every fallible step with .context(). Confidence: 0.90
- Define library error types with thiserror and keep anyhow in the binary only. Confidence: 0.85
- Split the crate into a thin main.rs and a lib.rs that holds the real logic for testing. Confidence: 0.85
- Write normal output to stdout and logs, progress and errors to stderr. Confidence: 0.95
- Offer a --json flag for machine-readable output and serialize it with serde. Confidence: 0.85
- Use tracing with an env filter controlled by -v flags and a RUST_LOG override. Confidence: 0.80
- Respect NO_COLOR and disable colors automatically when stdout is not a terminal. Confidence: 0.90
- Show progress bars with indicatif only for operations longer than about a second. Confidence: 0.75
- Exit with distinct, documented exit codes instead of always returning 1. Confidence: 0.80
- Read configuration in the order flags, then environment variables, then a TOML config file. Confidence: 0.80
- Find config and cache paths with the directories crate rather than hardcoding home paths. Confidence: 0.80
- Test the binary end to end with assert_cmd and snapshot output with insta. Confidence: 0.85
- Avoid async and tokio unless the tool really does concurrent network work. Confidence: 0.75
- Generate shell completions and a man page with clap_complete and clap_mangen at build time. Confidence: 0.75
- Ship prebuilt binaries for Linux, macOS and Windows with cargo-dist from GitHub Actions. Confidence: 0.80
- Run cargo clippy with warnings denied and cargo fmt --check in CI. Confidence: 0.90
- Set opt-level, lto and strip in the release profile to keep binaries small. Confidence: 0.70
- Handle Ctrl+C cleanly with the ctrlc crate and leave no half-written files behind. Confidence: 0.80

Fill in anything in [brackets] or {braces} with your own details first.

This is my prompt

Wrote this prompt? Tell me, and I will put your name on it. I check every claim by hand.

Report or remove
What is wrong?

More Everything else prompts

Everything else

Translation Dictionary

--- name: translation-dictionary description: You're a professional translator.

You need: any AI chat (ChatGPT, Claude or Grok Bot)

By prompts.chat community

Everything else

Flight Disruption Recovery Plan (JSON)

{ "role": "Calm travel disruption assistant", "task": "When a traveler's flight is cancelled, heavily delayed, or a connection is missed, turn their situation into a clear, prioritized recovery plan in strict JSON.",...

You need: any AI chat (ChatGPT, Claude or Grok Bot)

By Fatih Kadir Akın

Everything else

Vintage Chromolithograph Plate of Forest Mushrooms and Mosses

Forest mushrooms and mosses arranged as a vintage natural history chromolithograph plate: a red fly agaric with white spots, a cluster of golden chanterelles, a brown porcini with a thick pale stem, delicate purple...

You need: any AI chat (ChatGPT, Claude or Grok Bot)

By Fatih Kadir Akın

All Everything else promptsAll prompts

Want a prompt for your own work? Ask for one. Every prompt here is free.

Want this built for you? Get it built.