Export
Programmatic export for tests, the CI/CD pipeline, and release automation. Prefer mr CLI for interactive local export.
CLI
Run from the repository root:
# Artifact export verification — discover all @artifact functions, export STEP + STL
uv run python -m cad_tooling.export smoke
# Export one or all artifacts
uv run python -m cad_tooling.export export -o /tmp/out --format step
uv run python -m cad_tooling.export export -o /tmp/out/sphere.stl sphere
# Release bundle — STL + PNG preview per artifact (@render settings applied)
uv run python -m cad_tooling.export release -o dist/
# Generate GitHub Release notes from exported assets
uv run python -m cad_tooling.export release-notes \
--assets-dir dist \
--repo Coffee2Bits/CAD-as-Code-Template \
--tag v0.1.0 \
-o dist/RELEASE_BODY.md
# PR job summary — embedded PNG previews for GitHub Actions (see CI workflow)
uv run python -m cad_tooling.export pr-summary --assets-dir dist
Or via just:
just export-smoke
just export # STL + PNG release bundle to dist/
just export /tmp/out step sphere # single-artifact STEP export
just release-notes v0.1.0
just render-artifact sphere /tmp/out # STL + PNG — see render doc
Headless PNG previews use Render (cad_tooling.render), not mr artifacts snapshot.
Supported formats
| Format | Notes |
|---|---|
step | CAD interchange (preferred) |
stl | Mesh export |
brep | Open CASCADE native |
gltf | Web preview |
3mf | Manufacturing mesh |
Ad-hoc export_part() also writes STEP, STL, and GLB in one call.
Python API
from pathlib import Path
from cad_tooling.export import (
export_artifacts,
export_part,
list_artifacts,
list_generators,
)
artifacts = list_artifacts(Path("."))
export_artifacts(Path("/tmp/out"), "step", ("sphere",))
export_part(make_sphere(), "sphere", "/tmp/out")
export_artifacts() and list_artifacts() power the CI/CD pipeline's artifact export verification and tests/test_makerrepo.py.
The CLI subcommand is named smoke for historical reasons. In CI, it is the artifacts-stage check: it proves every registered artifact can be discovered, realized, and exported as STEP and STL. See Testing strategy.
CI/CD pipeline integration
| Dagger function | Command |
|---|---|
artifacts | python -m cad_tooling.export smoke |
release-artifact | python -m cad_tooling.export release -o /tmp/release-artifacts |
See CI functions and CI/CD pipeline and Dagger.