CAD-as-Code, in a box
A turnkey workspace for parametric CAD as software. Reopen this repo in any Dev Containers-capable editor or cloud workspace — VS Code, Cursor, GitHub Codespaces, and many other clients — and you get a complete modeling environment: IDE, live 3D viewer, automated tests, export tooling, and a CI/CD pipeline already wired together.
Define geometry with build123d, preview it in the OCP CAD Viewer, validate it with pytest and quality checks, then export STEP, STL, GLB, and release assets from the same source. Python in cad/ is the source of truth; generated files are outputs, not files you hand-manage.
If you are new to software-style workflows, that is the point of the template: the non-CAD pieces are all here and configured so your CAD work is repeatable, inspectable, and automated so that you can focus on design and modeling. If a term is unfamiliar, start with the glossary and follow the linked guide from there.
The default workspace: source code, live model preview, and agent assistance sharing the same containerized CAD environment.
A section cut through the demo sphere assembly, showing the kind of interior geometry the OCP CAD Viewer can inspect while you iterate.
What's in the box
| Layer | What you get |
|---|---|
| IDE | Dev container (.devcontainer/) for VS Code, Cursor, Codespaces, and more; dependencies and docs site start with the workspace |
| Modeling | build123d parts and assemblies under cad/ |
| Visualization | OCP CAD Viewer plus the ocp-vscode bridge for show_object |
| Quality | ruff linting, mypy type checks, and vulture dead-code detection |
| Commands | just command runner for development, export, and CI/CD pipeline tasks |
| CI/CD pipeline | Dagger plus GitHub Actions for repeatable checks and releases |
| Agents | Optional AI assistance from tools such as Cursor, Claude, and GitHub Copilot |
| MCP | Agent tools in the dev container: build123d-mcp and ocp-viewer-mcp |
| Publish | MakerRepo decorators and mr CLI for artifact discovery and export |
Stack architecture
The source of truth is always Python model code in cad/. Editors and AI tools work around that source, while commands, quality checks, export tools, and the CI/CD pipeline all regenerate results from it. That keeps changes reviewable: the model code changes first, and artifacts follow from repeatable automation.
Stack
| Tool | Role |
|---|---|
| build123d | Parametric CAD-as-Code on Open CASCADE |
| OCP CAD Viewer | Live 3D visualization in VS Code-based IDEs |
| ocp-vscode | Python bridge for show_object |
| uv | Dependency and virtualenv management |
| just | Command runner for development, export, and CI/CD pipeline tasks |
| pytest | Geometry and export tests |
| ruff / mypy / vulture | Linting, type checking, and dead-code detection |
| Dagger | Portable CI/CD pipeline from local runs to GitHub Actions |
| build123d-mcp | MCP interface for sandboxed geometry execution by agents |
| ocp-viewer-mcp | MCP interface for viewer screenshots and visual feedback |
| MakerRepo | @artifact, @customizable, and @cached decorators |
| makerrepo-cli | Artifact discovery, export, and viewer integration |
New repo from the template?
If you used Use this template:
- Follow Create and initialize your repository: Use this template, edit
template.repo.toml, then runjust init. - Complete Set up GitHub for Actions, Pages, branch protection, and merge settings.
- Read Releases before publishing generated assets.
Details: Replace the template identity.
Explore the docs
| Area | Start here |
|---|---|
| Getting started | Quick start · Create and initialize · GitHub setup · Releases · Project layout · IDEs and workspaces |
| Modeling | Conventions · Parts and assemblies · Testing strategy · External libraries |
| Tools | just · uv and quality · MakerRepo · MCP servers · CAD tooling |
| Workflows | Daily development · Export and formats · CI/CD pipeline and Dagger · Releases |
| Reference and help | Glossary · Troubleshooting · Open CASCADE · For agents |
Roadmap
- Additional parts and real assemblies: constraints, patterns, and reusable project structure.
- build123d part libraries and PartCAD integration.
- Bills of materials from assemblies.
- Manufacturing export profiles that let one model target different processes: printer-specific margins for Bambu or Prusa workflows, tighter CNC machining clearances, and reusable shop defaults for generated release artifacts.
- Topology optimization demos, for example dl4to4ocp.