Skip to content

WillyV3/mouser-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mouser-cli

CLI for Mouser Electronics. Search parts, manage cart, view orders.

Install

go install github.com/WillyV3/mouser-cli@latest

The binary installs as mouser-cli. Alias it if you want:

ln -s $(go env GOPATH)/bin/mouser-cli $(go env GOPATH)/bin/mouser

Optional: install gum for spinners, fuzzy filter, and interactive prompts. Everything works without it.

brew install gum        # macOS
sudo pacman -S gum      # arch

Setup

Get API keys from https://www.mouser.com/api-hub/

Run mouser config to save them interactively, or write them directly:

mkdir -p ~/.config/mouser
echo "your-search-key" > ~/.config/mouser/search_api_key
echo "your-cart-key"   > ~/.config/mouser/cart_api_key
echo "your-order-key"  > ~/.config/mouser/order_api_key

Each key file is a single line, 0600 permissions. Only the search key is required to get started.

Usage

mouser search "ESP32 devkit" --instock --limit 5
mouser search "resistor 10k" --rohs --manufacturer 603
mouser part 356-ESP32-S3
mouser part 426-DFR0669,485-1947
mouser mfr
mouser cart
mouser cart add 356-ESP32-S3 10
mouser cart remove 356-ESP32-S3
mouser orders --days 30
mouser order 12345678
mouser config

Flags

Command Flag Description
search --instock In-stock only
search --rohs RoHS-compliant only
search --limit N Max results (default 15)
search --manufacturer ID Filter by manufacturer ID (use mouser mfr to find IDs)
orders --days N Look back N days (default 90)

Output

Search and part results include product page URLs and datasheet links. Stock levels are color-coded green/yellow/red by quantity.

About

CLI for Mouser Electronics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages