prompt2gerber
prompt2gerber is a Python CLI tool and project scaffolder (distributed via uv tool) that turns natural-language hardware prompts into fabrication-ready PCB Gerber and Excellon drill files for multi-layer boards (including microcontrollers, full schematics, and autorouting).
Installation & Usage (Planned)
# Install globally as an isolated CLI tool
uv tool install prompt2gerber
# Or in editable mode during development
uv tool install --editable .
# Verify local environment (kicad-cli, KiCad libraries, Freerouting/JRE)
prompt2gerber doctor
# Scaffold a new standalone PCB project tailored for an AI agent
prompt2gerber --init NewPCB --agent antigravity
Platform Support & Prerequisites
- Target Platforms: Windows, macOS, and Linux — currently only Windows is operational and verified; macOS and Linux support (KiCad discovery, portable JRE/router paths, and CI validation) is planned.
- KiCad (
kicad-cli+ standard libraries): Not bundled inside the Python wheel; install locally (on Windows:winget install KiCad.KiCad). - Freerouting & JRE: Managed automatically by
prompt2gerber(cached portable runtime). - Run
prompt2gerber doctorto validate that all external tools are detected.
Architecture Overview
prompt2gerber separates the reusable CLI toolchain from the generated PCB workspaces:
- Project Scaffolder (
--init <Project> --agent <Agent>): Creates a clean, standalone KiCad-compatible PCB workspace (libs/,docs/,routing/,fab/,.gitignore, JSON contracts) along with agent-specific adapter files (e.g.,AGENTS.mdfor Antigravity,CLAUDE.mdfor Claude,.cursor/rules/for Cursor). - Two Decoupled CLI Pipelines:
User Prompt
│
▼
[ LLM ] ──► netlist.json (BOM, semantics, power rails, functional blocks, explicit pin-to-pin nets)
│
▼
Pipeline 1: netlist.json ──► KiCad Schematic (.kicad_sch) + ERC
│ (skidl / ato validation + analog sizing helpers like buck-compensation)
▼
Pipeline 2: Schematic + constraints.json / manifest.json
──► KiCad PCB (.kicad_pcb)
──► EMC Simulated Annealing Placer + Freerouting CLI + DSN Metrology + Stitching
──► Gerber / Excellon + DRC + SVG/PNG
Key Design Principles
- Strict LLM Boundary: The LLM only generates
netlist.json(components, semantics, and explicit pin-to-pin nets). All schematic generation, placement, routing, and Gerber export are deterministic. - Proven JSON Contracts (Evolved from
OBD2):netlist.jsonbuilds onbom.schema.json+semantics.schema.json(designators, MPN/LCSC,power_rails,functional_blocks) and adds explicitnetsconnectivity.- Pipeline 2 consumes
constraints.json(board,anchors,keepout_zones,net_classes,plane_nets) andmanifest.json(packages,placement_constraints,rigid_groups,cem_target), directly compatible with the placement/EMC/routing engines ported from../OBD2.
- Reusable Algorithmic Engines + KiCad CLI Adapter:
- Core engines ported from
../OBD2(pcb-placersimulated annealing &emc_physics,freeroutingJRE/DSN patcher/CLI runner,pcb-synthesizerclosed-loop &dsn_metrics,pcb-stitcher,pcb-dfm,buck-compensation,ratio-solver) remain pure, EDA-agnostic Python modules. - All KiCad interactions (
kicad-cli, schematic/PCB generation, DSN/SES exchange, ERC/DRC, Gerber export) are isolated in a dedicatedkicad/adapter module — replacing the legacy EasyEDA bridge.
- Core engines ported from
- Component Library Strategy:
- Standard KiCad libraries for common/simple parts.
- Complex parts (e.g., MCUs, specialized ICs) stored in a local JSON database (
data/components/) extracted from manufacturer datasheets with LLM assistance and human-reviewed before use.
- 100% CLI Workflow: Driven via Python CLI (
typer/click, Pydantic, agnostic LLM SDK) installed viauv tool, keeping target PCB workspaces free of Python virtual environments.
Repository Layout
prompt2gerber/
├── pyproject.toml
├── AGENTS.md
├── README.md
├── ROADMAP.md
├── src/prompt2gerber/
│ ├── cli.py # Typer CLI entry point (--init, pipeline commands)
│ ├── schemas/ # Pydantic models & JSON schemas (netlist, constraints, manifest)
│ ├── engines/ # Pure algorithmic engines ported from OBD2 (placer, emc, dsn, stitcher, dfm)
│ ├── kicad/ # Isolated KiCad CLI / file adapter (replaces EasyEDA bridge)
│ └── templates/ # Packaged PCB workspace & agent templates (--init --agent)
├── data/components/ # Human-reviewed JSON database of complex components
└── tests/ # Unit and integration tests
Prompt Examples
See docs/prompt-examples.md for concise, intent-first prompt examples that produce clean netlist.json and constraints.json contracts.
Project Status
Planning / Early setup. See ROADMAP.md for the step-by-step implementation plan.
License
Dual-licensed under Apache License 2.0 (software and tooling) and CERN-OHL-P v2 (hardware designs). See LICENSE for full details.
Metadata
Release files for prompt2gerber 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| prompt2gerber-0.1.5.tar.gz | 199.9 kB | With provenance | Details for prompt2gerber-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| prompt2gerber-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for prompt2gerber-0.1.5-py3-none-any.whl |
Total release size: 284.4 kB
Release files / prompt2gerber-0.1.5.tar.gz
| Download URL | prompt2gerber-0.1.5.tar.gz |
|---|---|
| Size | 199.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f84dc9c91fd7ddc15c1f6b992bab92506546c3c154edc675a8f8dda76297c8c
|
|
BLAKE2b-256 checksum How to use checksums |
4574974391a5f54aa00fbbbf6980ba69ff006a00e1019b2af88f72f1db6ecb90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.
Transparency logRelease files / prompt2gerber-0.1.5-py3-none-any.whl
| Download URL | prompt2gerber-0.1.5-py3-none-any.whl |
|---|---|
| Size | 84.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
97be55c699145cbf153208a193c138cb3f9f72bf656dcaa8482840994ff3ce68
|
|
BLAKE2b-256 checksum How to use checksums |
98a3f745268ab555dc7fecc2ae1b8d5ab70677894f0939bfb0d1bd9c53afafa3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.
Transparency logSecurity for prompt2gerber 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for prompt2gerber-0.1.5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.