# Adom Parts Search

**One search box. Mouser, DigiKey and JLCPCB at once — with the fastest, cheapest pick chosen for you.**

Sourcing a part used to mean three browser tabs, three logins, three different ways of saying "in
stock," and a mental spreadsheet to figure out who actually gets it to your bench fastest. Adom
Parts Search collapses that into one query: type a part — or just ask Claude — and it fires three
parallel searches, normalizes the answers, and names the single best place to buy.

## Install

```bash
adompkg install adom-parts-search
```

## Quick start

```bash
# Browse — opens/refreshes the Parts Search Hydrogen tab + prints results
adom-parts-search show "STM32F103RBT6"

# Script — JSON only, no webview
adom-parts-search search "LM555" | jq '.recommendation'

# Keep the app tab alive without a query
adom-parts-search app
```

## Screenshots

### Three distributors, one comparable view
One keyword goes to Mouser, DigiKey and JLCPCB simultaneously; results land in three aligned
columns with product photos, and a recommendation banner names the winner.

![Three-column comparison for an STM32F103RBT6 — Mouser, DigiKey and JLCPCB side by side with product photos, recommendation banner naming Mouser the winner](/blob/app/adom-parts-search/screenshots/compare-grid.png)

### A recommendation that actually reasons
The winner isn't always Mouser. When Mouser is out of stock, long-lead, or NRND, the policy steps
aside and points you at whoever can ship today.

![Search for an iCE40 FPGA where Mouser is out of stock with a 280-day lead, so DigiKey wins and its column is highlighted](/blob/app/adom-parts-search/screenshots/policy-switch.png)

### Built for scripts and BOMs
`search` returns clean JSON for `jq`, BOM tooling, or another Claude step.

![Terminal showing adom-parts-search search piped to jq for the recommendation, then a show command opening the Parts Search tab](/blob/app/adom-parts-search/screenshots/cli.png)

## Dependencies

| Dependency | Required? | Why |
|---|---|---|
| `adom-mouser` (service-mouser) | Recommended | Mouser column + the Mouser-preferred recommendation |
| `adom-digikey` (service-digikey) | Recommended | DigiKey column + the fallback when Mouser can't ship |
| `adom-jlcpcb` (service-jlcpcb) | Optional | JLCPCB assembly-library column |

Client-only — it owns no API keys and runs no service of its own; it federates the three vendor
backends and renders. At least one backend must be reachable; missing ones show a friendly error
and the recommendation reasons around them.

## Features

- **One interface, three distributors** — parallel queries, side-by-side product photos.
- **Mouser-preferred routing** — 40-min drone delivery from Mansfield, TX to our Fort Worth
  facility + ~$0 shipping is why Mouser wins when it's in stock.
- **A recommendation that flips** — DigiKey wins on Mouser out-of-stock / long-lead / NRND.
- **Two faces** — a Hydrogen webview for browsing, a JSON CLI for scripting and BOMs.
- **Graceful degradation** — a rate-limited or down backend never fails the whole search.

## Talk to the AI

Sourcing / comparison:
- "source an STM32F103RBT6"
- "where can I get an ESP32-S3-WROOM cheapest and fastest"
- "compare Mouser, DigiKey and JLCPCB for an LM555"
- "check stock for a USB-C receptacle across distributors"

BOM:
- "price this BOM across distributors"
- "which of these parts is cheapest to assemble at JLCPCB"

## Skills

| Skill | Purpose |
|---|---|
| `adom-parts-search` | When/how Claude drives the app — `show` vs `search`, MPN extraction, part-family corrections |
| `adom-parts-search-build` | Release workflow (build, publish to the wiki) |

## CLI reference

| Command | What it does |
|---|---|
| `adom-parts-search show "<q>"` | Open/refresh the Parts Search tab + print full per-vendor results |
| `adom-parts-search search "<q>"` | JSON only (no webview) — pipe to `jq` |
| `adom-parts-search app` | Keep the app tab running without a query |
| `--limit N` / `--in-stock-only` | Cap hits per vendor / hide zero-stock |

## Open source — make it yours, then give it back

This app is **open source under the MIT license**. Fork it, rewrite it, bend it to your workflow —
and when you've made it better, send your changes back to the Adom Wiki so the whole community
benefits. Every wiki page is a git repo with a package registry on top, so `adompkg publish` your
own fork, or open a pull request against this page.

> **One caveat — the search backend is an Adom service.** The actual lookups run against Adom's
> hosted Mouser, DigiKey and JLCPCB backends, which use Adom's vendor API credentials and count
> against Adom's quota. That hosted backend is an Adom service and is **subject to change** — rate
> limits, endpoints, and availability can move at any time. Everything client-side is yours to fork
> and republish; the cloud API quota is not.

## License

MIT © Adom — do what you want with the code, just pass it on.
