Skip to main content

prompt2gerber

Python uv EDA: KiCad Headless Router: Freerouting Validation: Pydantic AI Agents Status: Planning License

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

  • Current Target Platform: Windows (initial development target until cross-platform / Docker support is finalized for macOS and Linux).
  • KiCad (kicad-cli + standard libraries): Not bundled inside the Python wheel; install locally via winget install KiCad.KiCad.
  • Freerouting & JRE: Managed automatically by prompt2gerber (cached portable runtime).
  • Run prompt2gerber doctor to validate that all external tools are detected.

Architecture Overview

prompt2gerber separates the reusable CLI toolchain from the generated PCB workspaces:

  1. 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.md for Antigravity, CLAUDE.md for Claude, .cursor/rules/ for Cursor).
  2. 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.json builds on bom.schema.json + semantics.schema.json (designators, MPN/LCSC, power_rails, functional_blocks) and adds explicit nets connectivity.
    • Pipeline 2 consumes constraints.json (board, anchors, keepout_zones, net_classes, plane_nets) and manifest.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-placer simulated annealing & emc_physics, freerouting JRE/DSN patcher/CLI runner, pcb-synthesizer closed-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 dedicated kicad/ adapter module — replacing the legacy EasyEDA bridge.
  • 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 via uv 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.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prompt2gerber 0.1.4
File Size Uploaded Provenance Actions
prompt2gerber-0.1.4.tar.gz 183.2 kB With provenance Details for prompt2gerber-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for prompt2gerber 0.1.4
File Interpreter ABI Platform Actions
prompt2gerber-0.1.4-py3-none-any.whl Python 3 none any Details for prompt2gerber-0.1.4-py3-none-any.whl

Total release size: 264.8 kB

Release files / prompt2gerber-0.1.4.tar.gz

Download URL prompt2gerber-0.1.4.tar.gz
Size 183.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5ad91df3164d54672f7c38c4727cf46f323ec44eec01fff4dc4eee4c74da7bd5
BLAKE2b-256 checksum
How to use checksums
c558b855b5fe5b1f8f34d470284580e58858282a9f847a6853ce28e5059154f2
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 2, 2026.

Transparency log

Release files / prompt2gerber-0.1.4-py3-none-any.whl

Download URL prompt2gerber-0.1.4-py3-none-any.whl
Size 81.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a620d93386b493f77c0259a406a549a6c1cc1b3bd165dcd220e3b4604efb6ed
BLAKE2b-256 checksum
How to use checksums
3aa2c6de2510b0542d94f94f21cf4bedcf27cab1987c13dd31403f0a9f8dfd0c
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 2, 2026.

Transparency log

Security for prompt2gerber 0.1.4

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.

Select from 2 files

Attestation for prompt2gerber-0.1.4.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 2, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page