
cad-viewer
Start CAD Viewer and return review links for CAD and robot-description files. Use when visually reviewing .step, .stp, .glb, .stl, .3mf, .dxf, .urdf, .srdf, or .sdf files, especially when handed off from CAD, URDF, SRDF, or SDF generation skills.
- Installs
- 9K
- Last 24h
- —
- Trending rank
- —
- Security
- Warn
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/earthtojake/text-to-cad --skill cad-viewer- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads cad-viewer automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
Security audits
Independent scans of the skill's instructions and bundled files.
SKILL.md
The instructions your agent reads when the skill is triggered.
CAD Viewer
Provenance: maintained in earthtojake/text-to-cad. Use the installed local skill files as the runtime source of truth; the repository link is only for provenance and release review. If the user asks to modify, debug, or iterate on CAD Viewer source itself, that is the repository's work, not this skill's — this skill runs the Viewer, it is not where you edit it.
Use this skill to open existing or newly generated CAD, robot-description, or DXF files in CAD Viewer and hand back live review links. The expected input is one or more explicit file paths.
Setup
The Viewer is part of cadgen: install this skill's requirements.txt into a
Python >= 3.11 and the cadgen command carries the server and the prebuilt
client. There is nothing else to install and no Node at run time.
python -m pip install -r requirements.txt
cadgen doctor <this skill's directory> confirms the installed cadgen matches
the version this skill was published against.
Start Viewer
Launching is unconditional: the command below always ends with the URL of a
live Viewer for the launch directory. If one is already running for that
directory with the same Viewer code on disk (the reuse key is
realpath(directory) x an identity token — the cadgen version plus a content
digest of its Python runtime and exact built client, so an upgraded Viewer or a
different --dist never hands back a stale instance), its URL is returned
("action": "reused");
otherwise a new server starts on the first free port from 3245 upward
("action": "started"). Never pick or reason about ports — read the URL the
command prints. Each instance serves ONE directory — the directory it is
launched from — fixed for the life of the process. There is no flag for it:
the cwd IS the served directory.
The base port
3245is0xCAD— "CAD" in hexadecimal.
cd /absolute/project/models && cadgen viewer --host 127.0.0.1 --json
(cadgen must be the one installed from this skill's requirements.txt. If it
is not on PATH, python -m cadgen.viewer with that interpreter is the same
launcher.)
Choose the launch directory deliberately — it is the whole ballgame. The
cwd decides what the catalog SCANS (a project root drags in node_modules,
.git and build output) and it is the instance REUSE key, so launching from
wherever you happen to be can hand back a Viewer serving somewhere else. cd
to the directory the user thinks of as their model workspace — usually the
project's models/ directory — and launch from there. Never launch from
inside this skill's directory: that serves the skill, not the models.
Flags: --json prints the machine-readable last stdout line
({"url", "port", "action": "started"|"reused"}) — always pass it and take the
URL from there. --new forces a fresh instance instead of reusing. An
explicit --port <n> is strict — "this port or fail" — and disables
both reuse and rolling. cadgen viewer --help lists the rest.
URL shape
The page is the bare origin, and file= selects one artifact inside the served root:
http://127.0.0.1:3245/?file=gripper/STEP/gear_rack_gripper.step
The file= value is relative to the served directory. Nothing about the
directory appears in the URL, so the same link means different files under
different instances — the root is the server's, not the link's.
The launch directory is the workspace, not the file's folder. The Viewer
scans it recursively, so the file browser lists every model beneath it and the
user can switch files without a new link. Launch from the directory the user
thinks of as their model workspace — typically the project's models/
directory, or the nearest common parent of the files you were asked to review —
and put the rest of the path in file=. Launching from the artifact's own deep
folder (cd .../models/gripper/STEP, ?file=gear_rack_gripper.step) opens
the same model but hides the rest of the project, which is almost never what
the user wants.
Port collisions are not your problem: the launcher rolls to a free port and the
URL it prints is the truth. In sandboxed agent environments, local binding
failures such as EPERM/EACCES can still occur; rerun with the needed
permission/escalation.
cadgen viewer list shows every running instance with the directory it
serves; cadgen viewer stop --port <n> ends one. (Both run from anywhere —
only launching cares about the cwd.)
To review a directory outside the current root, just cd there and launch
again — reuse-or-start makes the second launch cheap and correct.
Generation is the CAD skill's job; documents compile in the Viewer
The Viewer is a static visualization tool: it renders artifacts that already exist. Generated models must be built first by running their model script (see the CAD skill); the Viewer never runs a script and never learns whether a document has one.
A .step/.stp document's status in the Viewer is one of four, decided from
the file's bytes and the store alone: not compiled (the store has no tree
for these bytes — the Viewer offers to compile, and compiles on open),
compiling · <phase> n/total (a job in cadgen's build pool is producing a
tree whose outputs include this document — the Viewer's own compile, a
python model.py in a terminal, or a parent's child build alike),
rendered, or failed (the last job for it failed; the message is shown).
A compile is a job submitted to the same pool every cadgen door uses, so
progress and errors come back as data. There is no "stale vs source" state:
whether a document is behind its script is cadgen store why's question, not
the Viewer's. When an agent is doing the work there is nothing to run first:
just use the file and return the link.
Links
- Before returning any link, resolve
<directory>/<file>and confirm it exists. Pass the.step/.stpartifact itself — generated and imported alike. The catalog lists artifacts and names them exactly as they read on disk:moonwatch.stepismoonwatch.stepin the tab, the breadcrumb, the catalog row and the file picker, whether it was generated or imported. The Viewer never learns whether a document was generated: its status is artifact-side only (not compiled / compiling / rendered / failed), and the model script is not shown anywhere in the UI. A generated model's document must already exist (run the model script); a document the store has no tree for is compiled from its bytes on open. If the resolved path is missing, do not return the link; report the problem and point to the correct path. - Return one Viewer URL per requested file.
- Start the Viewer once and pick one workspace root for the session. Every link is
the same origin plus
?file=<path relative to that root>, so all of them share one browsable catalog. An artifact outside that root needs its own Viewer — launch again with that root (reuse-or-start makes this idempotent); a link alone cannot reach it. - For directory-only review links, return the origin without
?file=. - Do not stop an existing Viewer server unless the user asks.
- If Viewer startup fails, report the failure and continue with the owning skill's non-GUI validation or artifacts.
References
- Read
references/viewer-features.mdwhen you need supported file types, Viewer controls, or file-specific feature details.
FAQ
What does the cad-viewer skill do?
Start CAD Viewer and return review links for CAD and robot-description files. Use when visually reviewing .step, .stp, .glb, .stl, .3mf, .dxf, .urdf, .srdf, or .sdf files, especially when handed off from CAD, URDF, SRDF, or SDF generation skills.
How do I install cad-viewer?
Run npx skills add https://github.com/earthtojake/text-to-cad --skill cad-viewer in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/cad-viewer/ (personal) or .claude/skills/cad-viewer/ (project).
Which AI agents can use cad-viewer?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is cad-viewer safe to install?
Security partners have reviewed it: Gen Agent Trust Hub flagged items to review; Socket passed; Snyk passed. As with any skill, read the SKILL.md and bundled scripts before installing.
Who maintains cad-viewer?
It is published by earthtojake in earthtojake/text-to-cad. It has 8,994 recorded installs.
More from earthtojake/text-to-cad
cad
earthtojake/text-to-cad
Create/edit parametric CAD models, organize CAD projects, export STEP/STL/3MF/GLB files, resolve prompt references, and measure geometry with cadgen. Open and visually review existing STEP/STP, STL, 3MF and GLB files in CAD Viewer.
step-parts
earthtojake/text-to-cad
Find, evaluate, and download common purchasable CAD parts from step.parts, including named off-the-shelf actuators, servos, motors, electronics boards, connectors, screws, bolts, nuts, washers, bearings, standoffs, and other catalog components. Use when Codex needs to search the hosted step.parts catalog before creating simplified placeholder geometry, resolve fuzzy part names, standards, aliases, or dimensions, choose a matching part, fetch a canonical .step file, verify checksums, or use the step.parts API/OpenAPI/catalog endpoints for standard part discovery.
sdf
earthtojake/text-to-cad
SDFormat/SDF model and world authoring, validation, and simulator handoff. Use for .sdf files, SDFormat XML, models, worlds, links, joints, poses, frames, inertials, visual/collision geometry, mesh URIs, sensors, lights, physics, plugins, includes, Gazebo, static SDF review, or simulator-specific metadata. Do not use for signed-distance-field geometry. Open and visually review existing SDF files in CAD Viewer.
urdf
earthtojake/text-to-cad
URDF robot description authoring and validation. Use when creating, editing, inspecting, validating, or debugging .urdf files, robot links, joints, limits, inertials, visual/collision geometry, mesh references, frame conventions, or robot-description artifacts. Use the SRDF skill for MoveIt2 semantic groups and IK/path-planning semantics; use the CAD skill for STEP/STL/3MF/DXF/GLB outputs. Open and visually review existing URDF files in CAD Viewer.
srdf
earthtojake/text-to-cad
MoveIt2 SRDF authoring, validation, and planning-semantics workflow. Use when creating, editing, inspecting, or validating .srdf files, MoveIt planning groups, virtual joints, passive joints, end effectors, group states, disabled collisions, URDF-paired planning semantics, or SRDF handoff for live review. Use the URDF skill for robot structure and the SDF skill for simulator descriptions. Open and visually review existing SRDF files in CAD Viewer.
sendcutsend
earthtojake/text-to-cad
Review DXF and STEP/STP uploads for SendCutSend.com orders using its ordering guide, catalog, and specs. Use only for SendCutSend.com preflight reports covering upload readiness, selected material/SKU/thickness/service availability, and service-specific checks for laser cutting, CNC routing, bending, tapping, countersinking, hardware insertion, and finishing.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.