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

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

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.1
File Size Uploaded Provenance Actions
prompt2gerber-0.1.1.tar.gz 168.9 kB With provenance Details for prompt2gerber-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 239.4 kB

Release files / prompt2gerber-0.1.1.tar.gz

Download URL prompt2gerber-0.1.1.tar.gz
Size 168.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f686029b419858249e8d00861ece872c2e51e46b805fb29bd9bb653d4a8cf20a
BLAKE2b-256 checksum
How to use checksums
c00d9ccfc729d758aec75e932719c8b471444f662f262c3869c3aa63f155d260
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 Nov 30, 2026.

Transparency log

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

Download URL prompt2gerber-0.1.1-py3-none-any.whl
Size 70.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b87be06f3e4eb931961f7bfaccdaad6960681c0fe14e98df75217b2269d5500
BLAKE2b-256 checksum
How to use checksums
5c009b168ab3ab929ffe88671edaf3918c63e60b89a15dbfb02cdfad03dfa7c6
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 Nov 30, 2026.

Transparency log

Security for prompt2gerber 0.1.1

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.1.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 Nov 30, 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