Voltecx is in beta. The macOS build comes first; Windows and Linux packages are still being tested.Beta. macOS comes first; Windows and Linux are still in testing. What's new
Documentation

11. Chat and the command line

Voltecx's assistant is its built-in chat. Every Voltecx action is a command, so the assistant uses the program the way you do: it builds the circuit, runs the simulation, reads the waveforms and tells you what it found. You talk to it in two places.

Where Use it when
The agent panel in the desktop app You want to work on the circuit in the window, with proposals you accept or reject (chapter 12)
powercraft-cli chat You want to talk to Voltecx in a terminal, or answer one message from a script

Outside AI tools cannot drive Voltecx: it has no MCP server and no connection for other assistants. The one way in is Claude Code started from Terminal › Claude Code Here, which works on the open window through powercraft-cli app with Voltecx's own skills (see "Claude Code in the terminal" below). To script the program without an assistant, use the command line (chapter 19) or powercraft-cli app (below).

The assistant does not see more than you allow (see "What the assistant can reach" below).

Chat in the terminal

You need an Anthropic API key. It costs money on your own account. Voltecx reads the key only from the environment and never writes it to a file.

export ANTHROPIC_API_KEY=sk-ant-...
mkdir -p work
powercraft-cli chat --automation-read-root work --automation-write-root work

Then type a request:

you> build a 48 V to 12 V, 5 A, 100 kHz buck and tell me the output ripple
-> circuit.template {"fsw":"100k","iout":5,"topology":"buck","vin":48,"vout":12}
   ok
-> sim_run
   ok
-> scope_measure {"signals":["v(out)"],"t0":0.000153}
   ok
The output averages about 12 V ...
you> /save buck48.voltecx

(The numbers above are a sketch. The real values depend on your run.)

In the open window. While Voltecx runs, a chat started in a Voltecx terminal (View › Terminal), or in any shell while the app runs with its control channel, works on the open window instead of a circuit of its own. The banner says "Linked to the open Voltecx window". What the chat builds appears in the window as it happens, each command is one step you can undo, and the version history records it as the CLI's. A spec the chat sets shows in the Spec tab with Set by CLI (chapter 16). /save saves the window's circuit, and /reset forgets only the conversation: the window's circuit stays. --headless keeps a session of the chat's own, as before. With no window running, nothing changes.

It checks its own changes. When the assistant has changed the circuit in a message, it checks the change before it answers, as in the agent panel (chapter 12). If it tries to answer without having run anything since the change, Voltecx sends it back to run spec_verify with the spec or targets you gave, or to simulate and measure, and to answer with pass or fail for each target, the measured value and its limit. It is sent back at most twice per message, so a message always ends. The answer it wrote before the check prints first, as a draft, and the check prints as a line of its own with its verdict:

→ self_check {"after":"spec_verify"}
  error: 1/2 ✗ · ripple 0.15 > 0.12 V

ok · 5/5 ✓ means every row of the spec passed; a plain ok follows a simulation run again after the change. When a target still fails, the final answer says which one, by how much and what would meet it.

Chat command What it does
/save NAME.voltecx Saves the current circuit (needs --automation-write-root)
/reset Forgets the conversation and starts with an empty circuit
/help Shows help
/exit or Ctrl-D Leaves
Ctrl-C Cancels the current message. The conversation stays

Options: --model ID (default claude-opus-5-5), --max-tokens N (default 64000, thinking included), --max-tool-calls N (default 200), --effort LEVEL (low, medium, high, xhigh or max; default high). Claude 4.6 and later models think before they answer (adaptive thinking); --effort sets how much.

Web search. With --allow-web, the assistant may search the web and read pages when the circuit, the results, the catalogue and your files do not answer a question: a data sheet value, an application note, a standard's limit. Without the option it never reaches the web. Anthropic runs the search, so the computer still talks only to api.anthropic.com; the search queries and the addresses of the pages it reads go there, never your circuit file. It searches at most 8 times and reads at most 8 pages per message. Each search shows as a → web_search {"query":…} line, and the answer is followed by the pages it cites:

