name: cadcraft description: >- CADCraft is an open-source, clean-room AutoCAD-style 2D CAD and drafting app (pure Rust, egui) for macOS, Windows, Linux, FreeBSD and the browser, with DXF/DWG file support, clipped block and xref references (XCLIP), attached raster images (IMAGEATTACH: PNG/JPEG/BMP/TIFF), SHX shape-font reading, proxy-preserving DWG saves, editable MTEXT and multileader text, a user keyboard-shortcut dialog, and first-class agent control over MCP, a JSON control channel, a browser page API and a headless CLI. Trigger this skill whenever the user mentions CADCraft (or "the CAD app"), asks what it can or cannot do, which file formats it opens or writes, its keyboard shortcuts or commands, wants to draw, edit, dimension, hatch, block, xref, clip, attach an image, lay out, plot or export a drawing, convert/inspect/verify/round-trip a DXF or DWG, measure what a save loses, script or automate drafting (AutoLISP, .scr scripts, .pgp aliases, MCP, control channel, window.cadcraft, cadcraft-cli), prepare assets for it, or troubleshoot it — and also when they describe the job without naming the app ("draw a floor plan", "edit this DXF", "convert this DWG to PDF/PNG", "put
Audit basis. Refreshed 2026-11-12 against tag v0.20.1, commit 7526dc62c14e71b3c8d46e73bbf1fa29ef506af1 — git rev-parse HEAD in the pinned checkout confirms it, and the installed 0.20.1 bundle (id ai.storyteller.cadcraft) prints cadcraft 0.20.1 (7526dc62c14e71b3c8d46e73bbf1fa29ef506af1). The previous release this skill described was v0.18.0 (32238e83c2c8bf643994132883e94bc96961f649, "Release 0.18.0", 2026-11-06).
v0.18.0 → v0.20.1 delta (measured with git diff v0.18.0..HEAD: 146 files, +8,144/−856; 14 added, 132 modified, 0 deleted). No engine command id was added or removed — the multiline-aware literal set is identical at both tags (439 ids), gc!/dc! stay at 12/6, so the registry stays 457; the only new catalog id is UI-only ui.shortcuts (Tools ▸ Customize ▸ Keyboard Shortcuts...), which gives any command a shortcut, lets the user's choice win over the built-in one, reassigns and reports conflicts, keeps the clipboard keys, Delete and Cmd+Q fixed, and stores at most 1,000 with the preferences (crates/ui-egui/src/keys.rs, crates/ui-egui/src/menus.rs, crates/ui-egui/src/lib.rs). ALIASEDIT aliases now persist in the user profile across restarts (desktop and web; CLI runs are session-only), a loaded .pgp now replaces the user alias set, and the Command Aliases dialog gained Import... with a .pgp picker (crates/engine/src/cmd/file/pgp.rs, crates/ui-egui/src/aliasdlg.rs, crates/ui-egui/src/options.rs). Right-Click Customization (Options ▸ User Preferences) sets the hold time (100–2000 ms, default 250) and Default/Edit/Command modes (menu/repeat; menu/enter/menuWithOptions) (crates/ui-egui/src/options.rs, crates/ui-egui/src/options/dialog.rs, crates/ui-egui/src/context_menu.rs). TEXTEDIT and a double-click on an existing MTEXT now open the in-place editor with its contents and formats (#842), and multileader text is editable by double-click, TEXTEDIT and the Properties Contents field (#1081); relative \H2x; heights stay relative, and text too long for the editor (over 100,000 characters, 20,000 paragraphs or 1,000 kept codes) is refused and sent to the command line instead of being truncated (crates/engine/src/mtext_edit.rs, crates/engine/src/cmd/modify2/textedit.rs, crates/ui-egui/src/mtext_editor.rs, crates/ui-egui/src/canvas/pick.rs). The Properties palette shows a type's properties for several selected objects of that type and *VARIES* where values differ (crates/ui-egui/src/palettes.rs). DWG saves now keep other applications' registered entities and objects as proxies of their own classes (class numbers 500+, hard-owned null-owner objects kept, failures named in the read notes) (crates/dwg/src/proxy_transport.rs, crates/dwg/src/lib.rs, crates/io/src/dxf_raw.rs). The browser build installs the window.cadcraft page API (request, execute, commands, docInspect, uiInspect, screenshot) over the control channel (apps/cadcraft-web/src/api.rs, apps/cadcraft-web/src/main.rs). The MCP bridge sends the control token only to the exact peer 127.0.0.1:PORT and refuses token files that are symlinks, non-plain or readable by other users, with no shared-temp-dir fallback; the web ui.screenshot returns an inline PNG (crates/mcp/src/backend.rs, crates/mcp/src/control_token.rs, crates/ui-egui/src/control.rs). macOS file dialogs are sheets shown without a modal loop, one at a time, with the answer applied to the drawing that asked (apps/cadcraft/src/sheet.rs, apps/cadcraft/src/main.rs, crates/ui-egui/src/lib.rs). Flatpak update checks and self-updates gained --talk-name=org.freedesktop.Flatpak in both manifests, guarded by a test (packaging/linux/flatpak/ai.storyteller.cadcraft.yml, packaging/linux/flatpak/ai.storyteller.cadcraft.bundle.yml, crates/ui-egui/tests/flatpak_updates.rs). The rest is hardening and performance (allocation-free NURBS derivatives, banded spline solves, region pair budgets, MTEXT/LISP/render caps). v0.20.1 itself is the Flatpak patch; the other changes arrived between the tags.
v0.17.0 → v0.18.0 (earlier). XCLIP/XCLIPFRAME; raster IMAGEATTACH/IMAGE (PNG/JPEG/BMP/TIFF); SHX shape/big/unifont fonts; DVIEW view twist; MINSERT; cadcraft-cli roundtrip and cargo xtask corpus; DWG read/write in a child process on acadrust 0.6.6; autosave locks/failure/recovery and a UI panic guard; Find and Replace (Cmd+F) and Edit Text windows; PLOT format from the path extension; Georgian; and web page-host mode. Older history (v0.16.0 → v0.17.0 and earlier) is folded into CHANGES.md.
Verify against your installed version — the ArtCraft Launcher auto-updates, so a newer build may differ; every count quoted here was re-measured at this tag, and code paths that moved were re-cited. The measurement method for each count is in evidence.md. There is no references/ directory: all detail is here with repo-relative evidence paths.
CADCraft is an open-source (MIT OR Apache-2.0) 2D CAD and drafting application written in Rust (egui/eframe 0.37, wgpu) for macOS, Windows, Linux, FreeBSD and the web (WebAssembly); source is GitHub storytold/cadcraft. It is a clean-room reimplementation of Autodesk AutoCAD targeting AutoCAD 2027, 2D drafting first (AGENTS.md clean-room rules, docs/target-app-parity.md). Stage: pre-alpha — ROADMAP.md (last updated 2026-10-24) still lists four of AutoCAD's five core workflows failing the alpha gate (precise drafting, blocks/xrefs, layouts/plotting, and lossless DWG exchange); dimensioning passes. The roadmap is direction, not a per-release status, so do not quote its row text as current.
The differentiator: every user-visible action is a command. The engine registry holds 457 commands at this tag (unchanged at v0.20.1) — 439 unique literal CommandSpec::new("<id>") ids plus the 18 ids the gc!/dc! constraint macros expand to, with no duplicate ids; the same derivation read 457 at v0.18.0 (and 451 at v0.17.0 in the previous audit). The desktop app's catalog adds 60 UI-only entries (crates/ui-egui/src/menus.rs), so the app-level catalog is 517. Re-derive before quoting: cadcraft-cli commands | jq length (the app bundle does not install the CLI).
The repo's generated checklist (docs/parity-checklist.md, dated 2026-11-01 and not regenerated for v0.20.1) still says 449 registered commands and menu breadth 298/491. Treat that as a pre-release snapshot, not this tag: it is eight ids short of 457. Do not "correct" one number to the other — the two gc!/dc! macro bodies carry no literal id, the 18 invocations expand to ids a literal scan cannot see, and the published checklist counts a built registry from the day it ran.
Everything below is implemented and wired to a command/CLI/MCP/control surface unless marked partial or claimed; evidence.md gives the per-claim tier.
crates/engine/src/cmd/draw.rs, crates/engine/src/cmd/draw2.rs).crates/engine/src/cmd/modify/trim.rs, crates/engine/src/cmd/modify/explode.rs).crates/engine/src/snap.rs — ALL has 14 entries: endpoint, midpoint, center, geometric center, node, quadrant, intersection, extension, insertion, perpendicular, tangent, nearest, apparent intersection, parallel); object snap tracking; polar tracking; ortho; grid snap; direct distance entry; @dx,dy, @d<a, #x,y; point modifiers FROM/M2P/TK and point filters (crates/engine/src/pointmod.rs); typed snap overrides..pgp + ALIASEDIT/REINIT), transparent commands, .scr scripts; hot grips cycle Stretch/Move/Rotate/Scale/Mirror. Aliases survive restarts on the desktop and web (the headless CLI has no profile), and a .pgp load replaces the user alias set (crates/engine/src/cmd/file/pgp.rs). Tools ▸ Customize ▸ Keyboard Shortcuts... (ui.shortcuts) lets any command take a shortcut; the user's choice wins over the built-in one, a command that loses a key is named, and the clipboard keys, Delete and Cmd+Q are fixed (crates/ui-egui/src/keys.rs).properties.set leaves objects on locked layers alone and says how many (crates/engine/src/cmd/props.rs). With several objects of one type selected, the Properties palette shows that type's properties and *VARIES* where they differ; edits apply to the whole selection (crates/ui-egui/src/palettes.rs).FIND takes types and handles and returns match snippets (crates/engine/src/cmd/utility.rs). TEXTEDIT or a double-click on an existing MTEXT opens the in-place editor with its contents and formatting; multileader text edits the same way and from the Properties palette; the shortcut menu's Edit Text window still edits plain text (crates/ui-egui/src/mtext_editor.rs, crates/engine/src/cmd/modify2/textedit.rs).crates/doc/src/library.rs), solid and gradient fills, user .pat files; BLOCK/INSERT/MINSERT/ATTDEF, BATTMAN, ATTSYNC, ATTEDIT, DATAEXTRACTION/EATTEXT, nested blocks, groups, WBLOCK, PURGE; xrefs (XATTACH, -XREF, XBIND, XOPEN, overlays, relative paths); XCLIP/XCLIPFRAME clip block and xref references (rectangular, polygonal and closed-polyline boundaries, Invert clip, ON/OFF/Delete/generate Polyline, a frame mode per drawing), boundary stored per reference and kept through DXF/DWG; Block Editor for static blocks (BEDIT/BSAVE/BSAVEAS/BCLOSE; BSAVEAS copies the edited block and leaves the source's last saved definition intact); REFEDIT/REFSET/REFCLOSE; dynamic blocks read from other files with visibility/lookup/custom-property edits and grips.crates/engine/src/cmd/plotters.rs); a landscape media's size order and rotation survive DXF/DWG, and model-space PDF plots apply the device paper's printable-area margins (crates/io/src/pdf.rs, docs/plotters.md).shapes (with selfCheck), usage, loops, countlist/counttable/count, properties, list, dist, id.constraints.inspect/constraints.dof (crates/constraints/src/lib.rs)..lsp via APPLOAD (with a .lsp file browser), (load), drag-and-drop, or the lisp/appload commands; (defun c:NAME); startup files; command, entget/entmake/entmod, ssget filters, get… input, vl-* functions, tblsearch/tblnext (crates/engine/src/lisp.rs). No Visual LISP ActiveX, DCL dialogs, reactors or Startup Suite.iat) with {path, data?, at?, scale?|width?, rotation?, name?} — a relative path is relative to the drawing's folder; IMAGE (im) lists every image with status Loaded / Not Found / Not loaded. At most 1,000 image files, 256 MiB per file and 2 GiB of decoded pixels per drawing; a missing file stays a crossed-out frame. Drawn on screen and in PNG output with rotation, fade and a clip boundary read from the file; brightness and contrast are kept but not applied (crates/engine/src/cmd/image.rs, crates/io/src/raster.rs).FONTALT/FONTFALLBACK, and SHX shape fonts, big fonts and unifonts (searched beside the drawing, in CADCRAFT_SHXPATH, through a font map, or registered by the web app; never inside another CAD program's folder). Text widths and extents follow the SHX pen's own metrics (crates/fonts/src/shx/mod.rs). MTEXT/bidi fixes keep paragraph direction across isolates, no longer let harakat block the Lam-Alef ligature, honour an inline \W…x width factor, and keep text after an unterminated code (crates/fonts/src/bidi.rs, crates/fonts/src/mtext.rs).$DWGCODEPAGE. DWG by content magic through the acadrust 0.6.6 bridge (MPL-2.0, unmodified; R13 untested, pre-R13 not read) in a child process; DWG read notes carry proxy-conversion failures. SVG and gzipped SVGZ (shapes, paths, groups, Inkscape layers; no CSS, use, fills/gradients/patterns, text, images). Raster image files PNG, JPEG, BMP and TIFF are decoded for IMAGE entities; the format comes from the content, not the name (crates/doc/src/format.rs, crates/io/src/raster.rs). The DXF reader and writer are hardened against hostile input (every count and offset bounded; a crafted file is refused or read only as far as it is valid) (crates/dxf/tests/hardening.rs)..dwt templates save via SAVEAS; NEW/QNEW accept .dwt/.dxf templates; LAYOUT SAveas writes a layout as a template. 4 drawing formats read / 6 written, unchanged at v0.20.1 (plus the 4 raster image formats, also unchanged). Oversized files fail loudly: a drawing opened directly is capped at 512 MiB, a DWG at 512 MiB with a 1 GiB DXF rendition, and the DXF reader reads up to 100 million group codes (raise it with CADCRAFT_MAX_DXF_TAGS) (crates/engine/src/cmd/file.rs, crates/dwg/src/lib.rs, crates/dxf/src/lib.rs).crates/dwg/src/proxy_transport.rs, crates/dwg/src/lib.rs, crates/io/src/dxf_raw.rs). DWG still drops xdata on table records and blocks, entity colour books and reactors; SAVE/SAVEAS report what the target cannot hold in a notSaved field. An OLE2FRAME's data and frame corners survive a DWG save; it moves and scales uniformly, and rotate, mirror or a non-uniform scale is refused.import; user .lin, .pat and .pgp files. SVG/SVGZ is read by open. Raster images are attached by IMAGEATTACH, not imported as geometry. Stored xref/data-link paths resolve through craft-docpath.cadcraft-cli convert; they return base64 data when no path is given. CLI image/PDF export always renders model space. Raster images appear in PNG output; PDF and SVG output draw only the image frame.engine.commands / cadcraft-cli commands return id, label, menu path, shortcut, aliases, parameter docs and enabled state. Headless/CLI catalog = the engine registry (457 at this tag); the desktop app adds 60 UI_COMMANDS entries (crates/ui-egui/src/menus.rs), so the app catalog is 517. Ids are AutoCAD command names lower-cased.cadcraft-cli mcp (headless) or cadcraft-cli mcp --connect 127.0.0.1:PORT [--lazy] [--launch]. 15 tools (unchanged at v0.20.1) — 12 headless, plus 3 only when connected: command_line, script, execute, list_commands, inspect_drawing, query_entities, render, find_text, new_drawing, open, save, cancel, and app-only screenshot, ui_inspect, ui_click (crates/mcp/src/tools.rs). render takes background (dark/white/paper/#rrggbb) and plot_style (a CTB/STB name, or none). Resources: cadcraft://drawing and cadcraft://commands (crates/mcp/src/server.rs).--control PORT; one JSON object per line over 127.0.0.1:PORT. Every request must carry "token": "<session token>" — the server starts with a fresh session token in an owner-only file, cadcraft-control-<port>.token, in $XDG_RUNTIME_DIR (else ~/.cache; %LOCALAPPDATA% on Windows), and logs its path at startup; the MCP bridge reads it automatically only when the connected peer is exactly 127.0.0.1:<port> (crates/mcp/src/control_token.rs, crates/mcp/src/backend.rs). The bridge (Unix) refuses a token file that is a symlink, not a plain file, or readable by other users; if neither a runtime dir nor HOME exists it refuses rather than using the shared temp dir. 27 top-level methods in the app, 12 in headless mode (unchanged at v0.20.1): cmdline.input/script/key/state, engine.execute (alias command), engine.commands, drawing.inspect, ui.inspect, ui.elements, ui.menu.list/invoke, ui.pointer, ui.click, ui.move, ui.drag, ui.key, ui.text, ui.set, ui.resize, ui.focus, ui.screenshot, ui.render (with window, background, plot_style), app.open/save/quit, control.methods, ping. Limits: 16 connections, 64 queued requests, 256 MiB per line, 512 MiB buffered across connections, 60 s reply timeout (state: not-run = safe to resend, may-have-run = inspect first), 10 min idle, 30 s blocked-write timeout; a client that gives up cancels a request the app has not started (apps/cadcraft/src/control_server.rs, crates/ui-egui/src/control.rs).cadcraft-cli (separate zip; arguments parsed with clap following RFC-0012): 8 verbs (unchanged at v0.20.1) — info, convert, run, commands, mcp, perf, sample, roundtrip — plus --version/--help.| Command | What it does |
|---|---|
info FILE |
Print drawing.inspect JSON (add --compact for one line). |
convert IN OUT |
Conversion or image export; OUT's extension picks the format (dxf, dwg, dwt, svg, png, pdf); PNG 2400×1600; model space only; --window x0,y0,x1,y1 or --view extents\|current; --in-place allows replacing an input. |
run [FILE…] [--sample] [--metric] [--script TEXT] [--script-file F.scr] [--cmd 'id {json}']… [--save OUT] [--export OUT] |
Headless edit session over one or more drawings (the last is current); staged writes; framing flags need an image export. |
commands [FILTER] |
JSON command catalog (--compact for one line). |
mcp [--connect HOST:PORT [--lazy] [--launch]] |
MCP server on stdio. |
perf [N \| FILE] |
Timing table (synthetic N entities, or a drawing). |
sample (bracket\|floorplan) OUT |
Built-in sample drawing in any writable format. |
roundtrip [FILE\|FOLDER] [--out DIR] [--keep-saved] [--same-format] [--no-census] [--tolerance T] |
Open → save → reopen and diff; writes a Markdown and a JSON report; FOLDER defaults to CADCRAFT_CORPUS_DIR; CADCRAFT_CORPUS_STRICT=1 makes any open/save/reopen failure or lost record fail the run. |
--cmd chaining: "{last}" becomes the last object handle an earlier --cmd returned.
window.cadcraft is installed by apps/cadcraft-web/src/api.rs over the app's control channel: request(method, params), execute(command, params), commands(), docInspect(params), uiInspect(params) and screenshot(params), each a promise that resolves with the control method's result or rejects with an Error carrying error; an existing window.cadcraft keeps its own functions. A page call that times out drops its pending reply, which cancels a request the app has not started (apps/cadcraft-web/src/api.rs, apps/cadcraft-web/Cargo.toml). The page API is web-only; the desktop build uses the control channel instead..scr via SCRIPT or run --script-file; AutoLISP via lisp / appload; .pgp via aliasedit/reinit; .lin/.pat loading; document.bytes {format, version, binary, portableFonts?} returns base64 without touching a file.drawing.inspect (+skipped{count,sections}, readNotes), entities, texts, shapes (with selfCheck), usage, loops, countlist/counttable/count, properties, list, dist, id, area, and image for attached rasters.cadcraft-cli-<ver>-macos-universal.zip by default — packaging/macos/package.sh), Windows x64/arm64/x86 MSI (Scope="perUserOrMachine" in packaging/windows/cadcraft.wxs; a fresh install from the 2026-11 launcher is machine-wide, an existing per-user install stays under the user profile), Linux x86_64/aarch64/riscv64 (AppImage, deb, rpm, tar and Flatpak; both Flatpak manifests now allow org.freedesktop.Flatpak for update checks), FreeBSD tar (x86_64; the aarch64 build has no DWG bridge, crates/dwg/build.rs). macOS file dialogs are sheets shown without blocking the window (the #1527 crash), one at a time, and the answer lands on the drawing that asked (apps/cadcraft/src/sheet.rs).?webgl, ?cpu, ?sample) and a page-host mode (?host=parent in an iframe, or data-host="page" on the canvas) where the host page opens drawings and receives saves as postMessage/DOM CustomEvents instead of downloads (apps/cadcraft-web/src/host.rs). No DWG, no autosave, saves are browser downloads without a host. The web build also exposes window.cadcraft (above), and ui.screenshot returns an inline PNG because there is no file system.LANGUAGES in crates/ui-egui/src/i18n.rs: English plus 18 translations; Georgian joined at v0.18.0 and the set is unchanged at v0.20.1); live switching via ui.language and CADCRAFT_LOCALE. docs/localization.md now lists all 19, including Vietnamese. CJK/Arabic/Hangul need an installed matching font; Georgian needs the craft-fonts Noto Sans Georgian face.hidapi target dependencies in apps/cadcraft/Cargo.toml); docs/gaps.md claims 2D pan/zoom through raw HID there, with no 3D navigation and no macOS/web support — claimed, not verified here.Read docs/gaps.md before promising anything; it is the maintained list and it is newer than ROADMAP.md. The checklist's menu breadth (298/491, 61 %) is the 2026-11-01 snapshot and was not regenerated. The high-impact limits for an agent:
readNotes after opening and the notSaved report on every DWG save. The DWG worker process has no memory limit of its own, so a crafted file can use a lot of memory before that one open or save dies (SECURITY.md known limits).cadcraft-cli roundtrip and cargo xtask corpus exist, but the corpus lives in a separate repo; docs/gaps.md still lists a black-box AutoCAD check as a gap, and its own note says all 88 in-repo file tests use synthetic data. Do not tell a user their CADCraft file is AutoCAD-clean.3DORBIT and SHARE are registered only to refuse, and ATTACH refuses PDF/DWF/DGN underlays while attaching PNG/JPEG/BMP/TIFF; DVIEW's 3D options (CAmera, TArget, Distance, POints, CLip, Hide) print "not available yet" — TWist, PAn, Zoom, Off and Undo work on 2D views. README's tagline says "2D and 3D"; the 3D half is not implemented.FONTALT/the stroke font and widths differ. No Options entry for the search path or font map, no desktop drag-and-drop of .shx, the big-font code page is guessed from the file name, vertical text is not justified along its column, and extended big-font box scaling is unverified against real files (docs/gaps.md FF8).-IMAGE options (detach, reload, unload, path), no IMAGECLIP, IMAGEADJUST or IMAGEFRAME, brightness/contrast not applied, images lie under all other objects on screen whatever their draw order, size is not taken from the file's resolution, and pixels are never stored in the drawing — move the drawing without its image files and the pictures are gone. No PDF import/underlays, no DWF/DGN/WMF/EPS/ACIS/STL exchange, no DWS standards, no system printers..ctb/.stb/.pc3/.pmp must be recreated in CADCraft's JSON formats..sv$ files, holds a lock per settings folder, shows a failure notice and offers recovery at the next start; a UI panic autosaves and writes a crash report. The web build has none of this, and a panic aborts there.find/textedit/xclip/imageattach are engine-level. The first three have UI entries (Cmd+F window, shortcut-menu Edit Text, Modify ▸ Clip ▸ Xref); IMAGEATTACH is JSON only (ATTACH takes the same JSON for an image path) — there is no attach dialog or menu row..dxf is broken (#158); open positionally or via File > Open..scr scripts, .pgp aliases, .lin linetypes and .pat patterns.README.md still says SHX fonts "aren't read yet" and advertises "2D and 3D"; docs/parity-checklist.md still says 449 commands; docs/file-format-parity.md still calls proxy/custom objects "not measured" and lists several unmodelled kinds as dropped by DWG save, although crates/dwg/src/proxy_transport.rs preserves registered proxies; the CLI's --view current help still says "extents plus a 10% margin" although crates/engine/src/session/files.rs opens on the saved view. The old docs/localization.md omission of Vietnamese is fixed.Launch (macOS). The GUI binary is the installed CADCraft.app's Contents/MacOS/CADCraft; launch with open -a "CADCraft". Start flags (verified with --help): --control <port> (also read from CADCRAFT_CONTROL_PORT), --sample, --version/-V/-h, and positional drawing paths; an unknown flag is a usage error (exit 2); --dwg-worker is internal (a copy of the binary started to read or write one DWG — never call it yourself). CADCraft's own MCP --launch runs open -a CADCraft --args --control PORT. The bundle contains no CLI binary — Contents/MacOS/ holds only CADCraft, so install cadcraft-cli from the CLI zip. CADCraft does not have to be running for cadcraft-cli or headless MCP.
Environment variables that matter: CADCRAFT_CONTROL_PORT, CADCRAFT_CONFIG_DIR (empty means no settings folder), CADCRAFT_LOCALE, CADCRAFT_SYSTEM_CURSOR=1, CADCRAFT_FONTALT/CADCRAFT_FONTFALLBACK, CADCRAFT_SHXPATH (SHX search path), CADCRAFT_MAX_DXF_TAGS (raise the DXF group-code limit), CADCRAFT_VSYNC, CADCRAFT_NO_NATIVE_MENU, CADCRAFT_WAYLAND=1, WGPU_BACKEND, RUST_LOG. CLI-only: CADCRAFT_CORPUS_DIR and CADCRAFT_CORPUS_STRICT=1 for roundtrip.
Settings/state (macOS). ~/Library/Application Support/CADCraft/ holds logs/cadcraft.log (rotated, 16 MiB cap), autosave/ (.sv$ DXF copies plus a per-instance .lock), support/ (AutoLISP startup files), crash-reports/, and workspace.json (panels, command line). The user profile — profile variables, ALIASEDIT aliases and the alias file, right-click settings, colours and interface scale — is the cadcraft.profile entry; the interface prefs, including keyboard shortcuts under shortcuts, are cadcraft.prefs. The control token file lives outside it (see the control-channel bullet).
Document model. One window, many drawings: each open drawing is a document with its own file tab and model/paper spaces; document.switch {index} switches, close {index}/closeall close them. Tool Sets, Layers, Properties and External References dock and float; QuickCalc opens as a floating palette (Cmd+8); layout tabs stay stable when Tool Sets toggle.
Keyboard shortcuts (from source — do not invent others). Engine .key() values and the built-in table (crates/ui-egui/src/menus.rs builtin_shortcuts): Cmd+N new, Cmd+O open, Cmd+S save, Cmd+Shift+S save as, Cmd+W close, Cmd+P plot, Cmd+Z/Cmd+Shift+Z undo/redo, Cmd+Y redo, Cmd+C/V/X clipboard, Cmd+Shift+C copy with base point, Cmd+Shift+V paste as block, Cmd+A select all, Cmd+Shift+A PICKSTYLE, Delete clear selection, F3 osnap, F5 (or Cmd+E) isoplane, F7 grid, F8 ortho, F9 snap, F10 polar, F11 object snap tracking, F12 dynamic input. UI-only: Cmd+1 Properties, Cmd+3 Tool Sets, Cmd+8 QuickCalc, Cmd+9 command line, Cmd+F Find and Replace, F1 command reference, F2 command history, Cmd+Q quit. Tools ▸ Customize ▸ Keyboard Shortcuts... edits the map: any command can take one, a user shortcut wins over the built-in one, conflicts are reassigned and reported, the clipboard keys/Delete/Cmd+Q are fixed, and the JSON form is engine.execute {"command":"ui.shortcuts","params":{"set":{"line":"Cmd+L"}}} (in the running app, desktop or web; not a headless session; reset clears the user map).
Right-click. While a command runs, a quick right-click is Enter and holding it (default 250 ms) opens the shortcut menu; Options ▸ User Preferences ▸ Right-Click Customization sets the hold time (100–2000 ms) and the Default/Edit/Command modes. Profile keys: rightClickDuration, rightClickDefault, rightClickEdit, rightClickCommand (values menu, repeat, enter, menuWithOptions).
Open/save/export flow. The Open dialog filters DWG/DXF/DWT and SVG/SVGZ; the Save dialog offers DXF, DWG, DWT, SVG, PNG, PDF. On macOS these dialogs are sheets: the answer arrives in a later frame, one dialog at a time (a second request is refused), and it applies to the drawing that asked (or is refused with a status message if that drawing was closed). QSAVE/SAVE writes the drawing's own format/version; SAVEAS {path, version?, binary?, portableFonts?} (portableFonts writes a Windows font for Linux families that have one and reports the styles still missing on Windows in nonPortableFonts); the macOS save panel cannot pick a version per file. document.bytes {format, version, binary, portableFonts?} returns base64 without touching a file. EXPORT writes dxf|dwg|svg|png|pdf; PLOT takes the format from the path extension and refuses an unknown one, and PNG/SVG hold a single sheet; EXPORTPDF always writes PDF; PUBLISH one PDF per sheet; PDFBOOK builds ISO A-series books from frame polylines. In the web build, saves are downloads unless a host page is attached.
Headless CLI (what an agent will use most).
cadcraft-cli info drawing.dxf # JSON summary: counts, extents, layers, styles, skipped, readNotes…
cadcraft-cli convert drawing.dxf out.svg # dxf|dwg|dwt|svg|png|pdf; PNG is 2400×1600
cadcraft-cli convert drawing.dwg detail.png --window 0,0,20000,15000 # frame a rectangle
cadcraft-cli run --sample --script 'CIRCLE 22,3 1\n' --save out.dxf --export out.png
cadcraft-cli run drawing.dxf --script-file setup.scr --save out.dxf
cadcraft-cli run drawing.dxf --cmd 'circle {"center":[10,10],"radius":4}' --cmd 'zoom {"mode":"extents"}' --export sel.png
cadcraft-cli run drawing.dxf --cmd 'imageattach {"path":"site.png","at":[0,0],"width":120}'
cadcraft-cli run drawing.dxf --cmd 'xclip {"handle":"2A","option":"new","rectangle":[[0,0],[100,80]]}'
cadcraft-cli commands dim # command catalog (JSON), filtered
cadcraft-cli sample floorplan out.dxf # built-in sample drawings
cadcraft-cli roundtrip drawings/ --out reports/ # open → save → reopen loss report
cadcraft-cli roundtrip drawings/ --same-format --keep-saved --tolerance 1e-6
cadcraft-cli mcp --connect 127.0.0.1:7979 # bridge MCP to the running app
Framing rules: convert fits model-space extents; run --export uses the current view only if a command changed it; --window x0,y0,x1,y1 shows exactly that rectangle. --view current follows the session view, and an opened drawing's view is the one stored in the file (when it has a usable $VIEWCTR/$VIEWSIZE), not the extents — the CLI's own help text still says "extents plus a 10% margin", which is stale. CLI PNG/SVG/PDF always render model space. The CLI installs the same raster decoder as the app, so IMAGEATTACH works headlessly.
Browser page API (web build).
await window.cadcraft.execute("circle", {center: [0, 0], radius: 5});
const catalog = await window.cadcraft.commands();
const drawing = await window.cadcraft.docInspect({});
const png = await window.cadcraft.screenshot({}); // inline pngBase64 on the web
await window.cadcraft.request("engine.execute", {command: "zoom", params: {mode: "extents"}});
Each call is a promise; a rejection carries the control channel's error. docInspect maps to document.inspect, uiInspect to ui.inspect, screenshot to ui.screenshot. The page API reaches the same app control methods as the desktop control channel, but only from the web page that hosts the drawing.
Command-first workflow. Anything the UI can do is a command: engine.execute {command, params} runs the JSON form with no dialogs; typing (cmdline.input) drives the interactive prompt machines exactly like a user. A refused command-line line still replies ok: true — check the error field. Errors inside a command never take the app down (panic guard); a panic in the interface itself autosaves every unsaved drawing and reports it. UI commands exist only in the app catalog; headless returns "unknown command" for them.
Legitimate and reliable:
cadcraft-cli for one-shot work and verification, MCP (headless or bridged) for interactive sessions, the control channel when a human is watching the same window, and window.cadcraft only in the browser build. Do not drive the GUI blindly; ui.screenshot needs a presented frame.cadcraft-control-<port>.token ($XDG_RUNTIME_DIR, else ~/.cache; %LOCALAPPDATA% on Windows) and send "token" in every request line, or use the MCP bridge which does it for you. Pass the bridge 127.0.0.1:PORT, not localhost:PORT: the bridge now sends the token only when the connected peer is exactly 127.0.0.1:<port>, because a localhost alias may resolve to ::1 where another local account could listen. Never assume a local connection is authorized, and do not fight the token-file checks (symlinks and group/world-readable files are refused by design).cadcraft-cli roundtrip FOLDER is the strongest tool: it opens, saves as DXF and DWG, reopens and lists every lost/added/changed entity, table record, header variable and opaque record, with --same-format for a single format and --keep-saved to inspect the files. Compare the report before and after your edits. For a DWG, also read readNotes/warnings: proxy-conversion failures are named there, not silently dropped.engine.execute per entity, or a .scr script / cadcraft-cli run --script-file, is far more reliable than pointer simulation. Read back with drawing.inspect/entities, texts, image, shapes, usage before purging, loops, and eyeball with render (with background/plot_style, so the PNG can look like the plot).convert turns DXF/DWG/SVG to DXF/DWG/DWT/SVG/PNG/PDF; SVG imports as paths/groups in millimetres, page top-left at the origin, Y up. Check info's JSON before assuming contents.{handle, text} works on TEXT, MTEXT, attribute definitions, dimension text and multileader text (a block-content multileader has none); a locked layer is refused. In the desktop app, TEXTEDIT/double-click on MTEXT opens the formatted in-place editor; text past the editor's caps (100,000 chars, 20,000 paragraphs, 1,000 codes) is refused there and falls back to the command line, so long text is not lost. An empty answer in the in-place editor keeps the existing text (the JSON form with an empty text writes an empty text).aliasedit {"file": "..."} replaces the user alias set (built-ins stay); use set/remove/clear for incremental changes, and reinit to re-read the last file. Aliases persist in the user profile on desktop/web but not in a headless run. ui.shortcuts {"set": {...}} is app-only (desktop or web, not headless) and stored with the preferences; a command that loses a key is returned in replaced..shx being beside the drawing or on CADCRAFT_SHXPATH; without it the text falls back and widths/extents change.CADCRAFT xdata app name and CADCRAFT_* dictionary entries. For damaged drawings use AUDIT/RECOVER; crash autosaves are .sv$ DXF files listed by DRAWINGRECOVERY, and a left-behind .sv$ plus its .lock file is the recovery candidate after a crash.open's warnings, drawing.inspect.skipped.count, readNotes, and the notSaved report (CLI prints it on stderr for .dwg/.dwt). Render to PNG and look at it. CLI writes are staged, so a failed write keeps the previous drawing.engine.commands/cadcraft-cli commands; ids are AutoCAD command names lower-cased. The app catalog's ui.* entries are not engine commands.gc!/dc! macro ids; unchanged); 60 UI-only commands (+ui.shortcuts; app catalog 517); 15 MCP tools (12 headless + 3 app-only, unchanged at v0.20.1); 27 control methods app / 12 headless (unchanged at v0.20.1); 8 CLI verbs (unchanged at v0.20.1); 19 interface languages (unchanged at v0.20.1); 23 built-in hatch patterns (unchanged at v0.20.1); 14 object snaps (unchanged at v0.20.1); 4 drawing formats read / 6 written plus 4 raster image formats (unchanged at v0.20.1). Re-derive with cadcraft-cli commands | jq length rather than trusting any number, including these.What an agent must NOT do:
readNotes/notSaved.docs/gaps.md first.CommandSpec, UI_COMMANDS and the CLI usage string exists. IMAGEATTACH has no dialog or menu row; it is a JSON command. A user shortcut is a user setting, not an app default..dwg bytes or expect a CADCraft-proprietary project format — there is none; the drawing is the DXF/DWG.ui.shortcuts) to a headless MCP/CLI session, or rely on screenshot without a presented frame. In the browser, screenshot is inline only; do not expect a file path.app.quit before saving: it quits without the unsaved-changes prompt.open, save, convert, run) when an agent needs a definite result.cadcraft-cli sample bracket scratch/t.dxf (or run --metric), draw, save to a scratch path, re-open, inspect, delete. Never test on the only copy of a real drawing.notSaved field / the stderr warning must be absent. After reading, drawing.inspect.skipped.count must be 0 for DXF, open's warnings must be empty for DWG/SVG, and readNotes must not name a proxy-conversion failure unless you accept that loss. A silent export is not a verified export.cadcraft-cli roundtrip FOLDER and read the report before and after your work. When the user has AutoCAD or another viewer, open the file there too — a systematic AutoCAD check is still outstanding (docs/gaps.md).await window.cadcraft.commands() returns the catalog, await window.cadcraft.docInspect({}) returns the drawing summary, and await window.cadcraft.screenshot({}) resolves with pngBase64; a rejected promise carries the control error. Remember the web build has no DWG and no autosave.v0.20.1, commit 7526dc62c14e71b3c8d46e73bbf1fa29ef506af1 ("Merge tested main for Flatpak update patch release", 2026-11-11), on 2026-11-12; the v0.18.0 ref (32238e83c2c8bf643994132883e94bc96961f649) was used for the delta and the count cross-checks. The installed GUI bundle /Applications/CADCraft.app is version 0.20.1, bundle id ai.storyteller.cadcraft, and its binary printed cadcraft 0.20.1 (7526dc62c14e71b3c8d46e73bbf1fa29ef506af1); its --help output is the start-flag list in How to operate. Contents/MacOS/ holds no CLI, and no cadcraft-cli is installed on this machine, so every count was derived from source. The launcher auto-updates, so verify against your installed version.README.md, ROADMAP.md, SECURITY.md, Cargo.toml, docs/{gaps,parity-checklist,target-app-parity,file-format-parity,control-protocol,mcp,cli,customization,localization,plotters,ui-parity}.md; apps/cadcraft/src/{main.rs,control_server.rs,env.rs,workspace.rs,sheet.rs}, apps/cadcraft-cli/src/{args.rs,lib.rs,roundtrip.rs}, apps/cadcraft-web/src/{main.rs,host.rs,api.rs}; crates/engine/src/cmd.rs and crates/engine/src/cmd/{blocks.rs,blocks/xclip.rs,image.rs,plotters.rs,utility.rs,props.rs,layout.rs,settings.rs,modify/trim.rs,modify/explode.rs,modify2/textedit.rs,view/dview.rs,draw.rs,draw2.rs,file/pgp.rs}, crates/engine/src/{snap.rs,pointmod.rs,autosave.rs,render_look.rs,lisp.rs,settings_dir.rs,mtext_edit.rs}; crates/io/src/{lib.rs,raster.rs,roundtrip.rs,dxf_clip.rs,dxf_raw.rs,pdf.rs}, crates/dwg/src/{lib.rs,worker.rs,proxy_transport.rs}, crates/dxf/src/lib.rs, crates/doc/src/{format.rs,library.rs,entity/layout.rs,xclip.rs,raster.rs}, crates/fonts/src/{shx/mod.rs,shx/table.rs,bidi.rs,mtext.rs}, crates/render/src/{raster.rs,linetype_text.rs}, crates/mcp/src/{tools.rs,server.rs,backend.rs,control_token.rs}, crates/ui-egui/src/{menus.rs,control.rs,i18n.rs,i18n/ka.tsv,finddlg.rs,textdlg.rs,fault.rs,autosave.rs,canvas/images.rs,keys.rs,aliasdlg.rs,options.rs,options/dialog.rs,context_menu.rs,mtext_editor.rs,palettes.rs}, xtask/src/{main.rs,parity.rs}, packaging/macos/package.sh, packaging/windows/cadcraft.wxs, packaging/linux/flatpak/ai.storyteller.cadcraft.yml, packaging/linux/flatpak/ai.storyteller.cadcraft.bundle.yml; tests crates/engine/tests/{panic_hunt.rs,it/mleader_text_edit.rs}, crates/io/src/tests.rs, crates/dxf/tests/hardening.rs, crates/io/tests/{registered_proxy.rs,hard_owned_objects_kept.rs}, crates/ui-egui/tests/{alias_persistence.rs,it/options_right_click.rs,it/shortcuts_checked.rs,flatpak_updates.rs}.storytold/craft-libs crates pinned at 92d392cff132eaf53e13afff77f38b5c11b73aa0 (chiefly craft-docpath, craft-pdf), plus craft-web-api/craft-web-host at fd5e2feff6ea25bed371a99cc732b3968d621505 and craft-update at 6e03f65bf45181db77ba6229716e6624db9eb25b (apps/cadcraft-web/Cargo.toml, Cargo.toml); the DWG bridge is acadrust 0.6.6 (MPL-2.0, unmodified). Consulted read-only at those pins, not vendored.--version and --help. Cross-check evidence.md for claim-by-claim tiering.