#19. Command line and agents
This chapter is for those who automate: scripts, checks before delivery, artificial intelligence agents with access to the terminal (Claude Code, Codex, Gemini CLI).
#The agent guide
Help ▸ Guide for AI agents (.md)… saves a Markdown file that explains to an agent how to read, write, check
and modify OpenWiring schematics: workflow, rules, tag conventions, typical circuits, complete syntax of the
text format, example, meaning of the checks, procedure for redrawing schematics from PDF (SEE Electrical,
EPLAN, AutoCAD) and symbol catalogue with the connection points. A copy is also in the repository:
docs/AGENTE_IA.md.
#The commands
In the OpenWiring source folder, after npm ci:
npm run -s cli -- esporta progetto.ecad --pagine 2,3 --catalogo > pagine.txt
npm run -s cli -- controlla progetto.ecad pagine.txt # errors with line number, and check
npm run -s cli -- applica progetto.ecad pagine.txt # creates the project if it does not exist
npm run -s cli -- verifica progetto.ecad [--json]
npm run -s cli -- importa-pdf schema.pdf [uscita.ecad]
npm run -s cli -- guida > AGENTE_IA.md
| Command | What it does |
|---|---|
esporta |
writes the pages in text format; --pagine chooses the pages, --catalogo adds the symbol catalogue |
controlla |
checks a text without changing the project: errors with the line number and check problems on the pages touched |
applica |
applies the text to the project (replaces or adds pages); creates the file if it does not exist |
verifica |
the project checks, also in JSON for scripts |
importa-pdf |
rebuilds a project from a schematic in vector PDF |
guida |
the agent guide |
Pages generated by the program (PLC overviews, terminal strip diagrams, lists, layout, cover) are exported only as a header.
#The text format
One line per element, with coordinates in mm on the A3 sheet and a 4 mm grid:
| Line | Example |
|---|---|
progetto |
progetto nome="Linea 3" cliente="Rossi Spa" |
luogo |
luogo +Q1 "Quadro master" tipo="Quadro elettrico" |
cavo |
cavo -1W1 tipo=FG16OR16 sezione=1,5 conduttori="BN BK GY GNYE" lunghezza=15 |
scheda |
scheda -3A1 tipo=cpu-14di-10do-2ai stazione=PLC1 |
simbolodef |
a box symbol with its connection points, for components not in the catalogue |
pagina |
pagina 7 "Ventilazione" tipo=schema luogo=Q1 |
simbolo |
simbolo coil -7K1 @100,140 descr="Contattore" dati="24 V DC" |
filo |
filo 100,24 100,60 sezione=1,5 colore=BU |
collega |
collega -7S1:14 -7K1:A1 (the program calculates the route) |
testo |
testo @40,250 h=3 "Nota" |
riquadro, lineacavo |
frames of the network diagram and cable lines |
The exported text describes in comments every connection point with its coordinates and, for every wire, what it connects and the wire number. Exporting and re-importing without changes gives the same project.
Edit this page on GitHub · OpenWiring 2.0.6 · GPL-3.0