#CLI

10 posts

Rust in Practice #7 Release Optimization and Cross-Compilation: Small, Fast Binaries That Run Anywhere
4 min read

Rust in Practice #7 Release Optimization and Cross-Compilation: Small, Fast Binaries That Run Anywhere

The first half of shipping. Tightening [profile.release] (lto, codegen-units, strip) and what each option trades away, why panic = "abort" should not be flipped casually, how binary size shrinks, and cross-compilation with rustup target — especially the musl static-link build that removes the glibc dependency and runs on old servers, plus the cross tool that detours linker problems through Docker.

Rust in Practice #5 Parallelism with rayon: Map-Reduce Without Data Races
4 min read

Rust in Practice #5 Parallelism with rayon: Map-Reduce Without Data Races

Spreading the aggregation across cores. When parallelism pays off (CPU-bound work) and why the strategy switches from streaming to whole-file reads, per-thread partial aggregates with rayon's par_lines plus fold and reduce, why sharing one HashMap behind a Mutex gets slower (lock contention), and the moment the compiler catches a shared-mutable-state mistake.

Rust in Practice #4 Iterators at Work: Aggregation, Top-N, and the Release Build Difference
4 min read

Rust in Practice #4 Iterators at Work: Aggregation, Top-N, and the Release Build Difference

Stacking analysis on the parser: an aggregation structure that counts failures while streaming successes, status code distribution via HashMap entry, top-N by sorting, the completion of the stats and top commands, and measuring debug vs release with Instant — why the gap runs to dozens of times, and why release is not the default.

Rust in Practice #3 File IO and Parsing: Read with BufReader, Turn a Log Line into a Struct
5 min read

Rust in Practice #3 File IO and Parsing: Read with BufReader, Turn a Log Line into a Struct

Two fundamentals for handling large files: choosing between read_to_string (whole file in memory) and BufReader streaming, and how buffering relates to system calls. Then the parser that turns an access-log line into a LogEntry struct — quote handling, status code conversion, Part 2's ParseError in action — and the serde extension that accepts JSON Lines logs.

Rust in Practice #2 Error Design: anyhow and thiserror, Engineering How It Dies
4 min read

Rust in Practice #2 Error Design: anyhow and thiserror, Engineering How It Dies

In a CLI tool, error messages are part of the user interface. The division of labor between anyhow — the default for the application layer, with main returning anyhow::Result and context stacking up the story — and thiserror, which builds concrete error types callers can branch on. The criterion for choosing between them, plus exit codes: designing every error path in loglens.

Rust in Practice #1 Project Design and clap: Structuring a Subcommand CLI
4 min read

Rust in Practice #1 Project Design and clap: Structuring a Subcommand CLI

An eight-part practice course that turns the grammar from the basics course into a real tool. We build loglens, an access-log analysis CLI. Why CLI tools are Rust's signature stage (single binary, startup speed), declaring subcommands (stats, top, errors) as one enum with clap's derive style, the auto-generated --help, and the design map for all eight parts.

Python Automation #7: Building Your Own Command — Packaging a CLI with typer and rich
5 min read

Python Automation #7: Building Your Own Command — Packaging a CLI with typer and rich

Closing out the series by bundling the automation scripts into a single CLI with typer, polishing the output with rich, and installing it with uv tool install as a command you can call from anywhere.

AWS Basics #5: CloudShell and IAM Identity Center (SSO)
9 min read

AWS Basics #5: CloudShell and IAM Identity Center (SSO)

CloudShell — the in-browser terminal — and IAM Identity Center (SSO), the standard login for multi-account, all the way through to the aws cli sso login flow.

AWS Basics #4: AWS CLI and SDK Setup
9 min read

AWS Basics #4: AWS CLI and SDK Setup

Installing aws cli v2, aws configure, profiles and the credentials file, how SDKs like boto3 / aws-sdk-js fit in, and the order in which the credential chain flows.

Docker Basics #3: Images and Containers — build, run, ps, logs, exec
8 min read

Docker Basics #3: Images and Containers — build, run, ps, logs, exec

The day-to-day Docker CLI commands in one place. build options, the run flags you actually use (-d, --name, --rm, -e), and the lifecycle that runs through ps , logs , exec , stop , rm.