Text-to-CAD Python Requirements: Complete Dependency Guide for Skills-Based CAD Automation
The Text-to-CAD repository manages Python dependencies through isolated per-skill requirements.txt files plus a top-level requirements-dev.txt, with all skills sharing a core cadpy library installed in editable mode from scripts/packages/cadpy.
The text-to-CAD repository from earthtojake/text-to-cad implements CAD generation as a collection of modular agent skills. Understanding the Python requirements structure is essential for deploying individual skills or extending the framework. Each skill maintains its own dependency footprint while sharing a common geometry core.
How Python Dependencies Are Organized
The repository follows a skill-isolation pattern. Every capability—whether generating STEP files, building robot URDFs, or previewing models—lives in its own directory under skills/<skill-name>/ with a dedicated requirements.txt file.
Per-Skill Requirements Breakdown
| Skill | Purpose | Requirements File | Key Packages |
|---|---|---|---|
| CAD | Solid model generation (STEP, STL, 3MF, GLB) | skills/cad/requirements.txt |
playwright, editable cadpy |
| URDF | Robot description files | skills/urdf/requirements.txt |
cadpy |
| SDF | Simulation worlds | skills/sdf/requirements.txt |
cadpy |
| SRDF | MoveIt2 planning metadata | skills/srdf/requirements.txt |
cadpy |
| DXF | 2-D drawing export | skills/dxf/requirements.txt |
cadpy |
| CAD-Viewer | Browser-based preview | skills/cad-viewer/requirements.txt |
playwright, cadpy |
| Development | Linting, testing, type-checking | requirements-dev.txt |
pytest, black, ruff, mypy |
The Shared cadpy Core
All skills depend on a local Python package located at scripts/packages/cadpy. This is installed via an editable link in each skill's requirements.txt:
--editable ./scripts/packages/cadpy
The editable installation ensures that changes to the core geometry utilities propagate instantly across every skill without reinstallation.
Installing Text-to-CAD Python Requirements
Automated Installation via Skills CLI
The recommended path uses the Skills CLI, which handles dependency resolution automatically:
# Install the CAD skill and its Python dependencies
npx skills install earthtojake/text-to-cad#cad
This command:
- Clones or downloads the repository artifact
- Executes
pip install -r skills/cad/requirements.txt - Installs
cadpyin editable mode from the local path
Manual Installation for Development
For custom development or experimentation with the core library:
git clone https://github.com/earthtojake/text-to-cad.git
cd text-to-cad
# Install the core geometry library in editable mode
pip install -e ./scripts/packages/cadpy
# Install runtime dependencies for a specific skill
pip install -r skills/cad/requirements.txt
Development-Only Dependencies
To set up the full development environment—including linting, testing, and type-checking tools:
pip install -r requirements-dev.txt
These packages are never installed during skill-only deployments, preserving minimal runtime footprints.
Why Playwright Is Required
Two skills—CAD and CAD-Viewer—depend on playwright. This package provides a headless Chromium environment used to:
- Render implicit-CAD scenes for snapshot generation
- Capture preview images for the viewer UI
- Execute browser-based model conversion pipelines
The playwright dependency is isolated to these skills, so agents working purely with URDF or DXF generation avoid the overhead of browser automation.
Code Examples Using Installed Requirements
Generating Geometry with cadpy
Once cadpy is installed, create and export solid models:
# example_box.py
from cadpy import Box, Exporter
# Create a 100 × 50 × 20 mm box
box = Box(width=100, depth=50, height=20)
# Export as STEP for downstream CAD workflows
Exporter().write_step(box, "box.step")
Using the CAD Skill Programmatically
With the CAD skill requirements installed:
from skills.cad import CadSkill
cad = CadSkill()
# Generate parametric geometry from natural language
step_path = cad.generate(
prompt="L-bracket 120 mm × 80 mm with 4 mm thickness and 6 mm radius fillet"
)
print(f"Model saved to: {step_path}")
The CadSkill class wraps the cadpy API and automatically routes outputs to the CAD Viewer for preview.
Launching the CAD Viewer
After installing the viewer skill:
npx skills install earthtojake/text-to-cad#cad-viewer
# Serve local models directory
cad-viewer serve --dir $(pwd)/models
The viewer starts at http://127.0.0.1:4178 by default.
Key Files for Python Requirements
scripts/packages/cadpy/— Core geometry library sourceskills/<skill>/requirements.txt— Per-skill dependency listsrequirements-dev.txt— Repository-wide development tools
Summary
- Skill isolation: Each capability has its own
requirements.txtatskills/<skill>/requirements.txt - Shared core: All skills link to
cadpyvia--editable ./scripts/packages/cadpy - Browser automation:
playwrightis required only for CAD generation and viewer skills - Development tools: Separated into root-level
requirements-dev.txt - Installation paths: Use
npx skills installfor automation or manualpipcommands for development
Frequently Asked Questions
What Python version does Text-to-CAD require?
The repository targets Python 3.10+ based on the cadpy package configuration and playwright compatibility requirements. Check scripts/packages/cadpy/pyproject.toml for the exact version spec.
Can I use a skill without installing Playwright?
Yes. Skills like URDF, SDF, SRDF, and DXF have no playwright dependency. Only CAD and CAD-Viewer require it for browser-based rendering and preview generation.
Why is cadpy installed with --editable?
The editable flag creates a symlink rather than copying files, so modifications to scripts/packages/cadpy/ are immediately available to all installed skills without reinstallation. This accelerates development across the multi-skill codebase.
How do I add a new dependency to a skill?
Edit the requirements.txt in the target skill directory. For dependencies used across multiple skills, consider adding them to cadpy itself so all skills inherit the capability through the shared editable install.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →