# The cad command

> Every command of the cad command line, generated from its own help: updates and the installation, the server, running and viewing, and each document type's and integration's operations.

`cad` is the command your agent runs, and you can run it yourself. The install command installs it as a uv tool (`uv tool install cad`) and puts its folder on your PATH. One text-to-cad server runs on your computer, which keeps its workers warm between calls.

`cad --help` lists every command, `cad <type> --help` a document type's operations, and `cad <command> --help` a command's options. This page is that help, generated from the same parser.

```text
cad <document_type> <operation> FILE [args...]
cad <integration> <operation> [FILE] [args...]
cad <command> [args...]
```

## Operations by document type

A document type is a kind of file text-to-cad builds, shows or checks. Each has the operations that make sense for it, with one pattern: `cad <document_type> <operation> <file>`. A `model` is a model the server holds, named by its id; every other type takes a file.

| Type | `export` | `snapshot` | `inspect` | `dfm` | `interference` | `solve` | `ranges` | `drc` | `erc` | `validate` |
| --- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| [`model`](https://www.texttocad.dev/docs/reference/cli#cad-model) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-model-export) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-model-snapshot) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-model-inspect) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-model-dfm) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-model-interference) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-model-solve) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-model-ranges) |   |   |   |
| [`xbf`](https://www.texttocad.dev/docs/reference/cli#cad-xbf) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-xbf-export) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-xbf-snapshot) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-xbf-inspect) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-xbf-dfm) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-xbf-interference) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-xbf-solve) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-xbf-ranges) |   |   |   |
| [`step`](https://www.texttocad.dev/docs/reference/cli#cad-step) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-step-export) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-step-snapshot) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-step-inspect) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-step-dfm) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-step-interference) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-step-solve) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-step-ranges) |   |   |   |
| [`stl`](https://www.texttocad.dev/docs/reference/cli#cad-stl) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-stl-export) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-stl-snapshot) |   | [✓](https://www.texttocad.dev/docs/reference/cli#cad-stl-dfm) |   |   |   |   |   |   |
| [`glb`](https://www.texttocad.dev/docs/reference/cli#cad-glb) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-glb-export) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-glb-snapshot) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-glb-inspect) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-glb-dfm) |   |   |   |   |   |   |
| [`threemf`](https://www.texttocad.dev/docs/reference/cli#cad-threemf) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-threemf-export) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-threemf-snapshot) |   | [✓](https://www.texttocad.dev/docs/reference/cli#cad-threemf-dfm) |   |   |   |   |   |   |
| [`dxf`](https://www.texttocad.dev/docs/reference/cli#cad-dxf) |   | [✓](https://www.texttocad.dev/docs/reference/cli#cad-dxf-snapshot) |   | [✓](https://www.texttocad.dev/docs/reference/cli#cad-dxf-dfm) |   |   |   |   |   |   |
| [`urdf`](https://www.texttocad.dev/docs/reference/cli#cad-urdf) |   | [✓](https://www.texttocad.dev/docs/reference/cli#cad-urdf-snapshot) |   |   |   |   |   |   |   | [✓](https://www.texttocad.dev/docs/reference/cli#cad-urdf-validate) |
| [`srdf`](https://www.texttocad.dev/docs/reference/cli#cad-srdf) |   | [✓](https://www.texttocad.dev/docs/reference/cli#cad-srdf-snapshot) |   |   |   |   |   |   |   | [✓](https://www.texttocad.dev/docs/reference/cli#cad-srdf-validate) |
| [`sdf`](https://www.texttocad.dev/docs/reference/cli#cad-sdf) |   | [✓](https://www.texttocad.dev/docs/reference/cli#cad-sdf-snapshot) |   |   |   |   |   |   |   | [✓](https://www.texttocad.dev/docs/reference/cli#cad-sdf-validate) |
| [`kicad_pcb`](https://www.texttocad.dev/docs/reference/cli#cad-kicad_pcb) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-kicad_pcb-export) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-kicad_pcb-snapshot) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-kicad_pcb-inspect) |   |   |   |   | [✓](https://www.texttocad.dev/docs/reference/cli#cad-kicad_pcb-drc) |   |   |
| [`kicad_sch`](https://www.texttocad.dev/docs/reference/cli#cad-kicad_sch) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-kicad_sch-export) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-kicad_sch-snapshot) | [✓](https://www.texttocad.dev/docs/reference/cli#cad-kicad_sch-inspect) |   |   |   |   |   | [✓](https://www.texttocad.dev/docs/reference/cli#cad-kicad_sch-erc) |   |

## Updates and the installation

`cad` installs every newer release of its major version by itself, and the install command installs and updates the plugin in your agent apps. [Install](https://www.texttocad.dev/docs/install) says what the install command does, app by app, and how to update and remove.

| Command | Description |
| --- | --- |
| [`cad update`](https://www.texttocad.dev/docs/reference/cli#cad-update) | Update cad now to the newest release of its major version (`--major`: of all); `update auto`: whether it does so itself. |
| [`cad update auto`](https://www.texttocad.dev/docs/reference/cli#cad-update-auto) | Show or change whether cad updates itself: status, on, off. |
| [`cad plugin`](https://www.texttocad.dev/docs/reference/cli#cad-plugin) | The plugin: `update` it now; `update auto`: whether cad's updates do. |
| [`cad plugin update`](https://www.texttocad.dev/docs/reference/cli#cad-plugin-update) | Run the install command, which installs or updates the plugin in every agent app it finds; `update auto` shows or changes whether cad's updates run it. |
| [`cad plugin update auto`](https://www.texttocad.dev/docs/reference/cli#cad-plugin-update-auto) | Show or change whether cad's updates run the install command. |
| [`cad doctor`](https://www.texttocad.dev/docs/reference/cli#cad-doctor) | Report this cad, its folders, its kernel and the server; it changes nothing. |
| [`cad cache`](https://www.texttocad.dev/docs/reference/cli#cad-cache) | cad's cache: dir, prune (what this release cannot use), clean (all of it). |
| [`cad cache dir`](https://www.texttocad.dev/docs/reference/cli#cad-cache-dir) | Print where cad's cache is. |
| [`cad cache prune`](https://www.texttocad.dev/docs/reference/cli#cad-cache-prune) | Remove what this release of cad cannot use. |
| [`cad cache clean`](https://www.texttocad.dev/docs/reference/cli#cad-cache-clean) | Remove all of cad's cache; cad makes it again as it needs it. |
| [`cad telemetry`](https://www.texttocad.dev/docs/reference/cli#cad-telemetry) | Show or change the usage stats and crash reports CAD sends: status, on, off. |

### `cad update`

cad installs every newer release of its major version by itself, and a new major version only when you run `cad update --major`. `cad update` updates cad now to the newest release of its major version, even with automatic updates off: cad asks PyPI and, once nothing is running, installs it. A cad server that was running starts again; with none running, none is started. `cad update auto` shows or changes whether cad updates itself.

```text
cad update [--major]
cad update auto [{status,on,off}]
```

| Argument | Description |
| --- | --- |
| `{auto} ...` | One of `auto`. |

| Option | Description |
| --- | --- |
| `--major` | Install the newest release of all, a new major version included, which may ask for changes (https://github.com/earthtojake/text-to-cad/tree/main/docs/migrations). |

#### `cad update auto`

Show or change whether cad updates itself to the newest release of its major version: once nothing has run for a minute, the cad server stops, installs it and starts again. A new major version never installs itself: `cad update --major` installs it. On by default, for a global install (`uv tool install cad`).

```text
cad update auto [{status,on,off}]
```

| Argument | Description |
| --- | --- |
| `{status,on,off}` | One of `status`, `on`, `off`. Optional. |

### `cad plugin`

The plugin in your agent apps: install or update it with the install command, or say whether cad's own updates run that command again.

```text
cad plugin {update} ...
```

| Argument | Description |
| --- | --- |
| `{update} ...` | One of `update`. |

#### `cad plugin update`

Run the install command (curl -fsSL https://texttocad.dev/install.sh \| sh; on Windows irm https://www.texttocad.dev/install.ps1 \| iex), which installs or updates the plugin in every agent app it finds. Its output and exit status are this command's.

```text
cad plugin update [auto [{status,on,off}]]
```

| Argument | Description |
| --- | --- |
| `{auto} ...` | One of `auto`. |

#### `cad plugin update auto`

Show or change whether cad runs the install command once each time it is newer than the release that command is up to date for, however it was updated, so the plugin stays as new as cad. Off by default; the install command turns it on.

```text
cad plugin update auto [{status,on,off}]
```

| Argument | Description |
| --- | --- |
| `{status,on,off}` | One of `status`, `on`, `off`. Optional. |

### `cad doctor`

Report this cad: its release, its data and cache folders and what `cad cache prune` would free, the CAD kernel environment and the integrations', and the server. It changes nothing. Exit 1 when the CAD kernel is installed and does not load.

```text
cad doctor [--check] [--json]
```

| Option | Description |
| --- | --- |
| `--check` | The same report. |
| `--json` | The report as one JSON document: each check's name, status (ok, info, warning, failed) and detail. |

### `cad cache`

cad's cache: what cad makes again when it needs it (environments, bytecode, meshes it derived). Never your documents or settings.

```text
cad cache {dir,prune,clean} ...
```

| Argument | Description |
| --- | --- |
| `{dir,prune,clean} ...` | One of `dir`, `prune`, `clean`. |

#### `cad cache dir`

Print where cad's cache is.

```text
cad cache dir
```

#### `cad cache prune`

Remove what this release of cad cannot use: environments made for other releases, and the release folders of 0.11.11 and earlier.

```text
cad cache prune
```

#### `cad cache clean`

Remove all of cad's cache, and what prune removes; cad makes it again as it needs it. Refused while the cad server runs.

```text
cad cache clean
```

### `cad telemetry`

Show or change the usage stats and crash reports cad sends from CAD's apps (the CAD app in an agent app, and the viewer) and its build daemon. By default, once a cad command has said so: a random install id, versions, the OS and agent app, counts of CAD tool calls, view activity, which of the viewer's tools and settings are used (never a value or a name), files shown by format, builds and snapshots, how they ended and how long they took, and where cad's own code failed (never a message). `off` sends nothing. Never file names, paths, contents or prompts.

```text
cad telemetry [{status,on,off}]
```

| Argument | Description |
| --- | --- |
| `{status,on,off}` | One of `status`, `on`, `off`. Optional. |

## The server

One server runs on your computer, and every command and the viewer go through it. `cad server start` starts it; in the Codex app, the plugin starts it (`cad mcp`).

| Command | Description |
| --- | --- |
| [`cad server`](https://www.texttocad.dev/docs/reference/cli#cad-server) | The cad server: start, stop, status. |
| [`cad server start`](https://www.texttocad.dev/docs/reference/cli#cad-server-start) | Start the cad server where it is not running. |
| [`cad server stop`](https://www.texttocad.dev/docs/reference/cli#cad-server-stop) | Stop the cad server. |
| [`cad server status`](https://www.texttocad.dev/docs/reference/cli#cad-server-status) | The cad server's workers, what each is building, and its served documents. |
| [`cad mcp`](https://www.texttocad.dev/docs/reference/cli#cad-mcp) | Serve the CAD app to the agent app that starts it, over MCP on stdin and stdout. |

### `cad server`

The cad server, which builds, keeps and serves your documents: start it, stop it, or say what it runs.

```text
cad server [--rotate-token] [--yes] {start,stop,status} ...
```

| Argument | Description |
| --- | --- |
| `{start,stop,status} ...` | One of `start`, `stop`, `status`. |

| Option | Description |
| --- | --- |
| `--rotate-token` | Replace the page token: every link and browser session made before stops working, in the server running too; asked first. |
| `-y`, `--yes` | With `--rotate-token`, replace the token without asking; where nobody can be asked (an agent, a pipe, `--json`) the command does nothing without it. |

#### `cad server start`

Start the cad server, detached, where it is not running: one of an older release is replaced (stopped first, its work cut short), and one of a newer release is joined, left running. Pages open on the server replaced are served on the same port by the one that starts.

```text
cad server start [--port PORT] [--foreground]
```

| Option | Description |
| --- | --- |
| `--port PORT` | The HTTP port the server takes, refused when another process holds it (else CAD_ENGINE_PORT, else 3245 or the port it rolled to); 0 takes any free port. |
| `--foreground` | Run it in this process, its log on this terminal, until it is stopped. |

#### `cad server stop`

Stop the cad server.

```text
cad server stop [--json]
```

| Option | Description |
| --- | --- |
| `--json` | What was stopped as JSON. |

#### `cad server status`

The cad server's workers, what each is building, and its served documents.

```text
cad server status [--json]
```

| Option | Description |
| --- | --- |
| `--json` | The server's answer as JSON. |

### `cad mcp`

Serve CAD to the agent app that started this process, over MCP on standard input and output: this release's cad server started first, as `cad server start` starts it, and every request passed on to it. The app starts it; there is nothing to configure.

```text
cad mcp
```

## Running and viewing

| Command | Description |
| --- | --- |
| [`cad run`](https://www.texttocad.dev/docs/reference/cli#cad-run) | Run a script (or -m, -c) as uv run does, cad pinned at this device's release with the integrations its imports use. |
| [`cad viewer`](https://www.texttocad.dev/docs/reference/cli#cad-viewer) | Open a viewer page on the running cad server. |
| [`cad delete`](https://www.texttocad.dev/docs/reference/cli#cad-delete) | Delete documents: record, cached document, the engine's copy. |

### `cad run`

Run a program as `uv run` does, with cad pinned at this device's release: a script's `# /// script` header names its own packages, and cad's integrations are worked out from its imports (a header naming `cad[...]` decides them); a command an integration declares (`kicad-cli`) gets that integration and runs headless. A script that imports bpy gets the blender integration, on Python 3.13, the one its tool is built for. The environment is made once, by the device's engine, and used again. uv run's options are taken as uv takes them.

```text
cad run [uv run's options] SCRIPT.py [ARGS...] | -m MODULE [ARGS...] | -c CODE [ARGS...] | COMMAND [ARGS...]
```

### `cad viewer`

Open the running server's viewer page: the home, or each file named (no server running: its one line, which says to run `cad server start`). The page is the engine's one page, whose explorer opens where it was last, else your home folder. Each FILE (an on-disk CAD file, a relative one read from this folder, or a document id the engine holds) is registered and printed as its page, `/<id>`.

```text
cad viewer [--host HOST] [--port PORT] [--json] [--no-open] [--dist DIST] [--api-only] [FILE ...]
```

| Argument | Description |
| --- | --- |
| `FILE` | A CAD file to open (or a document id the engine holds): its page is /\<id\>. Optional. Repeatable. |

| Option | Description |
| --- | --- |
| `--host HOST` | Pin the engine bind address; default loopback. |
| `--port PORT` | Pin this installation’s engine HTTP port. |
| `--json` | Print launch information without opening a browser. |
| `--no-open` | Print the URL without opening a browser. |
| `--dist DIST` | Built viewer client directory. |
| `--api-only` | Announce the engine for a Vite frontend, without its client build. |

### `cad delete`

delete documents: each one's record and its document in the engine's cache, and what the engine holds of it; never a file of yours

```text
cad delete [--dry-run] [--yes] [--json] DOC [DOC ...]
```

| Argument | Description |
| --- | --- |
| `DOC` | A document's id, a model's script (every document recorded of it), or a CAD file a page opened; your own files — a script, its declared files, an opened file — are never touched. Repeatable. |

| Option | Description |
| --- | --- |
| `--dry-run` | Say which documents would be deleted, and how many, and delete nothing. |
| `-y`, `--yes` | Delete them without asking; where nobody can be asked (an agent, a pipe, `--json`) the command does nothing without it. |
| `--json` | What was deleted (or would be) as JSON. |

## Document types

Each type's operations, as `cad <document_type> <operation>`. A file of another type is refused by name, and a check prints its findings, or with `--json` one JSON document.

### `cad model`

model: A model built from code and held in the engine's memory, with no file behind it: addressed by its document id (cad run SCRIPT.py prints it) or the handle its call returns.

```text
cad model <operation> ID [options]
```

In Python: [`cad.model`](https://www.texttocad.dev/docs/reference/library#cad.model).

#### `cad model export`

Write the document to other files, each kind by its suffix (.step, .glb, .stl, .3mf, .dxf, .xbf, .xml (MJCF, its meshes beside it), .urdf (its meshes beside it)); `--tolerance` and `--angle` mesh a .glb, an .stl or a .3mf finer.

```text
cad model export [--tolerance MM] [--angle DEG] [--zero STATE] [--json] SRC DST [DST ...]
```

In Python: [`cad.model.export`](https://www.texttocad.dev/docs/reference/library#cad.model.export).

| Argument | Description |
| --- | --- |
| `SRC` | A model's document id, which cad run SCRIPT.py prints: the document the engine holds of it, never built. |
| `DST` | .xbf (from a STEP), .step, .glb, .stl, .3mf, .dxf (of a planar document), .xml (MJCF, its meshes in assets/ beside it) or .urdf (its meshes in meshes/ beside it): the document as its code built it. Every one is checked, a DXF's drawing too, before any is written: a refused export writes none. Repeatable. |

| Option | Description |
| --- | --- |
| `--tolerance MM` | Mesh a .glb, an .stl or a .3mf to within this absolute tolerance, in mm (at least 0.001), where it is finer than the viewer's quarter per cent of a part: for a print whose fits are finer, or a picture whose curves are. Every destination is then a .glb, an .stl or a .3mf: export a .step or any other file in a command of its own. |
| `--angle DEG` | Mesh a .glb, an .stl or a .3mf to within this angular deflection, in degrees (1 to 28.5, the viewer's own): small radii drawn in more segments. Every destination is then a .glb, an .stl or a .3mf. |
| `--zero STATE` | Take an .xml (MJCF) or a .urdf at this mechanism state: every body posed there and each joint's value there its zero, its limits and the other states around it (as built without it). |
| `--json` | Print what was written as JSON, a robot description's with what it holds (robot). |

#### `cad model snapshot`

Draw it as the viewer does, into a PNG.

```text
cad model snapshot SRC OUT.png [options] | --job PACKET [SRC] [options]
```

In Python: [`cad.model.snapshot`](https://www.texttocad.dev/docs/reference/library#cad.model.snapshot).

| Argument | Description |
| --- | --- |
| `SRC` | A model's document id, which cad run SCRIPT.py prints: the document the engine holds of it, never built; with `--job`, drawn in place of every job's input. Optional. |
| `OUT.png` | The .png to write, or a folder (one that is there, or a path ending in a separator) to write \<SRC's stem\>\_\<UTC time\>.png into. Optional. |

| Option | Description |
| --- | --- |
| `--job PACKET` | A Quick Edit packet (the .snapshot.json the viewer writes), a job or a list of jobs, as JSON or a file of it: every picture its outputs name drawn, each job's view as it was — its camera, display, hidden and isolated parts, pose — with the packet's ink and dimensions, at its output settings (padding, tightFrame, transparent, background, renderScale, sizeProfile); the other flags override every job. |
| `--display DISPLAY` | A mode (solid, shaded, parts, xray, hidden-line, wireframe), exploded=AMOUNT (the parts moved apart, 0 to 1; with a mode: hidden-line,exploded=0.6), edges=CLASS (the edges of one class alone: feature, tangent or seam; edges=feature draws no line where faces meet smoothly or a face closes on itself), or the display JSON object (mode, grid, camera, clip, exploded, edges, hidden, isolated: part refs the picture leaves out, or alone draws), or a JSON file of it; a drawing takes none; a KiCad board a board mode (board, copper, assembly, placement) or {mode, side, poured, layers, active, others, zones, tracks, window: [x0, y0, x1, y1], the box of the board to frame, in its mm}; a KiCad schematic {sheet, border, title} (title: KiCad's title block, on unless false; border: the page's edge and frame). Every snapshot is drawn light. |
| `--grid` | Draw the measuring grid. |
| `--camera CAMERA` | A preset (iso, front, back, left, right, top, bottom), azimuth:elevation, a camera JSON object (its position, target and orthographicHalfHeight in the viewer's scene coordinates, as a Quick Edit packet carries them: a document's or a GLB's mm, a robot's m, a 3MF's unit), or authored: the view `--annotation`'s ink was drawn in, from its Quick Edit packet, exactly. |
| `--width WIDTH` | — |
| `--height HEIGHT` | — |
| `--size-profile` | One of `assembly`, `assembly-large`, `contact-sheet`, `diagnostic`, `labeled`, `presentation`, `presentation-large`, `simple`, `simple-square`. |
| `--preview` | The viewer's Preview in place of a display mode: the model lit in a studio, in its materials, on a floor with its shadow, in perspective (a job's: "preview": true). |
| `--pose POSE` | A configuration's name (a robot's SRDF group state), a configuration sequence at a time of it (walk\@0.6: where the viewer's playbar shows the mechanism then), or joint and coupling values as JSON ('{"elbow": 45}', '{"curl": 0.6}'; degrees, and a slide in the file's unit: a document's mm, a robot's m): the mechanism posed there; as built without it (a robot where the viewer opens it). |
| `--annotation FILE` | The viewer's annotation file, or the Quick Edit packet (.snapshot.json) that carries it: its ink drawn over the model, on the parts it was drawn on. |
| `--measurements FILE` | Measure's dimensions (a JSON list of {start, end, label, color}; the points in the viewer's scene coordinates, as `--camera`'s lengths), drawn over the model. |
| `--json` | Print what was drawn and its timings as JSON. |

#### `cad model inspect`

What the document holds, then its build closure; with a ref, what one element or part is and what made it.

```text
cad model inspect [--query {summary,structure,closure,geometry,build}] [--json] document [ref]
```

In Python: [`cad.model.inspect`](https://www.texttocad.dev/docs/reference/library#cad.model.inspect).

| Argument | Description |
| --- | --- |
| `document` | A model's document id, which cad run SCRIPT.py prints: the document the engine holds of it, never built. |
| `ref` | [FILE#\][OWNER/]ELEMENT or [FILE#]OWNER (cad.engine.refs): OWNER a part's or an assembly's label, or its occurrence path (hand/finger.2); ELEMENT an element name (f:..., e:..., v:...) or face N (edge, vertex). An element answers what the kernel measures of it, placed where its occurrence stands, and what made it; a part or an assembly its volume, mass and world bounds, a part its placement. Without it: what the document holds (its state, parts, bounds, volume, materials, joints, couplings, states, sequences, animations and declared files), then its build closure. Optional. |

| Option | Description |
| --- | --- |
| `--query` | Inspect a summary and the closure (the default without REF); the structure: the summary without its bounds, volume and masses, so nothing is measured, and the closure; the closure alone; geometry (requires REF); or build metadata. Never builds a model or meshes a part; a part's volume and box are measured once by the engine and kept for its geometry. One of `summary`, `structure`, `closure`, `geometry`, `build`. |
| `--json` | Without REF, the summary (or the structure) and the closure as one JSON object (a REF's answer is JSON). |

#### `cad model dfm`

Check a part for a manufacturing process: CNC machining, sheet metal, injection molding or 3D printing. Exit 0: OK. Exit 1: FAILED, a finding is an error (with `--strict`, a warning too). Exit 3: NOT CHECKED, something was not judged: never a pass. Exit 2: the command line's mistake.

```text
cad model dfm [--process {cnc,sheet,molding,printing}] [--material MATERIAL] [--axes AXES] [--turning] [--tools TOOLS] [--stock STOCK] [--thickness THICKNESS] [--k-factor FACTOR] [--bend-radius RADIUS] [--kerf KERF] [--sheet-size SIZE] [--pull PULL] [--wall-limit WALL_LIMIT] [--zero-tol TOL] [--cavities CAVITIES] [--technology {fdm,sls,sla,mjf,pbf}] [--build-volume VOLUME] [--angle-limit ANGLE_LIMIT] [--samples SAMPLES] [--layer-height HEIGHT] [--nozzle NOZZLE] [--printer PRINTER] [--candidates] [--strict] [--json] SOURCE
```

In Python: [`cad.model.dfm`](https://www.texttocad.dev/docs/reference/library#cad.model.dfm).

| Argument | Description |
| --- | --- |
| `SOURCE` | A model's document id the engine holds (cad run SCRIPT.py prints it), or the handle its call returns. |

| Option | Description |
| --- | --- |
| `--process` | Cnc, sheet, molding or printing; default, for a STEP, an xbf or a model, the process the parts declare (part.material = metals.aluminum(process=machined()): machined is cnc, molded molding, fdm, sls, mjf, slm and vat printing with technology fdm, sls, mjf, pbf and sla), when every part agrees. One of `cnc`, `sheet`, `molding`, `printing`. |
| `--material MATERIAL` | The part's material (aluminum, steel, stainless, abs, pc, nylon, ...): picks the material's limits; default the material the part declares (part.material = metals.aluminum()), when every part agrees. |
| `--axes AXES` | Cnc: the milling machine's axes, 3, 4 or 5; default 3. |
| `--turning` | Cnc: the part is turned on a lathe (its axis found), not milled. |
| `--tools TOOLS` | Cnc: the end mill diameters available, in mm, comma separated (3,6,10); default none: a corner is held to the smallest tool that can exist (0.05 mm across, cad's own floor) and to how deep a tool of its size reaches; a radius of 1.25 mm or more (a 2.5 mm end mill's) is recommended. |
| `--stock STOCK` | Cnc: the stock's size in mm (100x60x25); default the part's box. |
| `--thickness THICKNESS` | Sheet: the stock's thickness in mm; default measured. |
| `--k-factor FACTOR` | Sheet: the neutral axis's place in the thickness, for the flat pattern (the shop's bend table's); default a K-factor chart's, by the material and each bend's radius. |
| `--bend-radius RADIUS` | Sheet: the shop's inside bend radius in mm, compared with the part's. |
| `--kerf KERF` | Sheet: the cutting kerf in mm, for small features. |
| `--sheet-size SIZE` | Sheet: the shop's largest sheet in mm (1219x2438); default a standard 5 x 10 ft sheet (3048x1524), assumed. |
| `--pull PULL` | Molding: the pull direction, an axis (z, -y) or x,y,z components; default z. |
| `--wall-limit WALL_LIMIT` | Molding: faces at or above this many degrees from the pull are not walls; default 45. |
| `--zero-tol TOL` | Molding: draft under this many degrees is zero draft; default 0.05. |
| `--cavities CAVITIES` | Molding: cavities in the mold, for the clamp force; default 1. |
| `--technology` | Printing: fdm, sls, sla, mjf or pbf (metal powder bed); default fdm. One of `fdm`, `sls`, `sla`, `mjf`, `pbf`. |
| `--build-volume VOLUME` | Printing: the printer's build volume in mm (256x256x256); default a typical machine of the technology's, assumed. |
| `--angle-limit ANGLE_LIMIT` | Printing: down-facing faces under this many degrees from horizontal need support; default the technology's. |
| `--samples SAMPLES` | Printing: rays cast for the wall-thickness field on a mesh; default 2000. |
| `--layer-height HEIGHT` | Printing: the layer height in mm, for stair-stepping; default the technology's. |
| `--nozzle NOZZLE` | Printing: fdm's nozzle diameter in mm; default 0.4. |
| `--printer PRINTER` | Printing: a file of the printer's settings — a 3MF OrcaSlicer or Bambu Studio saved, or a complete machine preset JSON — for its build volume and nozzle; `--build-volume` and `--nozzle` win. |
| `--candidates` | Rank the candidates instead: molding the pulls (x, y, z and the part's principal axes), printing the orientations. |
| `--strict` | A warning fails the check too (exit 1): a gate that takes no recommendation broken. |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |

#### `cad model interference`

Which parts share volume, as built and at each pose asked (`--pose`: a mechanism state, a configuration sequence at a time, or joint values): a pair with air between its parts ruled out on their meshes, every other measured exactly on the parts' own solids, the fits named on purpose (`--fit` A B) listed apart, and each pair it could not measure said.

```text
cad model interference [--pose POSE] [--fit A B A B] [--min-volume MM3] [--json] ID
```

In Python: [`cad.model.interference`](https://www.texttocad.dev/docs/reference/library#cad.model.interference).

| Argument | Description |
| --- | --- |
| `ID` | The model's document id (cad run SCRIPT.py prints it). |

| Option | Description |
| --- | --- |
| `--pose POSE` | A pose to check at beside as built, as snapshot's `--pose` takes one: a mechanism state's name, a configuration sequence at a time of it (walk\@0.6), or joint and coupling values as JSON ('{"elbow": 45}'). Repeatable: the check takes the poses it is given, and chooses none. Repeatable. |
| `--fit A B A B` | Two parts meant to share volume (a press-fit pin, a bearing in its bore), each a ref or a glob: their overlap is listed as a fit and is no overlap to fix. Repeatable. Repeatable. |
| `--min-volume MM3` | A shared volume at or below this is none (default 0.001: the rounding along a face where two parts touch). |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |

#### `cad model solve`

A linear static stress study of a part or an assembly bonded where its parts touch.

```text
cad model solve [--study STUDY] [--out OUT] [--occurrence OCCURRENCE] [--deck] [--verbose] [--json] SOURCE
```

In Python: [`cad.model.solve`](https://www.texttocad.dev/docs/reference/library#cad.model.solve).

| Argument | Description |
| --- | --- |
| `SOURCE` | The part or the assembly: a .step or .xbf, or a model's document id the engine holds (cad model solve), or the handle its call returns. |

| Option | Description |
| --- | --- |
| `--study STUDY` | The study: a JSON file path, inline JSON, or (a library caller) a dict: the fixed faces, the loads (forces, pressures, gravity, acceleration), a material where the model has none, an assembly's parts and connections and the checks to judge. Without it, the setup. |
| `--out OUT` | The folder a solve writes its results into, made when missing; a study's alone. |
| `--occurrence OCCURRENCE` | The part whose faces the setup lists, by its name or ref, where the document holds several. |
| `--deck` | Also write ccx.inp, the input CalculiX solved (the finer solve's when there were two); a study's alone. |
| `--verbose` | Say every progress line and the timings on stderr. Without it a long solve still says how far it has got about every 10 s. |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |

#### `cad model ranges`

Each joint's stops, found from the geometry: where its parts first meet another part.

```text
cad model ranges [--step STEP] [--clearance CLEARANCE] [--joint JOINT] [--verbose] [--json] SOURCE
```

In Python: [`cad.model.ranges`](https://www.texttocad.dev/docs/reference/library#cad.model.ranges).

| Argument | Description |
| --- | --- |
| `SOURCE` | The document: a .step or .xbf, or a model's document id the engine holds (cad model ranges), or the handle its call returns. |

| Option | Description | Default |
| --- | --- | --- |
| `--step STEP` | The sweep's step: degrees for a turning joint, millimetres for a sliding one; default 1. | `1` |
| `--clearance CLEARANCE` | How near two parts' surfaces come before they count as touching, in millimetres; default 0.3, the least (where they all but touch): a larger one stops each joint where its parts first come that near. | `0.3` |
| `--joint JOINT` | Sweep this joint alone (repeat it for several); default every joint a person moves. A name the document has no such joint by is refused, naming its joints. Repeatable. |   |
| `--verbose` | Say on stderr each step as it starts (reading the document, sampling its surfaces, each joint) and each joint's stops as it ends (a joint or a sampling that takes long is said either way). |   |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |   |

### `cad xbf`

XBF: The engine's own document saved as a file: an XCAF document as BinXCAF, with its build closure. Files: `.xbf`.

```text
cad xbf <operation> FILE [options]
```

In Python: [`cad.xbf`](https://www.texttocad.dev/docs/reference/library#cad.xbf).

#### `cad xbf export`

Write the document to other files, each kind by its suffix (.step, .glb, .stl, .3mf, .dxf, .xbf, .xml (MJCF, its meshes beside it), .urdf (its meshes beside it)); `--tolerance` and `--angle` mesh a .glb, an .stl or a .3mf finer.

```text
cad xbf export [--tolerance MM] [--angle DEG] [--zero STATE] [--json] SRC DST [DST ...]
```

In Python: [`cad.xbf.export`](https://www.texttocad.dev/docs/reference/library#cad.xbf.export).

| Argument | Description |
| --- | --- |
| `SRC` | The .xbf file. |
| `DST` | .xbf (from a STEP), .step, .glb, .stl, .3mf, .dxf (of a planar document), .xml (MJCF, its meshes in assets/ beside it) or .urdf (its meshes in meshes/ beside it): the document as its code built it. Every one is checked, a DXF's drawing too, before any is written: a refused export writes none. Repeatable. |

| Option | Description |
| --- | --- |
| `--tolerance MM` | Mesh a .glb, an .stl or a .3mf to within this absolute tolerance, in mm (at least 0.001), where it is finer than the viewer's quarter per cent of a part: for a print whose fits are finer, or a picture whose curves are. Every destination is then a .glb, an .stl or a .3mf: export a .step or any other file in a command of its own. |
| `--angle DEG` | Mesh a .glb, an .stl or a .3mf to within this angular deflection, in degrees (1 to 28.5, the viewer's own): small radii drawn in more segments. Every destination is then a .glb, an .stl or a .3mf. |
| `--zero STATE` | Take an .xml (MJCF) or a .urdf at this mechanism state: every body posed there and each joint's value there its zero, its limits and the other states around it (as built without it). |
| `--json` | Print what was written as JSON, a robot description's with what it holds (robot). |

#### `cad xbf snapshot`

Draw it as the viewer does, into a PNG.

```text
cad xbf snapshot SRC OUT.png [options] | --job PACKET [SRC] [options]
```

In Python: [`cad.xbf.snapshot`](https://www.texttocad.dev/docs/reference/library#cad.xbf.snapshot).

| Argument | Description |
| --- | --- |
| `SRC` | The .xbf file; with `--job`, drawn in place of every job's input. Optional. |
| `OUT.png` | The .png to write, or a folder (one that is there, or a path ending in a separator) to write \<SRC's stem\>\_\<UTC time\>.png into. Optional. |

| Option | Description |
| --- | --- |
| `--job PACKET` | A Quick Edit packet (the .snapshot.json the viewer writes), a job or a list of jobs, as JSON or a file of it: every picture its outputs name drawn, each job's view as it was — its camera, display, hidden and isolated parts, pose — with the packet's ink and dimensions, at its output settings (padding, tightFrame, transparent, background, renderScale, sizeProfile); the other flags override every job. |
| `--display DISPLAY` | A mode (solid, shaded, parts, xray, hidden-line, wireframe), exploded=AMOUNT (the parts moved apart, 0 to 1; with a mode: hidden-line,exploded=0.6), edges=CLASS (the edges of one class alone: feature, tangent or seam; edges=feature draws no line where faces meet smoothly or a face closes on itself), or the display JSON object (mode, grid, camera, clip, exploded, edges, hidden, isolated: part refs the picture leaves out, or alone draws), or a JSON file of it; a drawing takes none; a KiCad board a board mode (board, copper, assembly, placement) or {mode, side, poured, layers, active, others, zones, tracks, window: [x0, y0, x1, y1], the box of the board to frame, in its mm}; a KiCad schematic {sheet, border, title} (title: KiCad's title block, on unless false; border: the page's edge and frame). Every snapshot is drawn light. |
| `--grid` | Draw the measuring grid. |
| `--camera CAMERA` | A preset (iso, front, back, left, right, top, bottom), azimuth:elevation, a camera JSON object (its position, target and orthographicHalfHeight in the viewer's scene coordinates, as a Quick Edit packet carries them: a document's or a GLB's mm, a robot's m, a 3MF's unit), or authored: the view `--annotation`'s ink was drawn in, from its Quick Edit packet, exactly. |
| `--width WIDTH` | — |
| `--height HEIGHT` | — |
| `--size-profile` | One of `assembly`, `assembly-large`, `contact-sheet`, `diagnostic`, `labeled`, `presentation`, `presentation-large`, `simple`, `simple-square`. |
| `--preview` | The viewer's Preview in place of a display mode: the model lit in a studio, in its materials, on a floor with its shadow, in perspective (a job's: "preview": true). |
| `--pose POSE` | A configuration's name (a robot's SRDF group state), a configuration sequence at a time of it (walk\@0.6: where the viewer's playbar shows the mechanism then), or joint and coupling values as JSON ('{"elbow": 45}', '{"curl": 0.6}'; degrees, and a slide in the file's unit: a document's mm, a robot's m): the mechanism posed there; as built without it (a robot where the viewer opens it). |
| `--annotation FILE` | The viewer's annotation file, or the Quick Edit packet (.snapshot.json) that carries it: its ink drawn over the model, on the parts it was drawn on. |
| `--measurements FILE` | Measure's dimensions (a JSON list of {start, end, label, color}; the points in the viewer's scene coordinates, as `--camera`'s lengths), drawn over the model. |
| `--json` | Print what was drawn and its timings as JSON. |

#### `cad xbf inspect`

What the document holds, then its build closure; with a ref, what one element or part is and what made it.

```text
cad xbf inspect [--query {summary,structure,closure,geometry,build}] [--json] document [ref]
```

In Python: [`cad.xbf.inspect`](https://www.texttocad.dev/docs/reference/library#cad.xbf.inspect).

| Argument | Description |
| --- | --- |
| `document` | The .xbf file. |
| `ref` | [FILE#\][OWNER/]ELEMENT or [FILE#]OWNER (cad.engine.refs): OWNER a part's or an assembly's label, or its occurrence path (hand/finger.2); ELEMENT an element name (f:..., e:..., v:...) or face N (edge, vertex). An element answers what the kernel measures of it, placed where its occurrence stands, and what made it; a part or an assembly its volume, mass and world bounds, a part its placement. Without it: what the document holds (its state, parts, bounds, volume, materials, joints, couplings, states, sequences, animations and declared files), then its build closure. Optional. |

| Option | Description |
| --- | --- |
| `--query` | Inspect a summary and the closure (the default without REF); the structure: the summary without its bounds, volume and masses, so nothing is measured, and the closure; the closure alone; geometry (requires REF); or build metadata. Never builds a model or meshes a part; a part's volume and box are measured once by the engine and kept for its geometry. One of `summary`, `structure`, `closure`, `geometry`, `build`. |
| `--json` | Without REF, the summary (or the structure) and the closure as one JSON object (a REF's answer is JSON). |

#### `cad xbf dfm`

Check a part for a manufacturing process: CNC machining, sheet metal, injection molding or 3D printing. Exit 0: OK. Exit 1: FAILED, a finding is an error (with `--strict`, a warning too). Exit 3: NOT CHECKED, something was not judged: never a pass. Exit 2: the command line's mistake.

```text
cad xbf dfm [--process {cnc,sheet,molding,printing}] [--material MATERIAL] [--axes AXES] [--turning] [--tools TOOLS] [--stock STOCK] [--thickness THICKNESS] [--k-factor FACTOR] [--bend-radius RADIUS] [--kerf KERF] [--sheet-size SIZE] [--pull PULL] [--wall-limit WALL_LIMIT] [--zero-tol TOL] [--cavities CAVITIES] [--technology {fdm,sls,sla,mjf,pbf}] [--build-volume VOLUME] [--angle-limit ANGLE_LIMIT] [--samples SAMPLES] [--layer-height HEIGHT] [--nozzle NOZZLE] [--printer PRINTER] [--candidates] [--strict] [--json] SOURCE
```

In Python: [`cad.xbf.dfm`](https://www.texttocad.dev/docs/reference/library#cad.xbf.dfm).

| Argument | Description |
| --- | --- |
| `SOURCE` | The .xbf file to check. |

| Option | Description |
| --- | --- |
| `--process` | Cnc, sheet, molding or printing; default, for a STEP, an xbf or a model, the process the parts declare (part.material = metals.aluminum(process=machined()): machined is cnc, molded molding, fdm, sls, mjf, slm and vat printing with technology fdm, sls, mjf, pbf and sla), when every part agrees. One of `cnc`, `sheet`, `molding`, `printing`. |
| `--material MATERIAL` | The part's material (aluminum, steel, stainless, abs, pc, nylon, ...): picks the material's limits; default the material the part declares (part.material = metals.aluminum()), when every part agrees. |
| `--axes AXES` | Cnc: the milling machine's axes, 3, 4 or 5; default 3. |
| `--turning` | Cnc: the part is turned on a lathe (its axis found), not milled. |
| `--tools TOOLS` | Cnc: the end mill diameters available, in mm, comma separated (3,6,10); default none: a corner is held to the smallest tool that can exist (0.05 mm across, cad's own floor) and to how deep a tool of its size reaches; a radius of 1.25 mm or more (a 2.5 mm end mill's) is recommended. |
| `--stock STOCK` | Cnc: the stock's size in mm (100x60x25); default the part's box. |
| `--thickness THICKNESS` | Sheet: the stock's thickness in mm; default measured. |
| `--k-factor FACTOR` | Sheet: the neutral axis's place in the thickness, for the flat pattern (the shop's bend table's); default a K-factor chart's, by the material and each bend's radius. |
| `--bend-radius RADIUS` | Sheet: the shop's inside bend radius in mm, compared with the part's. |
| `--kerf KERF` | Sheet: the cutting kerf in mm, for small features. |
| `--sheet-size SIZE` | Sheet: the shop's largest sheet in mm (1219x2438); default a standard 5 x 10 ft sheet (3048x1524), assumed. |
| `--pull PULL` | Molding: the pull direction, an axis (z, -y) or x,y,z components; default z. |
| `--wall-limit WALL_LIMIT` | Molding: faces at or above this many degrees from the pull are not walls; default 45. |
| `--zero-tol TOL` | Molding: draft under this many degrees is zero draft; default 0.05. |
| `--cavities CAVITIES` | Molding: cavities in the mold, for the clamp force; default 1. |
| `--technology` | Printing: fdm, sls, sla, mjf or pbf (metal powder bed); default fdm. One of `fdm`, `sls`, `sla`, `mjf`, `pbf`. |
| `--build-volume VOLUME` | Printing: the printer's build volume in mm (256x256x256); default a typical machine of the technology's, assumed. |
| `--angle-limit ANGLE_LIMIT` | Printing: down-facing faces under this many degrees from horizontal need support; default the technology's. |
| `--samples SAMPLES` | Printing: rays cast for the wall-thickness field on a mesh; default 2000. |
| `--layer-height HEIGHT` | Printing: the layer height in mm, for stair-stepping; default the technology's. |
| `--nozzle NOZZLE` | Printing: fdm's nozzle diameter in mm; default 0.4. |
| `--printer PRINTER` | Printing: a file of the printer's settings — a 3MF OrcaSlicer or Bambu Studio saved, or a complete machine preset JSON — for its build volume and nozzle; `--build-volume` and `--nozzle` win. |
| `--candidates` | Rank the candidates instead: molding the pulls (x, y, z and the part's principal axes), printing the orientations. |
| `--strict` | A warning fails the check too (exit 1): a gate that takes no recommendation broken. |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |

#### `cad xbf interference`

Which parts share volume, as built and at each pose asked (`--pose`: a mechanism state, a configuration sequence at a time, or joint values): a pair with air between its parts ruled out on their meshes, every other measured exactly on the parts' own solids, the fits named on purpose (`--fit` A B) listed apart, and each pair it could not measure said.

```text
cad xbf interference [--pose POSE] [--fit A B A B] [--min-volume MM3] [--json] FILE
```

In Python: [`cad.xbf.interference`](https://www.texttocad.dev/docs/reference/library#cad.xbf.interference).

| Argument | Description |
| --- | --- |
| `FILE` | The .xbf file. |

| Option | Description |
| --- | --- |
| `--pose POSE` | A pose to check at beside as built, as snapshot's `--pose` takes one: a mechanism state's name, a configuration sequence at a time of it (walk\@0.6), or joint and coupling values as JSON ('{"elbow": 45}'). Repeatable: the check takes the poses it is given, and chooses none. Repeatable. |
| `--fit A B A B` | Two parts meant to share volume (a press-fit pin, a bearing in its bore), each a ref or a glob: their overlap is listed as a fit and is no overlap to fix. Repeatable. Repeatable. |
| `--min-volume MM3` | A shared volume at or below this is none (default 0.001: the rounding along a face where two parts touch). |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |

#### `cad xbf solve`

A linear static stress study of a part or an assembly bonded where its parts touch.

```text
cad xbf solve [--study STUDY] [--out OUT] [--occurrence OCCURRENCE] [--deck] [--verbose] [--json] SOURCE
```

In Python: [`cad.xbf.solve`](https://www.texttocad.dev/docs/reference/library#cad.xbf.solve).

| Argument | Description |
| --- | --- |
| `SOURCE` | The part or the assembly: a .step or .xbf, or a model's document id the engine holds (cad model solve), or the handle its call returns. |

| Option | Description |
| --- | --- |
| `--study STUDY` | The study: a JSON file path, inline JSON, or (a library caller) a dict: the fixed faces, the loads (forces, pressures, gravity, acceleration), a material where the model has none, an assembly's parts and connections and the checks to judge. Without it, the setup. |
| `--out OUT` | The folder a solve writes its results into, made when missing; a study's alone. |
| `--occurrence OCCURRENCE` | The part whose faces the setup lists, by its name or ref, where the document holds several. |
| `--deck` | Also write ccx.inp, the input CalculiX solved (the finer solve's when there were two); a study's alone. |
| `--verbose` | Say every progress line and the timings on stderr. Without it a long solve still says how far it has got about every 10 s. |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |

#### `cad xbf ranges`

Each joint's stops, found from the geometry: where its parts first meet another part.

```text
cad xbf ranges [--step STEP] [--clearance CLEARANCE] [--joint JOINT] [--verbose] [--json] SOURCE
```

In Python: [`cad.xbf.ranges`](https://www.texttocad.dev/docs/reference/library#cad.xbf.ranges).

| Argument | Description |
| --- | --- |
| `SOURCE` | The document: a .step or .xbf, or a model's document id the engine holds (cad model ranges), or the handle its call returns. |

| Option | Description | Default |
| --- | --- | --- |
| `--step STEP` | The sweep's step: degrees for a turning joint, millimetres for a sliding one; default 1. | `1` |
| `--clearance CLEARANCE` | How near two parts' surfaces come before they count as touching, in millimetres; default 0.3, the least (where they all but touch): a larger one stops each joint where its parts first come that near. | `0.3` |
| `--joint JOINT` | Sweep this joint alone (repeat it for several); default every joint a person moves. A name the document has no such joint by is refused, naming its joints. Repeatable. |   |
| `--verbose` | Say on stderr each step as it starts (reading the document, sampling its surfaces, each joint) and each joint's stops as it ends (a joint or a sampling that takes long is said either way). |   |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |   |

### `cad step`

STEP: An ISO 10303 (AP242) exchange file of exact geometry. Files: `.step`, `.stp`.

```text
cad step <operation> FILE [options]
```

In Python: [`cad.step`](https://www.texttocad.dev/docs/reference/library#cad.step).

#### `cad step export`

Write the document to other files, each kind by its suffix (.step, .glb, .stl, .3mf, .dxf, .xbf, .xml (MJCF, its meshes beside it), .urdf (its meshes beside it)); `--tolerance` and `--angle` mesh a .glb, an .stl or a .3mf finer.

```text
cad step export [--tolerance MM] [--angle DEG] [--zero STATE] [--json] SRC DST [DST ...]
```

In Python: [`cad.step.export`](https://www.texttocad.dev/docs/reference/library#cad.step.export).

| Argument | Description |
| --- | --- |
| `SRC` | The .step or .stp file. |
| `DST` | .xbf (from a STEP), .step, .glb, .stl, .3mf, .dxf (of a planar document), .xml (MJCF, its meshes in assets/ beside it) or .urdf (its meshes in meshes/ beside it): the document as its code built it. Every one is checked, a DXF's drawing too, before any is written: a refused export writes none. Repeatable. |

| Option | Description |
| --- | --- |
| `--tolerance MM` | Mesh a .glb, an .stl or a .3mf to within this absolute tolerance, in mm (at least 0.001), where it is finer than the viewer's quarter per cent of a part: for a print whose fits are finer, or a picture whose curves are. Every destination is then a .glb, an .stl or a .3mf: export a .step or any other file in a command of its own. |
| `--angle DEG` | Mesh a .glb, an .stl or a .3mf to within this angular deflection, in degrees (1 to 28.5, the viewer's own): small radii drawn in more segments. Every destination is then a .glb, an .stl or a .3mf. |
| `--zero STATE` | Take an .xml (MJCF) or a .urdf at this mechanism state: every body posed there and each joint's value there its zero, its limits and the other states around it (as built without it). |
| `--json` | Print what was written as JSON, a robot description's with what it holds (robot). |

#### `cad step snapshot`

Draw it as the viewer does, into a PNG.

```text
cad step snapshot SRC OUT.png [options] | --job PACKET [SRC] [options]
```

In Python: [`cad.step.snapshot`](https://www.texttocad.dev/docs/reference/library#cad.step.snapshot).

| Argument | Description |
| --- | --- |
| `SRC` | The .step or .stp file; with `--job`, drawn in place of every job's input. Optional. |
| `OUT.png` | The .png to write, or a folder (one that is there, or a path ending in a separator) to write \<SRC's stem\>\_\<UTC time\>.png into. Optional. |

| Option | Description |
| --- | --- |
| `--job PACKET` | A Quick Edit packet (the .snapshot.json the viewer writes), a job or a list of jobs, as JSON or a file of it: every picture its outputs name drawn, each job's view as it was — its camera, display, hidden and isolated parts, pose — with the packet's ink and dimensions, at its output settings (padding, tightFrame, transparent, background, renderScale, sizeProfile); the other flags override every job. |
| `--display DISPLAY` | A mode (solid, shaded, parts, xray, hidden-line, wireframe), exploded=AMOUNT (the parts moved apart, 0 to 1; with a mode: hidden-line,exploded=0.6), edges=CLASS (the edges of one class alone: feature, tangent or seam; edges=feature draws no line where faces meet smoothly or a face closes on itself), or the display JSON object (mode, grid, camera, clip, exploded, edges, hidden, isolated: part refs the picture leaves out, or alone draws), or a JSON file of it; a drawing takes none; a KiCad board a board mode (board, copper, assembly, placement) or {mode, side, poured, layers, active, others, zones, tracks, window: [x0, y0, x1, y1], the box of the board to frame, in its mm}; a KiCad schematic {sheet, border, title} (title: KiCad's title block, on unless false; border: the page's edge and frame). Every snapshot is drawn light. |
| `--grid` | Draw the measuring grid. |
| `--camera CAMERA` | A preset (iso, front, back, left, right, top, bottom), azimuth:elevation, a camera JSON object (its position, target and orthographicHalfHeight in the viewer's scene coordinates, as a Quick Edit packet carries them: a document's or a GLB's mm, a robot's m, a 3MF's unit), or authored: the view `--annotation`'s ink was drawn in, from its Quick Edit packet, exactly. |
| `--width WIDTH` | — |
| `--height HEIGHT` | — |
| `--size-profile` | One of `assembly`, `assembly-large`, `contact-sheet`, `diagnostic`, `labeled`, `presentation`, `presentation-large`, `simple`, `simple-square`. |
| `--preview` | The viewer's Preview in place of a display mode: the model lit in a studio, in its materials, on a floor with its shadow, in perspective (a job's: "preview": true). |
| `--pose POSE` | A configuration's name (a robot's SRDF group state), a configuration sequence at a time of it (walk\@0.6: where the viewer's playbar shows the mechanism then), or joint and coupling values as JSON ('{"elbow": 45}', '{"curl": 0.6}'; degrees, and a slide in the file's unit: a document's mm, a robot's m): the mechanism posed there; as built without it (a robot where the viewer opens it). |
| `--annotation FILE` | The viewer's annotation file, or the Quick Edit packet (.snapshot.json) that carries it: its ink drawn over the model, on the parts it was drawn on. |
| `--measurements FILE` | Measure's dimensions (a JSON list of {start, end, label, color}; the points in the viewer's scene coordinates, as `--camera`'s lengths), drawn over the model. |
| `--json` | Print what was drawn and its timings as JSON. |

#### `cad step inspect`

What the document holds, then its build closure; with a ref, what one element or part is and what made it.

```text
cad step inspect [--query {summary,structure,closure,geometry,build}] [--json] document [ref]
```

In Python: [`cad.step.inspect`](https://www.texttocad.dev/docs/reference/library#cad.step.inspect).

| Argument | Description |
| --- | --- |
| `document` | The .step or .stp file. |
| `ref` | [FILE#\][OWNER/]ELEMENT or [FILE#]OWNER (cad.engine.refs): OWNER a part's or an assembly's label, or its occurrence path (hand/finger.2); ELEMENT an element name (f:..., e:..., v:...) or face N (edge, vertex). An element answers what the kernel measures of it, placed where its occurrence stands, and what made it; a part or an assembly its volume, mass and world bounds, a part its placement. Without it: what the document holds (its state, parts, bounds, volume, materials, joints, couplings, states, sequences, animations and declared files), then its build closure. Optional. |

| Option | Description |
| --- | --- |
| `--query` | Inspect a summary and the closure (the default without REF); the structure: the summary without its bounds, volume and masses, so nothing is measured, and the closure; the closure alone; geometry (requires REF); or build metadata. Never builds a model or meshes a part; a part's volume and box are measured once by the engine and kept for its geometry. One of `summary`, `structure`, `closure`, `geometry`, `build`. |
| `--json` | Without REF, the summary (or the structure) and the closure as one JSON object (a REF's answer is JSON). |

#### `cad step dfm`

Check a part for a manufacturing process: CNC machining, sheet metal, injection molding or 3D printing. Exit 0: OK. Exit 1: FAILED, a finding is an error (with `--strict`, a warning too). Exit 3: NOT CHECKED, something was not judged: never a pass. Exit 2: the command line's mistake.

```text
cad step dfm [--process {cnc,sheet,molding,printing}] [--material MATERIAL] [--axes AXES] [--turning] [--tools TOOLS] [--stock STOCK] [--thickness THICKNESS] [--k-factor FACTOR] [--bend-radius RADIUS] [--kerf KERF] [--sheet-size SIZE] [--pull PULL] [--wall-limit WALL_LIMIT] [--zero-tol TOL] [--cavities CAVITIES] [--technology {fdm,sls,sla,mjf,pbf}] [--build-volume VOLUME] [--angle-limit ANGLE_LIMIT] [--samples SAMPLES] [--layer-height HEIGHT] [--nozzle NOZZLE] [--printer PRINTER] [--candidates] [--strict] [--json] SOURCE
```

In Python: [`cad.step.dfm`](https://www.texttocad.dev/docs/reference/library#cad.step.dfm).

| Argument | Description |
| --- | --- |
| `SOURCE` | The .step or .stp file to check. |

| Option | Description |
| --- | --- |
| `--process` | Cnc, sheet, molding or printing; default, for a STEP, an xbf or a model, none: a STEP keeps no process. One of `cnc`, `sheet`, `molding`, `printing`. |
| `--material MATERIAL` | The part's material (aluminum, steel, stainless, abs, pc, nylon, ...): picks the material's limits; default the material the part declares (part.material = metals.aluminum()), when every part agrees. |
| `--axes AXES` | Cnc: the milling machine's axes, 3, 4 or 5; default 3. |
| `--turning` | Cnc: the part is turned on a lathe (its axis found), not milled. |
| `--tools TOOLS` | Cnc: the end mill diameters available, in mm, comma separated (3,6,10); default none: a corner is held to the smallest tool that can exist (0.05 mm across, cad's own floor) and to how deep a tool of its size reaches; a radius of 1.25 mm or more (a 2.5 mm end mill's) is recommended. |
| `--stock STOCK` | Cnc: the stock's size in mm (100x60x25); default the part's box. |
| `--thickness THICKNESS` | Sheet: the stock's thickness in mm; default measured. |
| `--k-factor FACTOR` | Sheet: the neutral axis's place in the thickness, for the flat pattern (the shop's bend table's); default a K-factor chart's, by the material and each bend's radius. |
| `--bend-radius RADIUS` | Sheet: the shop's inside bend radius in mm, compared with the part's. |
| `--kerf KERF` | Sheet: the cutting kerf in mm, for small features. |
| `--sheet-size SIZE` | Sheet: the shop's largest sheet in mm (1219x2438); default a standard 5 x 10 ft sheet (3048x1524), assumed. |
| `--pull PULL` | Molding: the pull direction, an axis (z, -y) or x,y,z components; default z. |
| `--wall-limit WALL_LIMIT` | Molding: faces at or above this many degrees from the pull are not walls; default 45. |
| `--zero-tol TOL` | Molding: draft under this many degrees is zero draft; default 0.05. |
| `--cavities CAVITIES` | Molding: cavities in the mold, for the clamp force; default 1. |
| `--technology` | Printing: fdm, sls, sla, mjf or pbf (metal powder bed); default fdm. One of `fdm`, `sls`, `sla`, `mjf`, `pbf`. |
| `--build-volume VOLUME` | Printing: the printer's build volume in mm (256x256x256); default a typical machine of the technology's, assumed. |
| `--angle-limit ANGLE_LIMIT` | Printing: down-facing faces under this many degrees from horizontal need support; default the technology's. |
| `--samples SAMPLES` | Printing: rays cast for the wall-thickness field on a mesh; default 2000. |
| `--layer-height HEIGHT` | Printing: the layer height in mm, for stair-stepping; default the technology's. |
| `--nozzle NOZZLE` | Printing: fdm's nozzle diameter in mm; default 0.4. |
| `--printer PRINTER` | Printing: a file of the printer's settings — a 3MF OrcaSlicer or Bambu Studio saved, or a complete machine preset JSON — for its build volume and nozzle; `--build-volume` and `--nozzle` win. |
| `--candidates` | Rank the candidates instead: molding the pulls (x, y, z and the part's principal axes), printing the orientations. |
| `--strict` | A warning fails the check too (exit 1): a gate that takes no recommendation broken. |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |

#### `cad step interference`

Which parts share volume, as built and at each pose asked (`--pose`: a mechanism state, a configuration sequence at a time, or joint values): a pair with air between its parts ruled out on their meshes, every other measured exactly on the parts' own solids, the fits named on purpose (`--fit` A B) listed apart, and each pair it could not measure said.

```text
cad step interference [--pose POSE] [--fit A B A B] [--min-volume MM3] [--json] FILE
```

In Python: [`cad.step.interference`](https://www.texttocad.dev/docs/reference/library#cad.step.interference).

| Argument | Description |
| --- | --- |
| `FILE` | The .step file. |

| Option | Description |
| --- | --- |
| `--pose POSE` | A pose to check at beside as built, as snapshot's `--pose` takes one: a mechanism state's name, a configuration sequence at a time of it (walk\@0.6), or joint and coupling values as JSON ('{"elbow": 45}'). Repeatable: the check takes the poses it is given, and chooses none. Repeatable. |
| `--fit A B A B` | Two parts meant to share volume (a press-fit pin, a bearing in its bore), each a ref or a glob: their overlap is listed as a fit and is no overlap to fix. Repeatable. Repeatable. |
| `--min-volume MM3` | A shared volume at or below this is none (default 0.001: the rounding along a face where two parts touch). |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |

#### `cad step solve`

A linear static stress study of a part or an assembly bonded where its parts touch.

```text
cad step solve [--study STUDY] [--out OUT] [--occurrence OCCURRENCE] [--deck] [--verbose] [--json] SOURCE
```

In Python: [`cad.step.solve`](https://www.texttocad.dev/docs/reference/library#cad.step.solve).

| Argument | Description |
| --- | --- |
| `SOURCE` | The part or the assembly: a .step or .xbf, or a model's document id the engine holds (cad model solve), or the handle its call returns. |

| Option | Description |
| --- | --- |
| `--study STUDY` | The study: a JSON file path, inline JSON, or (a library caller) a dict: the fixed faces, the loads (forces, pressures, gravity, acceleration), a material where the model has none, an assembly's parts and connections and the checks to judge. Without it, the setup. |
| `--out OUT` | The folder a solve writes its results into, made when missing; a study's alone. |
| `--occurrence OCCURRENCE` | The part whose faces the setup lists, by its name or ref, where the document holds several. |
| `--deck` | Also write ccx.inp, the input CalculiX solved (the finer solve's when there were two); a study's alone. |
| `--verbose` | Say every progress line and the timings on stderr. Without it a long solve still says how far it has got about every 10 s. |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |

#### `cad step ranges`

Each joint's stops, found from the geometry: where its parts first meet another part.

```text
cad step ranges [--step STEP] [--clearance CLEARANCE] [--joint JOINT] [--verbose] [--json] SOURCE
```

In Python: [`cad.step.ranges`](https://www.texttocad.dev/docs/reference/library#cad.step.ranges).

| Argument | Description |
| --- | --- |
| `SOURCE` | The document: a .step or .xbf, or a model's document id the engine holds (cad model ranges), or the handle its call returns. |

| Option | Description | Default |
| --- | --- | --- |
| `--step STEP` | The sweep's step: degrees for a turning joint, millimetres for a sliding one; default 1. | `1` |
| `--clearance CLEARANCE` | How near two parts' surfaces come before they count as touching, in millimetres; default 0.3, the least (where they all but touch): a larger one stops each joint where its parts first come that near. | `0.3` |
| `--joint JOINT` | Sweep this joint alone (repeat it for several); default every joint a person moves. A name the document has no such joint by is refused, naming its joints. Repeatable. |   |
| `--verbose` | Say on stderr each step as it starts (reading the document, sampling its surfaces, each joint) and each joint's stops as it ends (a joint or a sampling that takes long is said either way). |   |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |   |

### `cad stl`

STL: A binary STL of one triangle mesh. Files: `.stl`.

```text
cad stl <operation> FILE [options]
```

In Python: [`cad.stl`](https://www.texttocad.dev/docs/reference/library#cad.stl).

#### `cad stl export`

Write the mesh to the other mesh kinds (.glb, .stl, .3mf).

```text
cad stl export [--json] SRC DST [DST ...]
```

In Python: [`cad.stl.export`](https://www.texttocad.dev/docs/reference/library#cad.stl.export).

| Argument | Description |
| --- | --- |
| `SRC` | The .stl file. |
| `DST` | The other mesh kinds (.glb, .stl, .3mf), each holding what its format carries. Repeatable. |

| Option | Description |
| --- | --- |
| `--json` | Print what was written as JSON. |

#### `cad stl snapshot`

Draw it as the viewer does, into a PNG.

```text
cad stl snapshot SRC OUT.png [options] | --job PACKET [SRC] [options]
```

In Python: [`cad.stl.snapshot`](https://www.texttocad.dev/docs/reference/library#cad.stl.snapshot).

| Argument | Description |
| --- | --- |
| `SRC` | The .stl file; with `--job`, drawn in place of every job's input. Optional. |
| `OUT.png` | The .png to write, or a folder (one that is there, or a path ending in a separator) to write \<SRC's stem\>\_\<UTC time\>.png into. Optional. |

| Option | Description |
| --- | --- |
| `--job PACKET` | A Quick Edit packet (the .snapshot.json the viewer writes), a job or a list of jobs, as JSON or a file of it: every picture its outputs name drawn, each job's view as it was — its camera, display, hidden and isolated parts, pose — with the packet's ink and dimensions, at its output settings (padding, tightFrame, transparent, background, renderScale, sizeProfile); the other flags override every job. |
| `--display DISPLAY` | A mode (solid, shaded, parts, xray, hidden-line, wireframe), exploded=AMOUNT (the parts moved apart, 0 to 1; with a mode: hidden-line,exploded=0.6), edges=CLASS (the edges of one class alone: feature, tangent or seam; edges=feature draws no line where faces meet smoothly or a face closes on itself), or the display JSON object (mode, grid, camera, clip, exploded, edges, hidden, isolated: part refs the picture leaves out, or alone draws), or a JSON file of it; a drawing takes none; a KiCad board a board mode (board, copper, assembly, placement) or {mode, side, poured, layers, active, others, zones, tracks, window: [x0, y0, x1, y1], the box of the board to frame, in its mm}; a KiCad schematic {sheet, border, title} (title: KiCad's title block, on unless false; border: the page's edge and frame). Every snapshot is drawn light. |
| `--grid` | Draw the measuring grid. |
| `--camera CAMERA` | A preset (iso, front, back, left, right, top, bottom), azimuth:elevation, a camera JSON object (its position, target and orthographicHalfHeight in the viewer's scene coordinates, as a Quick Edit packet carries them: a document's or a GLB's mm, a robot's m, a 3MF's unit), or authored: the view `--annotation`'s ink was drawn in, from its Quick Edit packet, exactly. |
| `--width WIDTH` | — |
| `--height HEIGHT` | — |
| `--size-profile` | One of `assembly`, `assembly-large`, `contact-sheet`, `diagnostic`, `labeled`, `presentation`, `presentation-large`, `simple`, `simple-square`. |
| `--preview` | The viewer's Preview in place of a display mode: the model lit in a studio, in its materials, on a floor with its shadow, in perspective (a job's: "preview": true). |
| `--pose POSE` | A configuration's name (a robot's SRDF group state), a configuration sequence at a time of it (walk\@0.6: where the viewer's playbar shows the mechanism then), or joint and coupling values as JSON ('{"elbow": 45}', '{"curl": 0.6}'; degrees, and a slide in the file's unit: a document's mm, a robot's m): the mechanism posed there; as built without it (a robot where the viewer opens it). |
| `--annotation FILE` | The viewer's annotation file, or the Quick Edit packet (.snapshot.json) that carries it: its ink drawn over the model, on the parts it was drawn on. |
| `--measurements FILE` | Measure's dimensions (a JSON list of {start, end, label, color}; the points in the viewer's scene coordinates, as `--camera`'s lengths), drawn over the model. |
| `--json` | Print what was drawn and its timings as JSON. |

#### `cad stl dfm`

Check a mesh for 3D printing. Exit 0: OK. Exit 1: FAILED, a finding is an error (with `--strict`, a warning too). Exit 3: NOT CHECKED, something was not judged: never a pass. Exit 2: the command line's mistake.

```text
cad stl dfm [--process {cnc,sheet,molding,printing}] [--material MATERIAL] [--units {mm,cm,m,in,ft}] [--technology {fdm,sls,sla,mjf,pbf}] [--build-volume VOLUME] [--angle-limit LIMIT] [--samples SAMPLES] [--layer-height HEIGHT] [--nozzle NOZZLE] [--printer PRINTER] [--candidates] [--strict] [--json] SOURCE
```

In Python: [`cad.stl.dfm`](https://www.texttocad.dev/docs/reference/library#cad.stl.dfm).

| Argument | Description |
| --- | --- |
| `SOURCE` | The .stl file to check. |

| Option | Description | Default |
| --- | --- | --- |
| `--process` | Printing, the one process a mesh is checked for (the default); cnc, sheet and molding are judged on exact geometry: check the part's STEP or model for them. One of `cnc`, `sheet`, `molding`, `printing`. | `printing` |
| `--material MATERIAL` | The part's material (aluminum, steel, stainless, abs, pc, nylon, ...): picks the material's limits; default the material the part declares (part.material = metals.aluminum()), when every part agrees. |   |
| `--units` | The file's length units (mm, cm, m, in, ft): an STL's (default mm), or a DXF's (default the ones it declares; needed where it declares none, as an R12 file). One of `mm`, `cm`, `m`, `in`, `ft`. |   |
| `--technology` | Printing: fdm, sls, sla, mjf or pbf (metal powder bed); default fdm. One of `fdm`, `sls`, `sla`, `mjf`, `pbf`. |   |
| `--build-volume VOLUME` | Printing: the printer's build volume in mm (256x256x256); default a typical machine of the technology's, assumed. |   |
| `--angle-limit LIMIT` | Printing: down-facing faces under this many degrees from horizontal need support; default the technology's. |   |
| `--samples SAMPLES` | Printing: rays cast for the wall-thickness field on a mesh; default 2000. |   |
| `--layer-height HEIGHT` | Printing: the layer height in mm, for stair-stepping; default the technology's. |   |
| `--nozzle NOZZLE` | Printing: fdm's nozzle diameter in mm; default 0.4. |   |
| `--printer PRINTER` | Printing: a file of the printer's settings — a 3MF OrcaSlicer or Bambu Studio saved, or a complete machine preset JSON — for its build volume and nozzle; `--build-volume` and `--nozzle` win. |   |
| `--candidates` | Rank the candidates instead: printing the orientations. |   |
| `--strict` | A warning fails the check too (exit 1): a gate that takes no recommendation broken. |   |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |   |

### `cad glb`

GLB: A binary glTF scene of triangle meshes. Files: `.glb`.

```text
cad glb <operation> FILE [options]
```

In Python: [`cad.glb`](https://www.texttocad.dev/docs/reference/library#cad.glb).

#### `cad glb export`

Write the mesh to the other mesh kinds (.glb, .stl, .3mf).

```text
cad glb export [--json] SRC DST [DST ...]
```

In Python: [`cad.glb.export`](https://www.texttocad.dev/docs/reference/library#cad.glb.export).

| Argument | Description |
| --- | --- |
| `SRC` | The .glb file. |
| `DST` | The other mesh kinds (.glb, .stl, .3mf), each holding what its format carries. Repeatable. |

| Option | Description |
| --- | --- |
| `--json` | Print what was written as JSON. |

#### `cad glb snapshot`

Draw it as the viewer does, into a PNG.

```text
cad glb snapshot SRC OUT.png [options] | --job PACKET [SRC] [options]
```

In Python: [`cad.glb.snapshot`](https://www.texttocad.dev/docs/reference/library#cad.glb.snapshot).

| Argument | Description |
| --- | --- |
| `SRC` | The .glb file; with `--job`, drawn in place of every job's input. Optional. |
| `OUT.png` | The .png to write, or a folder (one that is there, or a path ending in a separator) to write \<SRC's stem\>\_\<UTC time\>.png into. Optional. |

| Option | Description |
| --- | --- |
| `--job PACKET` | A Quick Edit packet (the .snapshot.json the viewer writes), a job or a list of jobs, as JSON or a file of it: every picture its outputs name drawn, each job's view as it was — its camera, display, hidden and isolated parts, pose — with the packet's ink and dimensions, at its output settings (padding, tightFrame, transparent, background, renderScale, sizeProfile); the other flags override every job. |
| `--display DISPLAY` | A mode (solid, shaded, parts, xray, hidden-line, wireframe), exploded=AMOUNT (the parts moved apart, 0 to 1; with a mode: hidden-line,exploded=0.6), edges=CLASS (the edges of one class alone: feature, tangent or seam; edges=feature draws no line where faces meet smoothly or a face closes on itself), or the display JSON object (mode, grid, camera, clip, exploded, edges, hidden, isolated: part refs the picture leaves out, or alone draws), or a JSON file of it; a drawing takes none; a KiCad board a board mode (board, copper, assembly, placement) or {mode, side, poured, layers, active, others, zones, tracks, window: [x0, y0, x1, y1], the box of the board to frame, in its mm}; a KiCad schematic {sheet, border, title} (title: KiCad's title block, on unless false; border: the page's edge and frame). Every snapshot is drawn light. |
| `--grid` | Draw the measuring grid. |
| `--camera CAMERA` | A preset (iso, front, back, left, right, top, bottom), azimuth:elevation, a camera JSON object (its position, target and orthographicHalfHeight in the viewer's scene coordinates, as a Quick Edit packet carries them: a document's or a GLB's mm, a robot's m, a 3MF's unit), or authored: the view `--annotation`'s ink was drawn in, from its Quick Edit packet, exactly. |
| `--width WIDTH` | — |
| `--height HEIGHT` | — |
| `--size-profile` | One of `assembly`, `assembly-large`, `contact-sheet`, `diagnostic`, `labeled`, `presentation`, `presentation-large`, `simple`, `simple-square`. |
| `--preview` | The viewer's Preview in place of a display mode: the model lit in a studio, in its materials, on a floor with its shadow, in perspective (a job's: "preview": true). |
| `--pose POSE` | A configuration's name (a robot's SRDF group state), a configuration sequence at a time of it (walk\@0.6: where the viewer's playbar shows the mechanism then), or joint and coupling values as JSON ('{"elbow": 45}', '{"curl": 0.6}'; degrees, and a slide in the file's unit: a document's mm, a robot's m): the mechanism posed there; as built without it (a robot where the viewer opens it). |
| `--annotation FILE` | The viewer's annotation file, or the Quick Edit packet (.snapshot.json) that carries it: its ink drawn over the model, on the parts it was drawn on. |
| `--measurements FILE` | Measure's dimensions (a JSON list of {start, end, label, color}; the points in the viewer's scene coordinates, as `--camera`'s lengths), drawn over the model. |
| `--json` | Print what was drawn and its timings as JSON. |

#### `cad glb inspect`

Its nodes, meshes and animations.

```text
cad glb inspect [--query {summary,structure,closure,geometry,build}] [--json] document [ref]
```

In Python: [`cad.glb.inspect`](https://www.texttocad.dev/docs/reference/library#cad.glb.inspect).

| Argument | Description |
| --- | --- |
| `document` | The .glb file. |
| `ref` | [FILE#\][OWNER/]ELEMENT or [FILE#]OWNER (cad.engine.refs): OWNER a part's or an assembly's label, or its occurrence path (hand/finger.2); ELEMENT an element name (f:..., e:..., v:...) or face N (edge, vertex). An element answers what the kernel measures of it, placed where its occurrence stands, and what made it; a part or an assembly its volume, mass and world bounds, a part its placement. Without it: what the document holds (its state, parts, bounds, volume, materials, joints, couplings, states, sequences, animations and declared files), then its build closure. Optional. |

| Option | Description |
| --- | --- |
| `--query` | Inspect a summary and the closure (the default without REF); the structure: the summary without its bounds, volume and masses, so nothing is measured, and the closure; the closure alone; geometry (requires REF); or build metadata. Never builds a model or meshes a part; a part's volume and box are measured once by the engine and kept for its geometry. One of `summary`, `structure`, `closure`, `geometry`, `build`. |
| `--json` | Without REF, the summary (or the structure) and the closure as one JSON object (a REF's answer is JSON). |

#### `cad glb dfm`

Check a mesh for 3D printing. Exit 0: OK. Exit 1: FAILED, a finding is an error (with `--strict`, a warning too). Exit 3: NOT CHECKED, something was not judged: never a pass. Exit 2: the command line's mistake.

```text
cad glb dfm [--process {cnc,sheet,molding,printing}] [--material MATERIAL] [--technology {fdm,sls,sla,mjf,pbf}] [--build-volume VOLUME] [--angle-limit LIMIT] [--samples SAMPLES] [--layer-height HEIGHT] [--nozzle NOZZLE] [--printer PRINTER] [--candidates] [--strict] [--json] SOURCE
```

In Python: [`cad.glb.dfm`](https://www.texttocad.dev/docs/reference/library#cad.glb.dfm).

| Argument | Description |
| --- | --- |
| `SOURCE` | The .glb file to check. |

| Option | Description | Default |
| --- | --- | --- |
| `--process` | Printing, the one process a mesh is checked for (the default); cnc, sheet and molding are judged on exact geometry: check the part's STEP or model for them. One of `cnc`, `sheet`, `molding`, `printing`. | `printing` |
| `--material MATERIAL` | The part's material (aluminum, steel, stainless, abs, pc, nylon, ...): picks the material's limits; default the material the part declares (part.material = metals.aluminum()), when every part agrees. |   |
| `--technology` | Printing: fdm, sls, sla, mjf or pbf (metal powder bed); default fdm. One of `fdm`, `sls`, `sla`, `mjf`, `pbf`. |   |
| `--build-volume VOLUME` | Printing: the printer's build volume in mm (256x256x256); default a typical machine of the technology's, assumed. |   |
| `--angle-limit LIMIT` | Printing: down-facing faces under this many degrees from horizontal need support; default the technology's. |   |
| `--samples SAMPLES` | Printing: rays cast for the wall-thickness field on a mesh; default 2000. |   |
| `--layer-height HEIGHT` | Printing: the layer height in mm, for stair-stepping; default the technology's. |   |
| `--nozzle NOZZLE` | Printing: fdm's nozzle diameter in mm; default 0.4. |   |
| `--printer PRINTER` | Printing: a file of the printer's settings — a 3MF OrcaSlicer or Bambu Studio saved, or a complete machine preset JSON — for its build volume and nozzle; `--build-volume` and `--nozzle` win. |   |
| `--candidates` | Rank the candidates instead: printing the orientations. |   |
| `--strict` | A warning fails the check too (exit 1): a gate that takes no recommendation broken. |   |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |   |

### `cad threemf`

3MF: A 3D Manufacturing Format package of triangle meshes. Files: `.3mf`.

```text
cad threemf <operation> FILE [options]
```

In Python: [`cad.threemf`](https://www.texttocad.dev/docs/reference/library#cad.threemf).

#### `cad threemf export`

Write the mesh to the other mesh kinds (.glb, .stl, .3mf).

```text
cad threemf export [--json] SRC DST [DST ...]
```

In Python: [`cad.threemf.export`](https://www.texttocad.dev/docs/reference/library#cad.threemf.export).

| Argument | Description |
| --- | --- |
| `SRC` | The .3mf file. |
| `DST` | The other mesh kinds (.glb, .stl, .3mf), each holding what its format carries. Repeatable. |

| Option | Description |
| --- | --- |
| `--json` | Print what was written as JSON. |

#### `cad threemf snapshot`

Draw it as the viewer does, into a PNG.

```text
cad threemf snapshot SRC OUT.png [options] | --job PACKET [SRC] [options]
```

In Python: [`cad.threemf.snapshot`](https://www.texttocad.dev/docs/reference/library#cad.threemf.snapshot).

| Argument | Description |
| --- | --- |
| `SRC` | The .3mf file; with `--job`, drawn in place of every job's input. Optional. |
| `OUT.png` | The .png to write, or a folder (one that is there, or a path ending in a separator) to write \<SRC's stem\>\_\<UTC time\>.png into. Optional. |

| Option | Description |
| --- | --- |
| `--job PACKET` | A Quick Edit packet (the .snapshot.json the viewer writes), a job or a list of jobs, as JSON or a file of it: every picture its outputs name drawn, each job's view as it was — its camera, display, hidden and isolated parts, pose — with the packet's ink and dimensions, at its output settings (padding, tightFrame, transparent, background, renderScale, sizeProfile); the other flags override every job. |
| `--display DISPLAY` | A mode (solid, shaded, parts, xray, hidden-line, wireframe), exploded=AMOUNT (the parts moved apart, 0 to 1; with a mode: hidden-line,exploded=0.6), edges=CLASS (the edges of one class alone: feature, tangent or seam; edges=feature draws no line where faces meet smoothly or a face closes on itself), or the display JSON object (mode, grid, camera, clip, exploded, edges, hidden, isolated: part refs the picture leaves out, or alone draws), or a JSON file of it; a drawing takes none; a KiCad board a board mode (board, copper, assembly, placement) or {mode, side, poured, layers, active, others, zones, tracks, window: [x0, y0, x1, y1], the box of the board to frame, in its mm}; a KiCad schematic {sheet, border, title} (title: KiCad's title block, on unless false; border: the page's edge and frame). Every snapshot is drawn light. |
| `--grid` | Draw the measuring grid. |
| `--camera CAMERA` | A preset (iso, front, back, left, right, top, bottom), azimuth:elevation, a camera JSON object (its position, target and orthographicHalfHeight in the viewer's scene coordinates, as a Quick Edit packet carries them: a document's or a GLB's mm, a robot's m, a 3MF's unit), or authored: the view `--annotation`'s ink was drawn in, from its Quick Edit packet, exactly. |
| `--width WIDTH` | — |
| `--height HEIGHT` | — |
| `--size-profile` | One of `assembly`, `assembly-large`, `contact-sheet`, `diagnostic`, `labeled`, `presentation`, `presentation-large`, `simple`, `simple-square`. |
| `--preview` | The viewer's Preview in place of a display mode: the model lit in a studio, in its materials, on a floor with its shadow, in perspective (a job's: "preview": true). |
| `--pose POSE` | A configuration's name (a robot's SRDF group state), a configuration sequence at a time of it (walk\@0.6: where the viewer's playbar shows the mechanism then), or joint and coupling values as JSON ('{"elbow": 45}', '{"curl": 0.6}'; degrees, and a slide in the file's unit: a document's mm, a robot's m): the mechanism posed there; as built without it (a robot where the viewer opens it). |
| `--annotation FILE` | The viewer's annotation file, or the Quick Edit packet (.snapshot.json) that carries it: its ink drawn over the model, on the parts it was drawn on. |
| `--measurements FILE` | Measure's dimensions (a JSON list of {start, end, label, color}; the points in the viewer's scene coordinates, as `--camera`'s lengths), drawn over the model. |
| `--json` | Print what was drawn and its timings as JSON. |

#### `cad threemf dfm`

Check a mesh for 3D printing. Exit 0: OK. Exit 1: FAILED, a finding is an error (with `--strict`, a warning too). Exit 3: NOT CHECKED, something was not judged: never a pass. Exit 2: the command line's mistake.

```text
cad threemf dfm [--process {cnc,sheet,molding,printing}] [--material MATERIAL] [--technology {fdm,sls,sla,mjf,pbf}] [--build-volume VOLUME] [--angle-limit LIMIT] [--samples SAMPLES] [--layer-height HEIGHT] [--nozzle NOZZLE] [--printer PRINTER] [--candidates] [--strict] [--json] SOURCE
```

In Python: [`cad.threemf.dfm`](https://www.texttocad.dev/docs/reference/library#cad.threemf.dfm).

| Argument | Description |
| --- | --- |
| `SOURCE` | The .3mf file to check. |

| Option | Description | Default |
| --- | --- | --- |
| `--process` | Printing, the one process a mesh is checked for (the default); cnc, sheet and molding are judged on exact geometry: check the part's STEP or model for them. One of `cnc`, `sheet`, `molding`, `printing`. | `printing` |
| `--material MATERIAL` | The part's material (aluminum, steel, stainless, abs, pc, nylon, ...): picks the material's limits; default the material the part declares (part.material = metals.aluminum()), when every part agrees. |   |
| `--technology` | Printing: fdm, sls, sla, mjf or pbf (metal powder bed); default fdm. One of `fdm`, `sls`, `sla`, `mjf`, `pbf`. |   |
| `--build-volume VOLUME` | Printing: the printer's build volume in mm (256x256x256); default a typical machine of the technology's, assumed. |   |
| `--angle-limit LIMIT` | Printing: down-facing faces under this many degrees from horizontal need support; default the technology's. |   |
| `--samples SAMPLES` | Printing: rays cast for the wall-thickness field on a mesh; default 2000. |   |
| `--layer-height HEIGHT` | Printing: the layer height in mm, for stair-stepping; default the technology's. |   |
| `--nozzle NOZZLE` | Printing: fdm's nozzle diameter in mm; default 0.4. |   |
| `--printer PRINTER` | Printing: a file of the printer's settings — a 3MF OrcaSlicer or Bambu Studio saved, or a complete machine preset JSON — for its build volume and nozzle; `--build-volume` and `--nozzle` win. |   |
| `--candidates` | Rank the candidates instead: printing the orientations. |   |
| `--strict` | A warning fails the check too (exit 1): a gate that takes no recommendation broken. |   |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |   |

### `cad dxf`

DXF: A 2D drawing of a planar document. Files: `.dxf`.

```text
cad dxf <operation> FILE [options]
```

In Python: [`cad.dxf`](https://www.texttocad.dev/docs/reference/library#cad.dxf).

#### `cad dxf snapshot`

Draw it as the viewer does, into a PNG.

```text
cad dxf snapshot SRC OUT.png [options] | --job PACKET [SRC] [options]
```

In Python: [`cad.dxf.snapshot`](https://www.texttocad.dev/docs/reference/library#cad.dxf.snapshot).

| Argument | Description |
| --- | --- |
| `SRC` | The .dxf file; with `--job`, drawn in place of every job's input. Optional. |
| `OUT.png` | The .png to write, or a folder (one that is there, or a path ending in a separator) to write \<SRC's stem\>\_\<UTC time\>.png into. Optional. |

| Option | Description |
| --- | --- |
| `--job PACKET` | A Quick Edit packet (the .snapshot.json the viewer writes), a job or a list of jobs, as JSON or a file of it: every picture its outputs name drawn, each job's view as it was — its camera, display, hidden and isolated parts, pose — with the packet's ink and dimensions, at its output settings (padding, tightFrame, transparent, background, renderScale, sizeProfile); the other flags override every job. |
| `--display DISPLAY` | A mode (solid, shaded, parts, xray, hidden-line, wireframe), exploded=AMOUNT (the parts moved apart, 0 to 1; with a mode: hidden-line,exploded=0.6), edges=CLASS (the edges of one class alone: feature, tangent or seam; edges=feature draws no line where faces meet smoothly or a face closes on itself), or the display JSON object (mode, grid, camera, clip, exploded, edges, hidden, isolated: part refs the picture leaves out, or alone draws), or a JSON file of it; a drawing takes none; a KiCad board a board mode (board, copper, assembly, placement) or {mode, side, poured, layers, active, others, zones, tracks, window: [x0, y0, x1, y1], the box of the board to frame, in its mm}; a KiCad schematic {sheet, border, title} (title: KiCad's title block, on unless false; border: the page's edge and frame). Every snapshot is drawn light. |
| `--grid` | Draw the measuring grid. |
| `--camera CAMERA` | A preset (iso, front, back, left, right, top, bottom), azimuth:elevation, a camera JSON object (its position, target and orthographicHalfHeight in the viewer's scene coordinates, as a Quick Edit packet carries them: a document's or a GLB's mm, a robot's m, a 3MF's unit), or authored: the view `--annotation`'s ink was drawn in, from its Quick Edit packet, exactly. |
| `--width WIDTH` | — |
| `--height HEIGHT` | — |
| `--size-profile` | One of `assembly`, `assembly-large`, `contact-sheet`, `diagnostic`, `labeled`, `presentation`, `presentation-large`, `simple`, `simple-square`. |
| `--preview` | The viewer's Preview in place of a display mode: the model lit in a studio, in its materials, on a floor with its shadow, in perspective (a job's: "preview": true). |
| `--pose POSE` | A configuration's name (a robot's SRDF group state), a configuration sequence at a time of it (walk\@0.6: where the viewer's playbar shows the mechanism then), or joint and coupling values as JSON ('{"elbow": 45}', '{"curl": 0.6}'; degrees, and a slide in the file's unit: a document's mm, a robot's m): the mechanism posed there; as built without it (a robot where the viewer opens it). |
| `--annotation FILE` | The viewer's annotation file, or the Quick Edit packet (.snapshot.json) that carries it: its ink drawn over the model, on the parts it was drawn on. |
| `--measurements FILE` | Measure's dimensions (a JSON list of {start, end, label, color}; the points in the viewer's scene coordinates, as `--camera`'s lengths), drawn over the model. |
| `--json` | Print what was drawn and its timings as JSON. |

#### `cad dxf dfm`

Check a sheet's cut file (a DXF) for laser, waterjet or router cutting: the sheet process. Exit 0: OK. Exit 1: FAILED, a finding is an error (with `--strict`, a warning too). Exit 3: NOT CHECKED, something was not judged: never a pass. Exit 2: the command line's mistake.

```text
cad dxf dfm [--process {sheet}] [--material MATERIAL] [--units {mm,cm,m,in,ft}] [--thickness THICKNESS] [--k-factor FACTOR] [--bend-radius RADIUS] [--kerf KERF] [--sheet-size SIZE] [--strict] [--json] SOURCE
```

In Python: [`cad.dxf.dfm`](https://www.texttocad.dev/docs/reference/library#cad.dxf.dfm).

| Argument | Description |
| --- | --- |
| `SOURCE` | The .dxf cut file to check. |

| Option | Description | Default |
| --- | --- | --- |
| `--process` | Sheet, the one process a DXF is checked for (the default). One of `sheet`. | `sheet` |
| `--material MATERIAL` | The part's material (aluminum, steel, stainless, abs, pc, nylon, ...): picks the material's limits; default the material the part declares (part.material = metals.aluminum()), when every part agrees. |   |
| `--units` | The file's length units (mm, cm, m, in, ft): an STL's (default mm), or a DXF's (default the ones it declares; needed where it declares none, as an R12 file). One of `mm`, `cm`, `m`, `in`, `ft`. |   |
| `--thickness THICKNESS` | Sheet: the stock's thickness in mm; default measured. |   |
| `--k-factor FACTOR` | Sheet: the neutral axis's place in the thickness, for the flat pattern (the shop's bend table's); default a K-factor chart's, by the material and each bend's radius. |   |
| `--bend-radius RADIUS` | Sheet: the shop's inside bend radius in mm, compared with the part's. |   |
| `--kerf KERF` | Sheet: the cutting kerf in mm, for small features. |   |
| `--sheet-size SIZE` | Sheet: the shop's largest sheet in mm (1219x2438); default a standard 5 x 10 ft sheet (3048x1524), assumed. |   |
| `--strict` | A warning fails the check too (exit 1): a gate that takes no recommendation broken. |   |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |   |

### `cad urdf`

URDF: A robot description (ROS's Unified Robot Description Format). Files: `.urdf`.

```text
cad urdf <operation> FILE [options]
```

In Python: [`cad.urdf`](https://www.texttocad.dev/docs/reference/library#cad.urdf).

#### `cad urdf snapshot`

Draw it as the viewer does, into a PNG.

```text
cad urdf snapshot SRC OUT.png [options] | --job PACKET [SRC] [options]
```

In Python: [`cad.urdf.snapshot`](https://www.texttocad.dev/docs/reference/library#cad.urdf.snapshot).

| Argument | Description |
| --- | --- |
| `SRC` | The .urdf file; with `--job`, drawn in place of every job's input. Optional. |
| `OUT.png` | The .png to write, or a folder (one that is there, or a path ending in a separator) to write \<SRC's stem\>\_\<UTC time\>.png into. Optional. |

| Option | Description |
| --- | --- |
| `--job PACKET` | A Quick Edit packet (the .snapshot.json the viewer writes), a job or a list of jobs, as JSON or a file of it: every picture its outputs name drawn, each job's view as it was — its camera, display, hidden and isolated parts, pose — with the packet's ink and dimensions, at its output settings (padding, tightFrame, transparent, background, renderScale, sizeProfile); the other flags override every job. |
| `--display DISPLAY` | A mode (solid, shaded, parts, xray, hidden-line, wireframe), exploded=AMOUNT (the parts moved apart, 0 to 1; with a mode: hidden-line,exploded=0.6), edges=CLASS (the edges of one class alone: feature, tangent or seam; edges=feature draws no line where faces meet smoothly or a face closes on itself), or the display JSON object (mode, grid, camera, clip, exploded, edges, hidden, isolated: part refs the picture leaves out, or alone draws), or a JSON file of it; a drawing takes none; a KiCad board a board mode (board, copper, assembly, placement) or {mode, side, poured, layers, active, others, zones, tracks, window: [x0, y0, x1, y1], the box of the board to frame, in its mm}; a KiCad schematic {sheet, border, title} (title: KiCad's title block, on unless false; border: the page's edge and frame). Every snapshot is drawn light. |
| `--grid` | Draw the measuring grid. |
| `--camera CAMERA` | A preset (iso, front, back, left, right, top, bottom), azimuth:elevation, a camera JSON object (its position, target and orthographicHalfHeight in the viewer's scene coordinates, as a Quick Edit packet carries them: a document's or a GLB's mm, a robot's m, a 3MF's unit), or authored: the view `--annotation`'s ink was drawn in, from its Quick Edit packet, exactly. |
| `--width WIDTH` | — |
| `--height HEIGHT` | — |
| `--size-profile` | One of `assembly`, `assembly-large`, `contact-sheet`, `diagnostic`, `labeled`, `presentation`, `presentation-large`, `simple`, `simple-square`. |
| `--preview` | The viewer's Preview in place of a display mode: the model lit in a studio, in its materials, on a floor with its shadow, in perspective (a job's: "preview": true). |
| `--pose POSE` | A configuration's name (a robot's SRDF group state), a configuration sequence at a time of it (walk\@0.6: where the viewer's playbar shows the mechanism then), or joint and coupling values as JSON ('{"elbow": 45}', '{"curl": 0.6}'; degrees, and a slide in the file's unit: a document's mm, a robot's m): the mechanism posed there; as built without it (a robot where the viewer opens it). |
| `--annotation FILE` | The viewer's annotation file, or the Quick Edit packet (.snapshot.json) that carries it: its ink drawn over the model, on the parts it was drawn on. |
| `--measurements FILE` | Measure's dimensions (a JSON list of {start, end, label, color}; the points in the viewer's scene coordinates, as `--camera`'s lengths), drawn over the model. |
| `--json` | Print what was drawn and its timings as JSON. |

#### `cad urdf validate`

Check one URDF robot description for conformance.

```text
cad urdf validate [--strict] [--packages NAME=PATH] [--verbose] [--json] PATH
```

In Python: [`cad.urdf.validate`](https://www.texttocad.dev/docs/reference/library#cad.urdf.validate).

| Argument | Description |
| --- | --- |
| `PATH` | The .urdf file to validate. |

| Option | Description |
| --- | --- |
| `--strict` | Treat warnings as blocking. |
| `--packages NAME=PATH` | Resolve package://NAME/... mesh URIs against PATH. Repeatable. Repeatable. |
| `--verbose` | Narrate the target on stderr. |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |

### `cad srdf`

SRDF: A MoveIt semantic robot description, read against its URDF. Files: `.srdf`.

```text
cad srdf <operation> FILE [options]
```

In Python: [`cad.srdf`](https://www.texttocad.dev/docs/reference/library#cad.srdf).

#### `cad srdf snapshot`

Draw it as the viewer does, into a PNG.

```text
cad srdf snapshot SRC OUT.png [options] | --job PACKET [SRC] [options]
```

In Python: [`cad.srdf.snapshot`](https://www.texttocad.dev/docs/reference/library#cad.srdf.snapshot).

| Argument | Description |
| --- | --- |
| `SRC` | The .srdf file; with `--job`, drawn in place of every job's input. Optional. |
| `OUT.png` | The .png to write, or a folder (one that is there, or a path ending in a separator) to write \<SRC's stem\>\_\<UTC time\>.png into. Optional. |

| Option | Description |
| --- | --- |
| `--job PACKET` | A Quick Edit packet (the .snapshot.json the viewer writes), a job or a list of jobs, as JSON or a file of it: every picture its outputs name drawn, each job's view as it was — its camera, display, hidden and isolated parts, pose — with the packet's ink and dimensions, at its output settings (padding, tightFrame, transparent, background, renderScale, sizeProfile); the other flags override every job. |
| `--display DISPLAY` | A mode (solid, shaded, parts, xray, hidden-line, wireframe), exploded=AMOUNT (the parts moved apart, 0 to 1; with a mode: hidden-line,exploded=0.6), edges=CLASS (the edges of one class alone: feature, tangent or seam; edges=feature draws no line where faces meet smoothly or a face closes on itself), or the display JSON object (mode, grid, camera, clip, exploded, edges, hidden, isolated: part refs the picture leaves out, or alone draws), or a JSON file of it; a drawing takes none; a KiCad board a board mode (board, copper, assembly, placement) or {mode, side, poured, layers, active, others, zones, tracks, window: [x0, y0, x1, y1], the box of the board to frame, in its mm}; a KiCad schematic {sheet, border, title} (title: KiCad's title block, on unless false; border: the page's edge and frame). Every snapshot is drawn light. |
| `--grid` | Draw the measuring grid. |
| `--camera CAMERA` | A preset (iso, front, back, left, right, top, bottom), azimuth:elevation, a camera JSON object (its position, target and orthographicHalfHeight in the viewer's scene coordinates, as a Quick Edit packet carries them: a document's or a GLB's mm, a robot's m, a 3MF's unit), or authored: the view `--annotation`'s ink was drawn in, from its Quick Edit packet, exactly. |
| `--width WIDTH` | — |
| `--height HEIGHT` | — |
| `--size-profile` | One of `assembly`, `assembly-large`, `contact-sheet`, `diagnostic`, `labeled`, `presentation`, `presentation-large`, `simple`, `simple-square`. |
| `--preview` | The viewer's Preview in place of a display mode: the model lit in a studio, in its materials, on a floor with its shadow, in perspective (a job's: "preview": true). |
| `--pose POSE` | A configuration's name (a robot's SRDF group state), a configuration sequence at a time of it (walk\@0.6: where the viewer's playbar shows the mechanism then), or joint and coupling values as JSON ('{"elbow": 45}', '{"curl": 0.6}'; degrees, and a slide in the file's unit: a document's mm, a robot's m): the mechanism posed there; as built without it (a robot where the viewer opens it). |
| `--annotation FILE` | The viewer's annotation file, or the Quick Edit packet (.snapshot.json) that carries it: its ink drawn over the model, on the parts it was drawn on. |
| `--measurements FILE` | Measure's dimensions (a JSON list of {start, end, label, color}; the points in the viewer's scene coordinates, as `--camera`'s lengths), drawn over the model. |
| `--json` | Print what was drawn and its timings as JSON. |

#### `cad srdf validate`

Check one SRDF against its paired URDF.

```text
cad srdf validate [--strict] [--urdf URDF] [--verbose] [--json] PATH
```

In Python: [`cad.srdf.validate`](https://www.texttocad.dev/docs/reference/library#cad.srdf.validate).

| Argument | Description |
| --- | --- |
| `PATH` | The .srdf file to check. |

| Option | Description |
| --- | --- |
| `--strict` | Treat warnings as blocking. |
| `--urdf URDF` | The URDF to check it against; found from its robot name and folder without it. |
| `--verbose` | Narrate the target on stderr. |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |

### `cad sdf`

SDF: An SDFormat world or model (Gazebo's Simulation Description Format). Files: `.sdf`.

```text
cad sdf <operation> FILE [options]
```

In Python: [`cad.sdf`](https://www.texttocad.dev/docs/reference/library#cad.sdf).

#### `cad sdf snapshot`

Draw it as the viewer does, into a PNG.

```text
cad sdf snapshot SRC OUT.png [options] | --job PACKET [SRC] [options]
```

In Python: [`cad.sdf.snapshot`](https://www.texttocad.dev/docs/reference/library#cad.sdf.snapshot).

| Argument | Description |
| --- | --- |
| `SRC` | The .sdf file; with `--job`, drawn in place of every job's input. Optional. |
| `OUT.png` | The .png to write, or a folder (one that is there, or a path ending in a separator) to write \<SRC's stem\>\_\<UTC time\>.png into. Optional. |

| Option | Description |
| --- | --- |
| `--job PACKET` | A Quick Edit packet (the .snapshot.json the viewer writes), a job or a list of jobs, as JSON or a file of it: every picture its outputs name drawn, each job's view as it was — its camera, display, hidden and isolated parts, pose — with the packet's ink and dimensions, at its output settings (padding, tightFrame, transparent, background, renderScale, sizeProfile); the other flags override every job. |
| `--display DISPLAY` | A mode (solid, shaded, parts, xray, hidden-line, wireframe), exploded=AMOUNT (the parts moved apart, 0 to 1; with a mode: hidden-line,exploded=0.6), edges=CLASS (the edges of one class alone: feature, tangent or seam; edges=feature draws no line where faces meet smoothly or a face closes on itself), or the display JSON object (mode, grid, camera, clip, exploded, edges, hidden, isolated: part refs the picture leaves out, or alone draws), or a JSON file of it; a drawing takes none; a KiCad board a board mode (board, copper, assembly, placement) or {mode, side, poured, layers, active, others, zones, tracks, window: [x0, y0, x1, y1], the box of the board to frame, in its mm}; a KiCad schematic {sheet, border, title} (title: KiCad's title block, on unless false; border: the page's edge and frame). Every snapshot is drawn light. |
| `--grid` | Draw the measuring grid. |
| `--camera CAMERA` | A preset (iso, front, back, left, right, top, bottom), azimuth:elevation, a camera JSON object (its position, target and orthographicHalfHeight in the viewer's scene coordinates, as a Quick Edit packet carries them: a document's or a GLB's mm, a robot's m, a 3MF's unit), or authored: the view `--annotation`'s ink was drawn in, from its Quick Edit packet, exactly. |
| `--width WIDTH` | — |
| `--height HEIGHT` | — |
| `--size-profile` | One of `assembly`, `assembly-large`, `contact-sheet`, `diagnostic`, `labeled`, `presentation`, `presentation-large`, `simple`, `simple-square`. |
| `--preview` | The viewer's Preview in place of a display mode: the model lit in a studio, in its materials, on a floor with its shadow, in perspective (a job's: "preview": true). |
| `--pose POSE` | A configuration's name (a robot's SRDF group state), a configuration sequence at a time of it (walk\@0.6: where the viewer's playbar shows the mechanism then), or joint and coupling values as JSON ('{"elbow": 45}', '{"curl": 0.6}'; degrees, and a slide in the file's unit: a document's mm, a robot's m): the mechanism posed there; as built without it (a robot where the viewer opens it). |
| `--annotation FILE` | The viewer's annotation file, or the Quick Edit packet (.snapshot.json) that carries it: its ink drawn over the model, on the parts it was drawn on. |
| `--measurements FILE` | Measure's dimensions (a JSON list of {start, end, label, color}; the points in the viewer's scene coordinates, as `--camera`'s lengths), drawn over the model. |
| `--json` | Print what was drawn and its timings as JSON. |

#### `cad sdf validate`

Check one SDFormat world or model for conformance.

```text
cad sdf validate [--strict] [--gz-check {auto,required,never}] [--gz-remote] [--verbose] [--json] PATH
```

In Python: [`cad.sdf.validate`](https://www.texttocad.dev/docs/reference/library#cad.sdf.validate).

| Argument | Description |
| --- | --- |
| `PATH` | The .sdf file to check. |

| Option | Description | Default |
| --- | --- | --- |
| `--strict` | Treat warnings as blocking. |   |
| `--gz-check` | Run `gz sdf --check` as external validation — auto (when the tool is installed), required (fail without it), or never. One of `auto`, `required`, `never`. | `auto` |
| `--gz-remote` | Let `gz sdf --check` resolve the document's remote \<uri\> references (http, https, fuel). Off by default: gz does not run on a document that names one, so validating a file never fetches from a host the file names. |   |
| `--verbose` | Narrate the target on stderr. |   |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |   |

### `cad kicad_pcb`

KiCad PCB: A KiCad printed circuit board, read with the .kicad_pro beside it. Files: `.kicad_pcb`.

```text
cad kicad_pcb <operation> FILE [options]
```

In Python: [`cad.kicad_pcb`](https://www.texttocad.dev/docs/reference/library#cad.kicad_pcb).

#### `cad kicad_pcb export`

Write a saved KiCad board's fabrication, assembly or 3D output with KiCad's kicad-cli, headless, into a folder.

```text
cad kicad_pcb export --to {gerbers,drill,pos,bom,step,glb,odb,ipc2581,pdf,dxf} --out DIR [--json] BOARD
```

In Python: [`cad.kicad_pcb.export`](https://www.texttocad.dev/docs/reference/library#cad.kicad_pcb.export).

| Argument | Description |
| --- | --- |
| `BOARD` | The .kicad_pcb (its .kicad_pro beside it). |

| Option | Description |
| --- | --- |
| `--to` | **Required.** What to write: gerbers and drill (a folder of files), pos (placement CSV), bom (the schematic's parts CSV), step and glb (3D), odb (ODB++ zip), ipc2581, pdf (a front and a back fabrication drawing) or dxf (the outline and holes). One of `gerbers`, `drill`, `pos`, `bom`, `step`, `glb`, `odb`, `ipc2581`, `pdf`, `dxf`. |
| `-o`, `--out DIR` | **Required.** The folder to write into, made when missing. |
| `--json` | Print the answer as one JSON line on stdout. |

#### `cad kicad_pcb snapshot`

Draw it flat, as the viewer's board view does, into a PNG.

```text
cad kicad_pcb snapshot SRC OUT.png [options] | --job PACKET [SRC] [options]
```

In Python: [`cad.kicad_pcb.snapshot`](https://www.texttocad.dev/docs/reference/library#cad.kicad_pcb.snapshot).

| Argument | Description |
| --- | --- |
| `SRC` | The .kicad_pcb file; with `--job`, drawn in place of every job's input. Optional. |
| `OUT.png` | The .png to write, or a folder (one that is there, or a path ending in a separator) to write \<SRC's stem\>\_\<UTC time\>.png into. Optional. |

| Option | Description |
| --- | --- |
| `--job PACKET` | A Quick Edit packet (the .snapshot.json the viewer writes), a job or a list of jobs, as JSON or a file of it: every picture its outputs name drawn, each job's view as it was — its camera, display, hidden and isolated parts, pose — with the packet's ink and dimensions, at its output settings (padding, tightFrame, transparent, background, renderScale, sizeProfile); the other flags override every job. |
| `--display DISPLAY` | A mode (solid, shaded, parts, xray, hidden-line, wireframe), exploded=AMOUNT (the parts moved apart, 0 to 1; with a mode: hidden-line,exploded=0.6), edges=CLASS (the edges of one class alone: feature, tangent or seam; edges=feature draws no line where faces meet smoothly or a face closes on itself), or the display JSON object (mode, grid, camera, clip, exploded, edges, hidden, isolated: part refs the picture leaves out, or alone draws), or a JSON file of it; a drawing takes none; a KiCad board a board mode (board, copper, assembly, placement) or {mode, side, poured, layers, active, others, zones, tracks, window: [x0, y0, x1, y1], the box of the board to frame, in its mm}; a KiCad schematic {sheet, border, title} (title: KiCad's title block, on unless false; border: the page's edge and frame). Every snapshot is drawn light. |
| `--grid` | Draw the measuring grid. |
| `--camera CAMERA` | A preset (iso, front, back, left, right, top, bottom), azimuth:elevation, a camera JSON object (its position, target and orthographicHalfHeight in the viewer's scene coordinates, as a Quick Edit packet carries them: a document's or a GLB's mm, a robot's m, a 3MF's unit), or authored: the view `--annotation`'s ink was drawn in, from its Quick Edit packet, exactly. |
| `--width WIDTH` | — |
| `--height HEIGHT` | — |
| `--size-profile` | One of `assembly`, `assembly-large`, `contact-sheet`, `diagnostic`, `labeled`, `presentation`, `presentation-large`, `simple`, `simple-square`. |
| `--preview` | The viewer's Preview in place of a display mode: the model lit in a studio, in its materials, on a floor with its shadow, in perspective (a job's: "preview": true). |
| `--pose POSE` | A configuration's name (a robot's SRDF group state), a configuration sequence at a time of it (walk\@0.6: where the viewer's playbar shows the mechanism then), or joint and coupling values as JSON ('{"elbow": 45}', '{"curl": 0.6}'; degrees, and a slide in the file's unit: a document's mm, a robot's m): the mechanism posed there; as built without it (a robot where the viewer opens it). |
| `--annotation FILE` | The viewer's annotation file, or the Quick Edit packet (.snapshot.json) that carries it: its ink drawn over the model, on the parts it was drawn on. |
| `--measurements FILE` | Measure's dimensions (a JSON list of {start, end, label, color}; the points in the viewer's scene coordinates, as `--camera`'s lengths), drawn over the model. |
| `--json` | Print what was drawn and its timings as JSON. |
| `--window X0,Y0,X1,Y1` | Draw only this box of the board, filling the picture: two opposite corners in the board's millimetres as KiCad shows them (y down; the box board.area(x0, y0, x1, y1) and #@x10y5..x20y15 name), e.g. `--window` 40,60,80,90 (`--window`=-10,5,20,30 when the first is negative). With `--width` alone the height follows the box's shape (and the width with `--height` alone); the same as `--display` '{"window": [X0, Y0, X1, Y1]}'. Takes no `--camera`. |

#### `cad kicad_pcb inspect`

What a saved KiCad board holds: its format, thickness, size, layers, parts and nets.

```text
cad kicad_pcb inspect [--json] BOARD
```

In Python: [`cad.kicad_pcb.inspect`](https://www.texttocad.dev/docs/reference/library#cad.kicad_pcb.inspect).

| Argument | Description |
| --- | --- |
| `BOARD` | The .kicad_pcb (its .kicad_pro beside it). |

| Option | Description |
| --- | --- |
| `--json` | Print the answer as one JSON line on stdout. |

#### `cad kicad_pcb drc`

Check the KiCad board BOARD with KiCad's design rule check.

```text
cad kicad_pcb drc [--json] BOARD
```

In Python: [`cad.kicad_pcb.drc`](https://www.texttocad.dev/docs/reference/library#cad.kicad_pcb.drc).

| Argument | Description |
| --- | --- |
| `BOARD` | The .kicad_pcb to check (its .kicad_pro beside it carries the rules). |

| Option | Description |
| --- | --- |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |

### `cad kicad_sch`

KiCad schematic: A KiCad schematic, read with every sheet of its project's hierarchy. Files: `.kicad_sch`.

```text
cad kicad_sch <operation> FILE [options]
```

In Python: [`cad.kicad_sch`](https://www.texttocad.dev/docs/reference/library#cad.kicad_sch).

#### `cad kicad_sch export`

Write a saved KiCad schematic's outputs with KiCad's kicad-cli, headless, into a folder: a pdf of every sheet, an svg per sheet, the netlist (the board imports it) or a BOM.

```text
cad kicad_sch export --to {pdf,svg,netlist,bom} --out DIR [--json] SCHEMATIC
```

In Python: [`cad.kicad_sch.export`](https://www.texttocad.dev/docs/reference/library#cad.kicad_sch.export).

| Argument | Description |
| --- | --- |
| `SCHEMATIC` | The .kicad_sch (any sheet of its project: the whole hierarchy is read). |

| Option | Description |
| --- | --- |
| `--to` | **Required.** What to write: pdf, svg, netlist, bom. One of `pdf`, `svg`, `netlist`, `bom`. |
| `-o`, `--out DIR` | **Required.** The folder to write into, made when missing. |
| `--json` | Print the answer as one JSON line on stdout. |

#### `cad kicad_sch snapshot`

draw a document or a file the viewer opens as the viewer does, into a PNG

```text
cad kicad_sch snapshot SRC OUT.png [options] | --job PACKET [SRC] [options]
```

In Python: [`cad.kicad_sch.snapshot`](https://www.texttocad.dev/docs/reference/library#cad.kicad_sch.snapshot).

| Argument | Description |
| --- | --- |
| `SRC` | A document (.xbf, .step), a mesh file (.glb, .stl, .3mf), a robot (.urdf, .sdf, .srdf), a drawing (.dxf), a KiCad board (.kicad_pcb) or schematic (.kicad_sch), or a document id (a model's, which cad run SCRIPT.py prints: drawn from what the engine holds); with `--job`, drawn in place of every job's input. Optional. |
| `OUT.png` | The .png to write, or a folder (one that is there, or a path ending in a separator) to write \<SRC's stem\>\_\<UTC time\>.png into. Optional. |

| Option | Description |
| --- | --- |
| `--job PACKET` | A Quick Edit packet (the .snapshot.json the viewer writes), a job or a list of jobs, as JSON or a file of it: every picture its outputs name drawn, each job's view as it was — its camera, display, hidden and isolated parts, pose — with the packet's ink and dimensions, at its output settings (padding, tightFrame, transparent, background, renderScale, sizeProfile); the other flags override every job. |
| `--display DISPLAY` | A mode (solid, shaded, parts, xray, hidden-line, wireframe), exploded=AMOUNT (the parts moved apart, 0 to 1; with a mode: hidden-line,exploded=0.6), edges=CLASS (the edges of one class alone: feature, tangent or seam; edges=feature draws no line where faces meet smoothly or a face closes on itself), or the display JSON object (mode, grid, camera, clip, exploded, edges, hidden, isolated: part refs the picture leaves out, or alone draws), or a JSON file of it; a drawing takes none; a KiCad board a board mode (board, copper, assembly, placement) or {mode, side, poured, layers, active, others, zones, tracks, window: [x0, y0, x1, y1], the box of the board to frame, in its mm}; a KiCad schematic {sheet, border, title} (title: KiCad's title block, on unless false; border: the page's edge and frame). Every snapshot is drawn light. |
| `--grid` | Draw the measuring grid. |
| `--camera CAMERA` | A preset (iso, front, back, left, right, top, bottom), azimuth:elevation, a camera JSON object (its position, target and orthographicHalfHeight in the viewer's scene coordinates, as a Quick Edit packet carries them: a document's or a GLB's mm, a robot's m, a 3MF's unit), or authored: the view `--annotation`'s ink was drawn in, from its Quick Edit packet, exactly. |
| `--width WIDTH` | — |
| `--height HEIGHT` | — |
| `--size-profile` | One of `assembly`, `assembly-large`, `contact-sheet`, `diagnostic`, `labeled`, `presentation`, `presentation-large`, `simple`, `simple-square`. |
| `--preview` | The viewer's Preview in place of a display mode: the model lit in a studio, in its materials, on a floor with its shadow, in perspective (a job's: "preview": true). |
| `--pose POSE` | A configuration's name (a robot's SRDF group state), a configuration sequence at a time of it (walk\@0.6: where the viewer's playbar shows the mechanism then), or joint and coupling values as JSON ('{"elbow": 45}', '{"curl": 0.6}'; degrees, and a slide in the file's unit: a document's mm, a robot's m): the mechanism posed there; as built without it (a robot where the viewer opens it). |
| `--annotation FILE` | The viewer's annotation file, or the Quick Edit packet (.snapshot.json) that carries it: its ink drawn over the model, on the parts it was drawn on. |
| `--measurements FILE` | Measure's dimensions (a JSON list of {start, end, label, color}; the points in the viewer's scene coordinates, as `--camera`'s lengths), drawn over the model. |
| `--json` | Print what was drawn and its timings as JSON. |
| `--sheet PATH` | The sheet to draw, by its path: / (the root, the default), /Power/; the same as `--display` '{"sheet": PATH}'. |
| `--border` | Draw KiCad's page as printed: the page's edge and the drawing sheet's frame (off by default; the title block is drawn unless `--display` '{"title": false}'). |

#### `cad kicad_sch inspect`

What a saved KiCad schematic holds: its sheets, parts and nets, read from its project's root; with REF, what that reference names (#U3, #U3.7, #net:VBUS, #sheet:/Power/, #wire:\<uuid\>).

```text
cad kicad_sch inspect [--json] SCHEMATIC [REF]
```

In Python: [`cad.kicad_sch.inspect`](https://www.texttocad.dev/docs/reference/library#cad.kicad_sch.inspect).

| Argument | Description |
| --- | --- |
| `SCHEMATIC` | The .kicad_sch (any sheet of its project: the whole hierarchy is read). |
| `REF` | A reference to resolve: #U3, #U3.7, #net:GND. Optional. |

| Option | Description |
| --- | --- |
| `--json` | Print the answer as one JSON line on stdout. |

#### `cad kicad_sch erc`

Check the KiCad schematic SCHEMATIC with KiCad's electrical rules check.

```text
cad kicad_sch erc [--json] SCHEMATIC
```

In Python: [`cad.kicad_sch.erc`](https://www.texttocad.dev/docs/reference/library#cad.kicad_sch.erc).

| Argument | Description |
| --- | --- |
| `SCHEMATIC` | The .kicad_sch to check (any sheet of its project: the check reads the whole hierarchy). |

| Option | Description |
| --- | --- |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |

## Integrations

An integration is a tool text-to-cad runs for you. For a file of its tool's own that is no document type, it has operations of its own, as `cad <integration> <operation>`.

### `cad mujoco`

MuJoCo, the physics engine, as its headless core (mujoco-core: the compiler and the bindings, no renderer) and MuJoCo Studio's web viewer: cad.mujoco makes a document a mujoco.MjSpec, chooses a part's collision on it and saves it; `cad mujoco check robot.xml` compiles a MuJoCo model with the core, so what MuJoCo refuses is a finding with MuJoCo's own words; and `cad run mujoco-studio --model scene.xml` serves the model in Studio for the person to open in a browser.

```text
cad mujoco <operation> FILE [options]
```

In Python: [`cad.mujoco`](https://www.texttocad.dev/docs/reference/library#cad.mujoco).

#### `cad mujoco check`

Compile one MuJoCo model with MuJoCo and check it.

```text
cad mujoco check [--strict] [--verbose] [--json] PATH
```

In Python: [`cad.mujoco.check`](https://www.texttocad.dev/docs/reference/library#cad.mujoco.check).

| Argument | Description |
| --- | --- |
| `PATH` | The .xml or .mjcf file to check. |

| Option | Description |
| --- | --- |
| `--strict` | Treat warnings as blocking. |
| `--verbose` | Narrate the target on stderr. |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |

### `cad orcaslicer`

OrcaSlicer, the slicer, whose command line slices only with complete presets: `cad orcaslicer presets machine` lists the presets a person can select, from their own OrcaSlicer folders and the app's profiles, and `cad orcaslicer complete` writes a printer, a process and filaments complete, every parent merged in and the printer named as compatible, for OrcaSlicer's own command line to slice with.

```text
cad orcaslicer <operation> FILE [options]
```

In Python: [`cad.orcaslicer`](https://www.texttocad.dev/docs/reference/library#cad.orcaslicer).

#### `cad orcaslicer presets`

List the OrcaSlicer presets of one kind a person can select.

```text
cad orcaslicer presets [--match MATCH] [--profiles PROFILES] [--json] KIND
```

In Python: [`cad.orcaslicer.presets`](https://www.texttocad.dev/docs/reference/library#cad.orcaslicer.presets).

| Argument | Description |
| --- | --- |
| `KIND` | Machine (a printer), process or filament. One of `machine`, `process`, `filament`. |

| Option | Description |
| --- | --- |
| `--match MATCH` | Only names containing this text, in any case. |
| `--profiles PROFILES` | Another folder of OrcaSlicer presets to search first; once per folder. Repeatable. |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |

#### `cad orcaslicer complete`

Write a printer, a process and filaments complete, for OrcaSlicer's command line.

```text
cad orcaslicer complete --printer PRINTER --process PROCESS [--filament FILAMENT] [--out OUT] [--profiles PROFILES] [--json]
```

In Python: [`cad.orcaslicer.complete`](https://www.texttocad.dev/docs/reference/library#cad.orcaslicer.complete).

| Option | Description |
| --- | --- |
| `--printer PRINTER` | **Required.** The printer (machine) preset's name, or a preset JSON file. |
| `--process PROCESS` | **Required.** The process preset's name, or a preset JSON file. |
| `--filament FILAMENT` | A filament preset's name or file; once per material, in the printer's filament order. Repeatable. |
| `--out OUT` | The folder the complete presets are written into. |
| `--profiles PROFILES` | Another folder of OrcaSlicer presets to search first; once per folder. Repeatable. |
| `--json` | Print the result as one JSON line on stdout instead of human lines. |

