← Todos os modelos

Erros legíveis, funciona offline, página man gerada a partir do código.

Constitution — Rust CLI

Version 1.0.0 · Ratified 2026-11-10

These principles hold for every spec, plan and task of the tool. A spec may add rules; it never weakens these.

  1. Readable errors. Errors tell the user what failed, why and what to try next, with the chain of causes (anyhow or miette context). A raw panic message or a debug-formatted error reaching the user is a defect.

  2. Works offline. Every command that does not need the network works without it, and commands that do say so clearly and fail fast with a timeout. No command phones home without an opt-in.

  3. Man page generated from the code. The man page and shell completions are generated from the clap definitions with clap_mangen and clap_complete at build time. Help text exists in one place only.

  4. Typed arguments. Arguments are parsed with clap derive into typed structs with value enums and validators, so invalid input fails at parse time with exit code 2.

  5. No panics in normal use. main returns a Result; unwrap and expect are denied by Clippy outside tests. Output to a closed pipe exits quietly instead of panicking.

  6. Tested as a binary. Integration tests run the binary with assert_cmd and check stdout, stderr and exit codes, with snapshots for help and output. Releases are built for every target in CI with cargo-dist or equivalent.