asish.comTechnical articles by Asish Punnose

Using Rust for infrastructure tools that last

Design the command first

For an inventory tool, separate the human-readable report from structured output consumed by automation. Write a sample invocation and its expected JSON before choosing crates. Treat field names and exit codes as part of the interface.

Isolate the core

Parse arguments at the boundary. Pass typed configuration into a function that transforms inventory records. Keep network calls and terminal formatting separate so the transformation can run against a small local fixture.

Plan for partial failure

If one subscription is unreachable, identify it in the result and return a documented status. Test empty input, expired credentials and interrupted output. A scheduled job should be able to distinguish an empty inventory from an incomplete scan.

Back to homepage