The total gate charge Qg is … nC at VGS = 10 V (data sheet, page 3).

Sources from the web:
  1. <part> data sheet, page 3: https://<manufacturer>/…

The line after the answer counts the searches and pages ([2 tool calls, 1 web search, 1 page read, …]), and -p --json adds webSearches, webFetches and sources (each with url, title, page and the cited passage). The assistant does not write a value from the web into the circuit without naming its source; check the source before you keep the value. --allow-web needs Anthropic's API: with a self-hosted model server (below) it is refused.

Privacy. Your messages and every tool result go to Anthropic's API. That includes circuit data, waveform values and the content of any file you allow it to read. Do not put data you must not send into the read folder, and do not paste it into the chat. The engine itself works fully offline. Only chat connects to the network, and only to api.anthropic.com. You can build a CLI with no network code at all: cargo build -p powercraft-cli --no-default-features.

A conversation is not saved when you close the program. Save the circuit with /save.

A self-hosted model (closed networks)

On a network with no internet access, point chat at a model server on your own network instead. Nothing then goes to Anthropic, and no ANTHROPIC_API_KEY is needed. The server can speak the OpenAI chat-completions API (vLLM, llama.cpp's server, Ollama, LM Studio, a LiteLLM gateway) or the Anthropic Messages API.

export POWERCRAFT_AI_ENDPOINT=http://gpu-box:8000/v1    # the server's base URL
export POWERCRAFT_AI_ENDPOINT_MODEL=qwen3:32b           # the model id the server knows
export POWERCRAFT_AI_ENDPOINT_API=openai                # or anthropic (default: openai)
export POWERCRAFT_AI_ENDPOINT_KEY=...                   # only if the server wants a key
export POWERCRAFT_AI_ENDPOINT_MAX_TOKENS=8192           # output limit per reply (default 8192)
powercraft-cli chat --automation-read-root work --automation-write-root work

http:// is accepted only for this machine and the local network (localhost, private addresses such as 10.x, 192.168.x, a name without dots, or one under .local, .lan, .internal); anything else needs https://. Voltecx never follows a redirect, so the key goes only to the server you named. --model and --max-tokens do not apply to the server; the variables above set them.

Models that cannot call tools. The assistant builds and simulates through tools. If the server says the model cannot call tools, chat sends the message again without them and answers in Ask mode: advice only, the circuit is not changed. It says so once, with this model cannot call Voltecx's tools …. Set POWERCRAFT_AI_ENDPOINT_TOOLS=off to start in Ask mode. Pick a model trained for tool calling (and, for vLLM, start it with --enable-auto-tool-choice) to get the full assistant.

The licence on the command line

powercraft-cli chat (and run, script, sim, convert, serve) uses the licence the desktop app keeps (Help › Licence), so the terminal gets the same Pro features as the window. powercraft-cli licence status shows it (tier, dates, what is unlocked, never who it is issued to), powercraft-cli licence load FILE checks a licence file and stores it in the same place, and powercraft-cli licence remove deletes it. The assistant cannot install a licence: there is no command or tool for it.

The terms on the command line

powercraft-cli chat starts only after the Voltecx Terms are accepted (chapter 1): by the desktop app or an earlier command-line run, by --accept-terms, or by VOLTECX_ACCEPT_TERMS=<terms version> in the environment. In a terminal the first use asks; serve, which scripts start, never asks and exits with a message that says how. The assistant cannot accept the terms through any tool.

Check the install

powercraft-cli doctor checks this install: the program, its version, the file folders and the API key.

powercraft-cli doctor --root ~/Voltecx

It prints one line for each check, pass, warn or fail. The lines look like this (the paths and numbers on your machine differ):

pass  binary       /usr/local/bin/powercraft-cli
pass  version      powercraft-cli 0.0.1 (macos aarch64)
pass  read root    /Users/ann/Voltecx can be read
pass  write root   /Users/ann/Voltecx can be written
warn  api key      ANTHROPIC_API_KEY is not set or not usable; `chat` needs it
No check failed; 1 warning.
Check What it looks at
binary The program file exists
version The version, the system and the processor
read root, write root The folders from --root, --automation-read-root and --automation-write-root (or the two POWERCRAFT_AUTOMATION_*_ROOT variables). The write check saves a small test file and removes it again. A folder that is not set passes, and the line says the assistant cannot read or write files
api key Whether ANTHROPIC_API_KEY is set. Only chat needs it, so a missing key is a warning. The key itself is never printed

The exit code is 0 when no check failed and 1 when one did. A warning is not a failure.

One message from a script

chat -p answers one message and exits. It does not open the chat. You need ANTHROPIC_API_KEY, as for the chat, and the same privacy rules apply.

powercraft-cli chat -p "Build a 48 V to 12 V, 5 A, 100 kHz buck. What is the output ripple?" \
  --automation-write-root work

The answer goes to standard output. The lines that show the tool calls go to standard error, so > answer.txt keeps only the answer. With --json the result is one JSON object with answer, model, toolCalls, inputTokens, outputTokens and truncated. If the model cannot answer, the exit code is 1 and the reason is on standard error. With --json it is also in an error field on standard output.

Drive the running app from the command line

powercraft-cli app talks to the same control channel without an assistant, so a shell script can drive the window. It connects to 127.0.0.1 only. The port and the token file come from --port and --control-token-file, or from POWERCRAFT_CONTROL_PORT and POWERCRAFT_CONTROL_TOKEN_FILE. The token itself is never accepted on the command line, where other users of the machine could read it.

export POWERCRAFT_CONTROL_PORT=7878 POWERCRAFT_CONTROL_TOKEN_FILE=~/.powercraft/control.token
powercraft-cli app open buck.voltecx          # relative to the app's --automation-read-root
powercraft-cli app set theme=darkPlus panels.chat=false
powercraft-cli app run                       # simulates as a job and waits for the result
powercraft-cli app wait idle
powercraft-cli app inspect state.theme
powercraft-cli app menu view.animate
powercraft-cli app screenshot shot.png
powercraft-cli app engine.execute '{"command":"scope.measure","params":{"signals":["v(out)"]}}'

Any control method works as app METHOD [JSON] (app methods lists them). The conveniences are screenshot OUT.png [--max-side N], menu ID, set KEY=JSON... (a dotted key nests, and a value that is not JSON is taken as text), inspect [PATH], run [--timeout S], open FILE and wait idle|job|agent|dialog:ID|frames:N. The reply is printed as JSON. The exit code is 1 when the app refuses the call and 2 for a usage error. docs/automation-coverage.md lists, for every command, menu item, view setting and window, which entry points can reach it.

The terminal (View › Terminal)

The desktop app has a terminal in its bottom panel, as VS Code does, so you can run powercraft-cli or any other program without leaving the window. Open it with View › Terminal or Ctrl+** (the same key closes it again). **Ctrl+Shift+ or the New Terminal icon (a plus) starts another one; the list on the left of the terminal's toolbar switches between them, Kill Terminal ends the one shown and Clear Terminal clears it and its scrollback. The Terminal menu has the same items.

The toolbar of the terminal has the session list, the New Terminal, Kill Terminal and Clear Terminal icons, then what the terminal shown is (its shell, its folder, the active circuit, marked "(unsaved)" before it has a file, and whether powercraft-cli is on its PATH). With no terminal running, the panel offers New Terminal with its key.

The Terminal tab, marked 1 to 2

  1. New Terminal (the plus).
  2. Kill Terminal (the trash icon); Clear Terminal sits beside it.

Each terminal is your own login shell ($SHELL -l; %ComSpec% or PowerShell on Windows) started in the folder of the active circuit file, or, when the circuit has not been saved, in Voltecx's workspace folder Documents/Voltecx in your home folder (made the first time it is needed). It is a full terminal: 256 colours and true colour, bold, italic and underline, the cursor shapes programs ask for, the alternate screen of full-screen programs (vim, htop, less), 10 000 lines of scrollback (the wheel, or Shift+Page Up / Page Down), and the mouse for programs that read it (hold Shift to select instead).

Key In the terminal
Ctrl+C Interrupts the program; with text selected (drag, double-click a word, triple-click a line) it copies instead. On a Mac, ⌘C copies
⌘V / Ctrl+V Pastes. When the shell asks for bracketed paste, a pasted command does not run until you press Enter. An image on the clipboard pastes the path of a saved PNG
⌘-click / Ctrl-click Opens the web link under the pointer in your browser
Ctrl+, Ctrl+Shift+, ⌘⇧P (Ctrl+Shift+P), and ⌘K on a Mac Stay Voltecx's. Every other key, the function keys included, goes to the program

Chinese and other input methods type into the terminal as into any text field.

Files and images. Drag files from Finder (or any file manager) onto the terminal and their full paths are typed at the prompt, quoted for the shell (spaces, quotes and Chinese names included) and separated by spaces, as in Terminal.app. Images and PDFs too: a program that reads paths, such as Claude Code, then reads the file. While you drag over the terminal only the terminal is highlighted; let go anywhere else and the file opens, imports or goes to the assistant as before. With a screenshot or another image on the clipboard and no text, ⌘V / Ctrl+V in the terminal saves it as a PNG in a temporary folder of that terminal's own and types the PNG's path. Only the path is typed, never Enter, so nothing runs until you press Enter; a file name with a line break in it is refused. The temporary folder and its images are deleted when the terminal ends or Voltecx quits. (Dropping onto the terminal follows the pointer on macOS; on Windows and Linux the window does not learn where a drag is, so a drop is routed by where the pointer was last seen.)

Voltecx in the terminal. When the first terminal starts, Voltecx starts its control channel if it was not started with --control (on 127.0.0.1, a random port, a new token in a file only you can read, in a private folder that is removed when the app quits). Every terminal then has:

  • POWERCRAFT_CONTROL_PORT and POWERCRAFT_CONTROL_TOKEN_FILE: the port and the path of this terminal's own token file, never the token itself;
  • VOLTECX_CIRCUIT (the active circuit's file, empty while it is unsaved), VOLTECX_TAB (its tab's name) and VOLTECX_FOLDER (the folder the terminal started in), as they were when the terminal started; powercraft-cli app status gives them as they are now;
  • the folder of powercraft-cli first on PATH, when it is found next to the app. If it is not, a warning above the terminal says so (the shell still works) (build it with cargo build -p powercraft-cli).

So no flags are needed inside the terminal:

powercraft-cli app status                  # the window's tabs: name, file, active, modified
powercraft-cli run --cmd circuit.inspect     # on the open window (see the command-line chapter)
powercraft-cli show results/buck.voltecx   # open it in the window and show its tab
powercraft-cli app run && powercraft-cli app inspect signals

An agent in the terminal (Claude Code and others) works on your open window. powercraft-cli run --cmd ... --params ... runs its commands on the circuit you see, and each change can be undone with Edit › Undo. powercraft-cli show FILE opens a circuit the agent wrote (a .voltecx, .pcraft, LTspice .asc, PLECS .plecs or SPICE netlist) and makes its tab the active one, with a notice "Opened from Terminal". A terminal may open circuits only under its own folder (VOLTECX_FOLDER), and only while it runs: no automation folder needs granting for that, and a file outside the folder is refused.

Opening the Terminal tab starts a shell; Preferences › Start a shell when the Terminal tab opens turns that off.

Claude Code in the terminal. Terminal › Claude Code Here (also a link on the terminal's toolbar) opens a new terminal and starts Claude Code (claude, which you install yourself; if it is missing, the notice links its install guide). It starts with two things from Voltecx:

  • Voltecx's agent skills. The app ships them (--plugin-dir, in plugins/powercraft of the installed program): how to design, simulate, verify and debug with Voltecx's commands, and the closed-loop skill below. Only the skills ship: there is no MCP server.
  • A note on the open window (--append-system-prompt): the active circuit's name and file (or that it is not saved yet), and the closed-loop rule.

The closed-loop rule: Claude works only through powercraft-cli app on the open window, so every change appears on your schematic as one undo step with Claude named in the version history; it builds with engine commands and blocks (circuit.apply, ic.place, circuit.createSubsystem, schematic.labelNet, schematic.autoLayout, design.*); it checks its work with circuit.problems and a simulation in the window and reports numbers from that run; and it never writes or edits circuit files (no scripts that generate a .voltecx, no sed on one). If you see it doing that, tell it to stop: the skill and the note both say not to.

The command it types is shown in the terminal, for example:

claude --plugin-dir '/Applications/Voltecx.app/Contents/Resources/plugins/powercraft' --append-system-prompt "$(cat '…/claude-note.md')"

The note is a file in the control channel's private folder, never in your project. Automation cannot start Claude Code: only your own click or menu choice does.

Security. The terminal is your own shell with your own rights, exactly as Terminal.app or VS Code's terminal: anything you run there can do what you can. The control channel stays on loopback behind its token. Each terminal gets a token of its own, which ends when the terminal does; it can do what the window's token does, and open circuits under that terminal's folder. No token is ever shown in the terminal, written to a log or put in the environment, and ui.inspect reports only which terminals run (terminal), never what is on their screens. Automation (the control channel, powercraft-cli app) can open and close the Terminal tab and list, clear and end terminals, but it cannot start a shell or type into one (ui.key and ui.type never reach a shell). Closing a terminal, or quitting Voltecx, hangs up the shell and everything it started, as closing a Terminal.app window does; a program started with nohup or in a session of its own keeps running, by design.

The terminal is a desktop feature: the browser version has none.

The agent panel

Inside the desktop app the assistant is the agent panel, with proposals you accept or reject. It is described in chapter 12.

Good prompts

  • "Build a 400 V to 48 V, 10 A, 100 kHz buck. Restate the spec first, then build it." The restating step catches misunderstandings, because the template reply lists the spec it used.
  • "Open this LTspice file and tell me what the circuit is." (beta: needs the import, then circuit.explain)
  • "Sweep the duty cycle from 0.2 to 0.4 and tell me where the output reaches 12 V."
  • "Why does the output ring? Diagnose it."
  • "Pick a MOSFET from the library for S1 with the lowest loss at this operating point."

What the assistant can reach

  • Files. With no folder granted, the assistant cannot read or write any file. In the app, grant a read folder and a write folder in Preferences › Privacy and updates › Automation folders (kept for the next start, shown in the status bar, with Revoke all); Elsewhere use --automation-read-root and --automation-write-root. With them, paths are relative to those folders. Absolute paths and .. are refused. You can set the same folders with POWERCRAFT_AUTOMATION_READ_ROOT and POWERCRAFT_AUTOMATION_WRITE_ROOT.
  • Network. Only chat reaches the network, and only Anthropic's API.
  • Undo. Everything the assistant does goes in the same undo history as your own edits (one step per command).

Limits

  • A template is an ideal, continuous-conduction starting point. It has no conduction loss and no ESR. Check a design with analysis.losses and analysis.worstCase before you rely on it.
  • sim_run cannot be cancelled in headless mode. Template runs are about one million steps or fewer.
  • The assistant can misunderstand you. Ask it to restate the request first.
  • Written depth: docs/workflows/ai-chat.md (in Traditional Chinese) and docs/control-protocol.md.