Quickstart
Requirements
Section titled “Requirements”- Node.js >= 20
- KiCad >= 8, with
kicad-clion yourPATH - An OpenAI or Anthropic API key, supplied through the environment
- A git repository (copperhead snapshots before it edits, and rolls back if verification fails)
Check that KiCad’s CLI is visible, since every command probes it before doing anything:
kicad-cli version-
Install the CLI.
Terminal window npm install -g copperhead -
Set a key.
Keys are read from the environment only, and are never written to a config file. Transcripts redact anything shaped like a key at write time.
Terminal window export ANTHROPIC_API_KEY=... # or OPENAI_API_KEYModel selection resolves in this order: the
--modelflag, thenCOPPERHEAD_MODEL, thenmodelin.copperhead/config.json, then whichever API key is present. See Configuration. -
Adopt an existing project.
Run
initfrom the root of a repo that already contains a KiCad project. It reads the schematic, scaffolds the design docs, writes.copperhead/config.json, and installs a pre-commit hook.Terminal window cd my-boardcopperhead initIt is idempotent: rerunning it leaves your edits alone. If you have hand-edited a generated doc,
initrefuses to overwrite it and exits non-zero, telling you which files it skipped. Pass--forceif you actually want them regenerated.
Make a change
Section titled “Make a change”copperhead do "add an external key jack on a spare GPIO"The agent reads the docs, proposes the change as a validated spec, edits the schematic and the docs together, then runs ERC and DRC until they pass. To see the proposal before anything is written:
copperhead do "..." --dry-runcopperhead do "..." --interactive # pause for approval once the proposal validatesVerify
Section titled “Verify”check is contractually free of LLM calls and network access, so it is safe in CI and in a pre-commit hook. It runs ERC, DRC, doc-drift detection, constraint checks, and spec validation.
copperhead check # alias: copperhead verifyIt exits 0 when everything agrees and 1 when it does not.
- Simple demo: the full create pipeline, one command
- The agent loop: what one run actually does
- Docs as memory: what lives in
docs/and why - CLI reference: every command and flag