Drswith/usb.ids

An automated USB device ID database project that provides a CLI tool and data files. It fetches the latest USB.IDS data every 24 hours and publishes updated data files to npm.

★ 0Forks 0TypeScriptGitHub ↗Compare

Project website ↗

README

usb.ids

npm version npm downloads

Upstream version Auto Update GitHub Pages

USB registry data and tools in an agent-first pnpm monorepo.
Recommended entry point for agents working from this repository is the repo-local $usb-ids-app skill, which drives the primary usb-ids CLI surface. SDK and web are secondary consumers.

Use With An Agent (Recommended)

When the user wants an agent to operate usb.ids from this repository checkout, start with the app skill:

  • Skill path: .agents/skills/usb-ids-app/
  • Copyable prompt: Use $usb-ids-app to inspect the current usb.ids manifest in this repository, report the release and upstream versions, and tell me whether I should refresh the package-local data.
  • Scope: use usb-ids-app for product workflows; use .agents/skills/openspec-* when the task is to modify repository code, specs, or workflows.

The skill keeps the interaction CLI-first and package-aware, so the agent operates the supported usb-ids surface instead of starting from SDK internals.

Workspace Layout

  • packages/cli — published package usb.ids, binary usb-ids, and CLI-owned data files (usb.ids*).
  • packages/sdk — internal SDK source (Node/browser helpers and types), not published independently.
  • packages/web — Vite search UI package, deployed to GitHub Pages.
  • root — workspace orchestration, OpenSpec, governance docs/templates, CI/workflows.

CLI (Primary)

Install:

npm install -g usb.ids

Core commands:

usb-ids fetch
usb-ids fetch --force
usb-ids fetch --force --interactive
usb-ids fetch --force --interactive --yes
usb-ids fetch --offline
usb-ids version
usb-ids version --json
usb-ids check
usb-ids check --json
usb-ids ui --port 3000
usb-ids help

Stable exit codes:

  • 0 success
  • 2 usage error
  • 3 data missing
  • 4 network failure
  • 5 parse failure
  • 6 filesystem failure

version --json and check --json write machine-readable JSON to stdout only.

SDK (Secondary)

Programmatic access is exported from usb.ids:

import { getVendors, loadUsbData, searchInData } from "usb.ids";

const data = await loadUsbData();
const vendors = await getVendors();
const found = searchInData(data, "keyboard");

Browser-safe subpath:

import { filterVendors, searchInData } from "usb.ids/browser";

Web

Local run:

pnpm --filter @usb-ids/web run dev

Build:

pnpm --filter @usb-ids/web run build

Monorepo Development

Requirements: Node 18+, pnpm 9+.

pnpm install
pnpm run openspec:validate
pnpm run format
pnpm run lint
pnpm run typecheck
pnpm run test
pnpm run build

Package-scoped examples:

pnpm --filter @usb-ids/sdk run test
pnpm --filter usb.ids run test
pnpm --filter @usb-ids/web run typecheck

Data / Release Automation

  • Auto-update workflow compares upstream usb.ids hash vs npm latest.
  • When changed, workflow updates packages/cli/usb.ids*, builds workspace outputs, bumps usb.ids version, tags, and publishes.
  • Local manual publish is not the source of truth; release remains workflow-owned.

OpenSpec and Agent Assets

  • Active migration change: openspec/changes/agent-first-monorepo/
  • Agent instructions: AGENTS.md
  • Shared reusable skills: .agents/skills/

Docs

License

MIT — see LICENSE.

Contributors

Drswithactions-user

Issues