Skip to content

hatlabs/cm5-availability-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cm5-availability-cli

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.

Status

Phase 1 implementation in progress. See the implementation plan and the requirements brainstorm in the hatlabs/ops workspace.

Install

This tool is installed into the hatlabs/ops workspace's .venv:

cd path/to/ops
./run install-cm5-availability

Or directly with uv:

uv pip install git+https://github.com/hatlabs/cm5-availability-cli.git -p .venv

Configuration

Credentials 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).

Usage

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 Schema

The 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.

License

MIT

About

CLI for tracking Raspberry Pi CM5 module availability across Farnell, Digikey, and Mouser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages