universelab SCI · CLI · BIO

CLI Reference

cadspec <command> [options]

Project lifecycle

CommandDescription
cadspec new <name>Create a new project with multi-layer scaffold
cadspec initInitialize cadspec in the current directory
cadspec buildCompile project to DXF
cadspec build --checkValidate project and constraints without generating DXF
cadspec build --output <path>Compile to custom output path
cadspec build --layer <name>Compile a specific layer only
cadspec watchAuto-rebuild on file changes (300 ms debounce)

Preview

CommandDescription
cadspec serveLive preview server (background) — browser auto-reloads on save
cadspec serve --open --port <p>Open browser automatically on a custom port
cadspec serve --foregroundStay attached: stream logs, stop with Ctrl+C
cadspec serve --stopStop the background server running for this project
cadspec previewFaithful PNG render + preview.meta.json
cadspec preview --format svgVector SVG preview (same renderer)
cadspec preview --format allBoth PNG and SVG in one pass
cadspec preview --3dAxonometric 3D view (extrusions + solids)
cadspec preview --format gltfExport the 3D solids to scene.gltf (interactive 3D / interchange)
cadspec preview --highlight <ids>Amber markers around specific entities
cadspec preview --width <w> -H <h>Custom resolution
cadspec preview --layer <name>Preview a specific layer only
cadspec preview --plano <name>Render a named drawing sheet ([[plano]] in project.toml)
cadspec viewOpen the project in the configured viewer
cadspec view --layer <name>Open only one layer in the viewer

Inspection & quality

CommandDescription
cadspec checkValidate with project metadata and layer colors
cadspec check --jsonMachine-readable validation report
cadspec layersList layers with entity counts and colors
cadspec layers --jsonMachine-readable layer listing
cadspec schemaPrint the full .cf language reference (markdown)
cadspec fmtFormat .cf files (normalize whitespace)
cadspec fmt --checkCheck formatting without modifying (CI)

Import & config

CommandDescription
cadspec import <file.dxf>Import DXF into .cf layers + project.toml
cadspec import <file.dxf> --layer <name>Import only one DXF layer
cadspec import <file.dxf> --output <dir>Import into a specific directory
cadspec config set <key> <value>Set global defaults (author, units)
cadspec config showShow global defaults

Output files

FileDescription
output.dxfDefault build output
preview.png / preview.svgPreview renders
scene.gltf3D scene export (glTF 2.0, self-contained)
preview.meta.jsonPer-entity bounding boxes (world + pixel coordinates)