Skip to content
Archee Docs

The agentcad command

Search, run, calculate, read CAD drawings and check .arc files with the AgentCAD engine from your terminal.

agentcad is the command line of the AgentCAD engine. Every command reads and writes files in the working folder and never prompts, so a person or an agent runs it the same way. Each command prints compact text by default and lossless JSON with --json.

CommandUse it to
agentcad search QUERYFind functions, calculation ops and guides by words, or ask a drawing in ARQL
agentcad execute FILERun Python scripts against the AgentCAD library
agentcad calc OP NAME=VALUERun one cited calculation
agentcad cad [APP:DOCUMENT]List CAD applications, or read, export and edit a drawing open in one
agentcad arc fmt FILEFormat .arc files
agentcad arc check DIRParse, type-check and evaluate a folder of .arc files
agentcad lift FILERead DXF or DWG into a checked Part Record and a tagged DXF
agentcad mcpServe search and execute over MCP on stdio

Help for people and agents

agentcad --help and agentcad COMMAND --help show the purpose, usage, runnable examples, every flag with its type and default, the exit codes and the next command to run. --help --json returns the same content as data.

An embedded guide is one search away:

agentcad search guide
agentcad search guide:arql

The topics are index, search, arql, execute, calc and cad.

agentcad search 'tapered roller bearing life' --limit 5
agentcad search SHEET.dxf 'MATCH (b:bearing)-[:coaxial]-(s:shaft) RETURN b.id, s.id'
echo 'key check' | agentcad search -
  • Words in English or Vietnamese (accents optional) find library functions, calculation ops, rule packs and guide sections.
  • A query that starts with MATCH, DEFINE or RULE is ARQL. It reads the one .dxf in the folder, a SHEET.dxf you name first, or a facts .json.
  • --limit N sets the rows per page and --offset N takes the next page. The result ends with next_offset while more rows exist.
  • proved: lists the calculation ops that carry a proof.

execute

agentcad execute draw_plate.py --out delivery
agentcad execute a.py b.py c.py --out candidates --timeout 60
echo 'print(1 + 1)' | agentcad execute -
  • Up to nine scripts run in parallel. With several files, each writes into DIR/STEM.
  • --out DIR sets the output folder, . by default.
  • --timeout SECS limits one script, 120 by default and 300 at most.

calc

agentcad calc key.check d_mm=80 T_Nmm=1641610.9 lm_mm=110 load=light_shock

Inputs carry their unit in the name (d_mm) or as a literal (d=80mm). Each result line keeps the citation of its value. A failing check is a result, not an error: the command exits 0 and the first line says FAILED.

cad

agentcad cad
agentcad cad autocad:Plate.dwg --since 12
agentcad cad autocad:Plate.dwg --out plate.dxf
agentcad cad autocad:Plate.dwg --apply edits.json

With no target it lists the CAD applications it finds. With a target it reads the drawing as facts. --since REV returns what a person changed after a revision, --out FILE exports (the extension picks the format) and --apply FILE writes edits the person has allowed.

arc

agentcad arc fmt rec/shaft2.arc
agentcad arc fmt rec/shaft2.arc --check
agentcad arc check rec/

arc fmt --check leaves files alone and exits 1 when one differs from canonical form. See Diagnostics for what arc check reports.

lift

agentcad lift gearbox.dwg --out rec --score
agentcad arc check rec

Use a new output directory. Open idx.json for title and BOM evidence, Part ids, suggested mates and unowned entities. tagged.dxf carries the ids on the retained drawing. With --score, Lift also writes an outline DXF from the evaluated Part ports and reports the matching entities, dimension values and ids.

Exit codes

CodeMeaning
0Success
1Failed
2Usage error
3Revision conflict: read the target again and redo the edit
75Busy: run the same command again

Errors go to stderr as a record with a code, whether it is retryable and a hint that names the next command.

Environment

  • AGENTCAD_HOME points to a writable folder for the engine’s cache.
  • AGENTCAD_PYTHON points to a Python that has the agentcad package.