digikey is a Go CLI for DigiKey Product Information v4 ProductSearch APIs. It
supports human-readable output, structured output for automation, JMESPath
filtering, and built-in operation/schema discovery.
go install github.com/oxplot/digikey-cli/cmd/digikey@latest
From a local checkout:
go install ./cmd/digikey
Authentication is environment-based. The CLI autoloads .env files, so you can either export variables in your shell or create a .env file in the directory where you run digikey.
DIGIKEY_CLIENT_ID=your-client-id DIGIKEY_CLIENT_SECRET=your-client-secret
Only DIGIKEY_* variables are supported. Optional environment variables include
DIGIKEY_LOCALE_SITE, DIGIKEY_LOCALE_LANGUAGE, DIGIKEY_LOCALE_CURRENCY,
DIGIKEY_ACCOUNT_ID, and DIGIKEY_TIMEOUT.
List available ProductSearch operations:
digikey operations
Search by keyword and keep only the fields you need:
digikey productsearch keyword "10k resistor" --limit 5 --json \ --query 'Products[].{part:DigiKeyProductNumber,mfg:Manufacturer.Name,qty:QuantityAvailable}'
Get pricing for a part:
digikey productsearch pricing CR2032 --limit 3 --in-stock --json
Inspect an operation response schema without calling DigiKey:
digikey productsearch keyword --schema --query '{operationId: operationId, response: schema}'Use help for command-specific flags:
digikey productsearch pricing --help