# Text-to-CAD Python Requirements: Complete Dependency Guide for Skills-Based CAD Automation

> Master Text-to-CAD Python requirements with this guide. Explore isolated per-skill requirements.txt files and the shared cadpy library for efficient CAD automation.

- Repository: [earthtojake/text-to-cad](https://github.com/earthtojake/text-to-cad)
- Tags: dependency-guide
- Published: 2026-08-04

---

**The Text-to-CAD repository manages Python dependencies through isolated per-skill [`requirements.txt`](https://github.com/earthtojake/text-to-cad/blob/main/requirements.txt) files plus a top-level [`requirements-dev.txt`](https://github.com/earthtojake/text-to-cad/blob/main/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`](https://github.com/earthtojake/text-to-cad/blob/main/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`](https://github.com/earthtojake/text-to-cad/blob/main/skills/cad/requirements.txt) | `playwright`, editable `cadpy` |
| **URDF** | Robot description files | [`skills/urdf/requirements.txt`](https://github.com/earthtojake/text-to-cad/blob/main/skills/urdf/requirements.txt) | `cadpy` |
| **SDF** | Simulation worlds | [`skills/sdf/requirements.txt`](https://github.com/earthtojake/text-to-cad/blob/main/skills/sdf/requirements.txt) | `cadpy` |
| **SRDF** | MoveIt2 planning metadata | [`skills/srdf/requirements.txt`](https://github.com/earthtojake/text-to-cad/blob/main/skills/srdf/requirements.txt) | `cadpy` |
| **DXF** | 2-D drawing export | [`skills/dxf/requirements.txt`](https://github.com/earthtojake/text-to-cad/blob/main/skills/dxf/requirements.txt) | `cadpy` |
| **CAD-Viewer** | Browser-based preview | [`skills/cad-viewer/requirements.txt`](https://github.com/earthtojake/text-to-cad/blob/main/skills/cad-viewer/requirements.txt) | `playwright`, `cadpy` |
| **Development** | Linting, testing, type-checking | [`requirements-dev.txt`](https://github.com/earthtojake/text-to-cad/blob/main/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`](https://github.com/earthtojake/text-to-cad/blob/main/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:

```bash

# Install the CAD skill and its Python dependencies

npx skills install earthtojake/text-to-cad#cad

```

This command:
1. Clones or downloads the repository artifact
2. Executes `pip install -r skills/cad/requirements.txt`
3. Installs `cadpy` in editable mode from the local path

### Manual Installation for Development

For custom development or experimentation with the core library:

```bash
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:

```bash
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:

```python

# 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:

```python
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:

```bash
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 source
- `skills/<skill>/requirements.txt` — Per-skill dependency lists
- [`requirements-dev.txt`](https://github.com/earthtojake/text-to-cad/blob/main/requirements-dev.txt) — Repository-wide development tools

## Summary

- **Skill isolation**: Each capability has its own [`requirements.txt`](https://github.com/earthtojake/text-to-cad/blob/main/requirements.txt) at `skills/<skill>/requirements.txt`
- **Shared core**: All skills link to `cadpy` via `--editable ./scripts/packages/cadpy`
- **Browser automation**: `playwright` is required only for CAD generation and viewer skills
- **Development tools**: Separated into root-level [`requirements-dev.txt`](https://github.com/earthtojake/text-to-cad/blob/main/requirements-dev.txt)
- **Installation paths**: Use `npx skills install` for automation or manual `pip` commands 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`](https://github.com/earthtojake/text-to-cad/blob/main/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`](https://github.com/earthtojake/text-to-cad/blob/main/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.