Skip to main content

Getting Started

Estimated read~2 min
TL;DR
  • Install: Run python -m pip install circuitgen with Python 3.10 or newer.
  • Open the CLI: Run circuit, then choose Generate, Render, or Validate. Generate needs a selected AI provider, model, and API key; Render and Validate work offline.
  • Use Python: Call generate() for text prompts, or from_netlist(), validate(), and render() for JSON netlists.
  • Diagnose setup: Run python -m circuitgen doctor if CircuitGen or the circuit command does not work.

CircuitGen is a Python library and CLI for generating circuit schematics from text descriptions or netlists.

Install​

CircuitGen requires Python 3.10 or newer. Install the library and CLI together:

python -m pip install circuitgen

You can also install into a virtual environment. pipx install circuitgen is an option if you want an isolated CLI installation.

Python library or CLI?​

Use the Python library when a script needs to generate, validate, or render a circuit and work with the returned netlist or SVG. Use the interactive CLI to describe a circuit, open JSON files, and choose settings in your terminal. The direct CLI commands do the same jobs from scripts or shell commands. Both interfaces share the same validation and rendering engine.

Generate your first schematic​

Create a schematic from a written circuit description. This requires a configured AI provider and its API key. Though each method below uses the same prompt, AI output may vary, so check its values and connections.

Open the terminal app:

circuit

Select Generate, enter the prompt below, choose an output file, and start generation. The first launch lets you set up a provider; you can also configure it in Settings.

Prompt

A 9 V battery connected to a red LED through a 360 Ω resistor.
Example battery, resistor, and LED schematicExample battery, resistor, and LED schematic

The illustration shows the checked LED example netlist rendered by CircuitGen. It is a sample of the intended circuit, not a promise that every AI provider returns identical JSON.

Render and validate netlists​

CircuitGen can also check and draw a JSON netlist without an API key or internet access. Download this tested file, save it as led.json, and try either action:

Download led.json
circuit

Select Render, open led.json, and save the schematic. Then return home, select Validate, and open the same file to see its checks without creating another image.

Troubleshooting​

Start with the doctor command even if circuit will not launch:

python -m circuitgen doctor

It reports PASS, WARNING, or FAIL for Python, the installed package, the launcher, PATH, dependencies, configuration, credentials, and terminal. Read Suggested Actions under the summary. A warning can describe a limited feature, such as unavailable secure key storage; a failure needs attention.

If the circuit command still will not run, python -m circuitgen launches the same interactive app through your current Python installation. The module name is circuitgen.

circuit is not found​

If Console Launcher passes but PATH Resolution fails or warns, the launcher exists but this terminal cannot find the intended one. On Windows, check before changing anything, then run setup if needed:

python -m circuitgen setup-path --check
python -m circuitgen setup-path

Restart the terminal afterward. On macOS or Linux, add the installed scripts directory to PATH or use your environment's activation steps. python -m circuitgen can launch the app while PATH is being fixed.

Wrong Python environment​

If Python Version, Python Environment Type, or CircuitGen Package shows an unexpected version or location, activate the intended environment and install with its Python:

python -m pip install circuitgen

Run doctor again with that same python to confirm the package and launcher locations.

Missing dependencies or settings access​

If a Dependency check fails, try python -m pip install --upgrade circuitgen; if it remains broken, try python -m pip install --force-reinstall circuitgen. If Config Directory warns, check that the reported directory is writable. If Credential Storage warns, use the provider's environment variable instead of saving a key in Settings.

Provider or generation errors​

For an invalid or missing key, check the provider selected in Settings and its key or environment variable. If a model is unavailable or a quota is exhausted, check the provider account and choose an available model. If generation returns an invalid netlist, inspect the reported validation error and the generated connections; try a clearer description or a different model. Rendering and validation still work offline.