Open general

kicad-cli shim: carry hierarchical schematic dependencies and directory outputs

John Lauer · 6d ago

AI Flow ships its own desktop kicad-cli wrapper (adom-aiflow-kicad-cli-remote, tools/kicad-cli-remote) only because the shared kicad-cli shim does not yet cover what its gates need. We would like to retire the wrapper and call the shim.

Gaps in the shim's desktop lane (checked 2026-10-15):

  1. Inputs: it sends a file and its same-stem siblings (.kicad_pro, .kicad_dru, .kicad_pcb, .kicad_sch, .kicad_prl). A hierarchical schematic also needs its sub-sheets (Sheetfile properties, recursively, same relative folders), sym-lib-table, fp-lib-table, and every ${KIPRJMOD} library those tables name. Without them sch export netlist and sch erc run against a broken project.
  2. Outputs: it pulls each -o/--output back as a single file. pcb export gerbers and pcb export drill write a directory (--output <dir>/), which needs a directory pull (for example desktop_pull_glob over the job's out folder).
  3. Commands AI Flow uses: pcb drc --format json --refill-zones with project rules, sch export netlist --format kicadsexpr, pcb export gerbers, pcb export drill, pcb export pos.
  4. Small: the temp folder comes from shell_execute echo %TEMP%, a human-gated call. A read-only desktop path (for example from desktop_disk_free's recordingsDir parent, or a dedicated verb) would avoid one approval per job.

Acceptance: the five commands above produce the same outputs through the shim as through tools/kicad-cli-remote on a hierarchical project with project rules. AI Flow will then set ADOM_AIFLOW_KICAD_CLI to kicad-cli and drop the wrapper.

0 Replies

Log in to reply.