Natural language interface for Onshape CAD. Create 3D models by describing what you want in plain English.
- 🎨 Natural Language Interface - Describe what you want to build
- 🔧 CAD Operations - Create documents, sketches, and 3D features
- 💬 Interactive Chat - Rich terminal interface with conversation memory
- 🤖 LLM-Powered - Uses GLM with function calling for reliable operation
- Python 3.12 or higher
- Onshape API credentials
- GLM API key
- Clone the repository:
git clone https://github.com/yourusername/onshape-chat.git
cd onshape-chat- Install dependencies:
pip install -e .- Configure environment variables:
cp .env.example .envEdit .env and add your credentials:
GLM_API_KEY=your-glm-api-key
ONSHAPE_ACCESS_KEY=your-onshape-access-key
ONSHAPE_SECRET_KEY=your-onshape-secret-keyStart the chat interface:
onshape-chatYou: Create a document called "My First Part"
Assistant: Created document 'My First Part' (ID: abc123...)
You: Make a rectangle 50mm wide and 30mm tall on the XY plane
Assistant: Created rectangular sketch (50mm × 30mm) on XY plane
You: Extrude it 20mm
Assistant: Extruded sketch to depth of 20.0mm forward
You: Show me what it looks like
Assistant: Opening your document in Onshape...
/help- Show help message/quitor/exit- Exit the chat/clear- Clear conversation history/state- Show current document state
pytest tests/black src/
ruff check src/onshape-chat/
├── src/onshape_chat/
│ ├── config.py # Configuration management
│ ├── main.py # Entry point
│ ├── llm/ # LLM integration
│ ├── onshape/ # Onshape API client
│ ├── tools/ # Tool implementations
│ └── ui/ # Chat interface
├── docs/ # Documentation
└── tests/ # Tests
See PLAN.md for the full development plan.
- ✅ Basic scaffolding
- ✅ Onshape API client
- ✅ Document management
- ✅ Basic sketches (rectangle, circle)
- ✅ Extrude operation
- ✅ LLM integration
- ✅ CLI chat interface
- Advanced sketch primitives
- Sketch on face
- Fillet and chamfer
- Boolean operations
- Patterns
- Revolve
- Measurement queries
- Assembly operations
- Export (STL, STEP)
- Terminal graphics
- Error recovery
- Undo support
- Web UI
- Voice input
- Image import
- Parametric templates
Contributions welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details
- Built with GLM
- Powered by Onshape API
- UI with Rich