Track Raspberry Pi CM5 module availability across Farnell, Digikey, and Mouser, joined with ERPNext on-hand stock and open Purchase Orders. Emits JSON to stdout, designed to be invoked by Claude Code.
Phase 1 implementation in progress. See
the implementation plan
and the requirements brainstorm
in the hatlabs/ops workspace.
This tool is installed into the hatlabs/ops workspace's .venv:
cd path/to/ops
./run install-cm5-availabilityOr directly with uv:
uv pip install git+https://github.com/hatlabs/cm5-availability-cli.git -p .venvCredentials live in ops/.env:
FARNELL_API_KEY=... # Element14 Product Search API key
DIGIKEY_API_CLIENT_ID=... # Digikey OAuth2 client ID
DIGIKEY_API_CLIENT_SECRET=... # Digikey OAuth2 client secret
MOUSER_API_APP_NAME=... # Mouser API application name
MOUSER_API_KEY=... # Mouser Search API key
ERPNext credentials are inherited from the parent ops workspace (the tool
subprocesses .venv/bin/erpnext-cli).
JSON to stdout by default — agent-first design:
cm5-availability-cli # all CM5 variants, all distributors
cm5-availability-cli --items SOM-CM5108064 # one variant
cm5-availability-cli --distributors mouser # one distributor
cm5-availability-cli --describe # print the output JSON SchemaThe output schema is documented under src/cm5_availability_cli/schemas/output.schema.json.
Output convention note: this CLI defaults to JSON, unlike sibling hatlabs CLIs
which default to a human-readable table. The primary consumer is Claude Code, so
machine-readable output is the default. Pipe through jq for a human view.
MIT