I’m learning Rust. After weeks of reading the book and watching tutorials, I needed something hands-on. So I built tinypw—a minimal CLI tool to generate random passwords. In this post, I’ll share my experience and the lessons learned. But first, let’s see it in action:

Why a password generator?#
I constantly need throwaway passwords. Testing signup flows, creating demo accounts, filling out forms. Since I always have a terminal open, a CLI tool makes more sense than switching to a browser or password manager.
The requirements were simple:
- Generate random passwords of configurable length
- Support different character sets (alphanumeric, symbols, etc.)
- Show password strength estimation
- Fast startup, no dependencies at runtime
Rust seemed like the perfect choice for this project.
What it does#
Run tinypw and get a password. Specify length with -l, character set with -c. Each generated password includes a strength indicator so you know if it’s suitable for your use case.
# Generate a 16-character password
tinypw -l 16
# Alphanumeric only
tinypw -l 12 -c alphanumeric
# Include symbols for maximum entropy
tinypw -l 24 -c all
The CLI is fast—Rust binaries start instantly compared to Python or Node scripts that need interpreter startup.
Learning Rust along the way#
Building tinypw taught me more than any tutorial could:
- The borrow checker: Rust’s compiler is a strict but well-meaning code reviewer. It caught several lifetime issues during compilation.
- Error handling with
Result: No exceptions, no nulls. Either you handle the error or the code won’t compile. - Cargo ecosystem: The tooling is excellent.
cargo build,cargo test,cargo fmt—everything just works. - clap for CLI parsing: The clap crate makes argument parsing declarative and type-safe.
The compiler messages deserve special mention. When something fails, Rust tells you exactly why and often suggests the fix. It’s like pair programming with someone who has read the entire language spec.
Try it#
tinypw is open-source: github.com/marconae/tinypw.
If you’re learning Rust, I recommend building something small and practical. The language clicks faster when you’re solving a real problem.