██╗ ██╗██╗██████╗ ███████╗ ██████╗███╗ ██╗ ██████╗
██║ ██║██║██╔══██╗██╔════╝ ██╔════╝████╗ ██║██╔════╝
██║ ██║██║██████╔╝█████╗ ██║ ██╔██╗ ██║██║
╚██╗ ██╔╝██║██╔══██╗██╔══╝ ██║ ██║╚██╗██║██║
╚████╔╝ ██║██████╔╝███████╗ ╚██████╗██║ ╚████║╚██████╗
╚═══╝ ╚═╝╚═════╝ ╚══════╝ ╚═════╝╚═╝ ╚═══╝ ╚═════╝
A modern, Fanuc-style CNC simulator with AI-powered G-Code assistance
- Progressive Path Drawing - Toolpaths appear line-by-line as the program executes, just like a real CNC
- Real-Time Position Display - Live X, Z, Tool, Spindle Speed, and Feedrate overlay
- 2D Visualization - Interactive lathe simulation with zoom, pan, and click-to-jump
- Collision Detection - Automatic chuck limit warnings with visual highlights
- Dual AI Support - Works with both Claude (cloud) and Ollama (local)
- Smart Code Review - Analyzes G-Code for policy violations and safety issues
- Code Generation - Generate G-Code snippets from natural language
- Context-Aware - Understands your tooling, material, and machine configuration
- Syntax Highlighting - Fanuc-style color coding with line numbers
- Autocomplete & IntelliSense - Context-aware G/M-code completion with Ctrl+Space
- Tool Library - Quick access with double-click insertion, right-click to edit (in-app editor)
- Macro Library - Reusable G-Code macros (G65, M98) with in-app editor
- Find & Replace - Full-featured search with Ctrl+F/Ctrl+H, regex support
- Recent Files - Quick access to last 5 programs
- Settings Dialog - In-app configuration editor (machine, AI, paths, UI)
- Policy Engine - Enforce safety rules and coding standards
- G41/G42 Compensation - Tool nose radius compensation with arc handling and corner intersections
- CAMotics Integration - 3D simulation support (optional)
- Authentic Look - CRT green on black, yellow highlights
- Control Panel - CYCLE START, FEED HOLD, OPT STOP, SINGLE BLOCK
- Keyboard Shortcuts - F5 for quick sim, Spacebar for cycle start
- Adaptive Scaling - Responsive font sizing for any screen
Coming soon - Add your screenshots to /docs/screenshots/
- Python 3.13 (or 3.10+)
- Ollama (for local AI) - Download
- CAMotics (optional, for 3D simulation) - Download
# Clone the repository
git clone https://github.com/burnshall-ui/vibeCNC.git
cd vibeCNC
# Install dependencies
pip install -r requirements.txt
# Run the application
python vibe_cnc.py# Install Ollama from https://ollama.com
# Pull a model (recommended: granite3.3:8b for speed)
ollama pull granite3.3:8b
# Start Ollama (if not running as service)
ollama serve# Set your API key
setx ANTHROPIC_API_KEY "sk-ant-..."
# Update config.yaml
# Change ai.mode to "claude"- Load a Program -
OPENbutton orCtrl+O - Edit G-Code - Syntax highlighting and line numbers
- Run Simulation - Press
CYCLE START(green button) orSpacebar - Watch Live - Toolpaths draw progressively with real-time position info
- AI Review - Click
KI: ANALYZEfor safety checks - Generate Code - Use
KI: GEN-CODEor type in chat
| Key | Action |
|---|---|
Space |
CYCLE START (run/resume simulation) |
F |
FEED HOLD (pause simulation) |
Esc |
Stop simulation |
F5 |
Quick CAMotics simulation |
Ctrl+Space |
Trigger autocomplete (IntelliSense) |
Ctrl+L |
Lint only (no AI) |
Ctrl+F |
Find dialog |
Ctrl+H |
Find & Replace dialog |
Ctrl+S |
Save file |
Ctrl+Shift+S |
Save and copy to VM |
Ctrl+O |
Open file |
Ctrl++ |
Zoom in |
Ctrl+- |
Zoom out |
- CYCLE START (Green) - Start or resume program execution
- FEED HOLD (Orange) - Pause at current line
- OPT STOP (Gray) - Enable/disable M01 stops
- SINGLE BLOCK (Gray) - Execute one line at a time
Quick Config: Use the in-app ⚙️ SETTINGS button for GUI-based configuration.
Manual Config: Edit config.yaml to customize:
ui:
font_base_pt: 12 # Base font size
dark_bg: "#1A1A1A" # Dark background
fanuc_yellow: "#FFC800" # Accent colorai:
mode: "ollama" # "claude" or "ollama"
offline: false # true = no AI calls
ollama:
base_url: "http://127.0.0.1:11111/api/chat"
model: "granite3.3:8b" # Fast and accurate
anthropic:
model: "claude-sonnet-4-20250514"
api_key_env: "ANTHROPIC_API_KEY"
max_output_tokens: 800machine:
chuck_z_limit: -5.0 # Collision warning threshold
policies:
protected_m_codes: [62, 63, 64, 65] # Don't modify these
require_header_codes: ["G18", "G40", "G80", "G97"]
require_units: "G21" # Metric only
require_origin: "G54" # Work coordinate systemQuick Edit: Right-click any tool in the app → Tool Editor, or use + NEUES TOOL button.
Manual Edit: Edit tools/tools.json:
{
"1": {
"name": "CNMG1204P-SM",
"type": "Drehmeissel",
"insert_radius_mm": 8.2,
"limits": {
"vc_max": 320,
"f_max": 0.4,
"ap_max": 5.0
}
}
}vibe_cnc/
├── vibe_cnc.py # Main application (UI + wiring)
├── config.yaml # Configuration file
├── requirements.txt # Python dependencies
│
├── vibe_cnc/
│ ├── claude_client.py # AI client (Claude + Ollama)
│ ├── gcode_highlighter.py # Syntax highlighting + editor
│ ├── gcode_plotter.py # 2D visualization + live drawing
│ ├── lint_engine.py # Policy enforcement
│ ├── camotics_bridge.py # 3D simulation integration
│ ├── settings_manager.py # Config loader
│ ├── tool_model.py # Tool library
│ └── macro_model.py # Macro library
│
├── tools/
│ ├── tools.json # Tool database
│ └── macros.db # SQLite macro storage
│
└── programs/ # Sample G-Code programs
- Live simulation with progressive drawing
- Real-time position tracking
- Dual AI support (Claude + Ollama)
- Interactive 2D plotter
- Tool and macro libraries with in-app editors
- Fanuc-style controls
- Find & Replace in editor
- G41/G42 tool nose radius compensation
- Settings dialog for configuration
- Recent files list
- Autocomplete & IntelliSense (context-aware G-Code completion)
- Program statistics (cycle time, tool changes)
- Snippet library / favorites
- Network simulation (RPC to LinuxCNC VM)
- DXF import for geometry
- Conversational programming wizard
- Multi-language support (EN/DE)
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Fanuc - For inspiring the UI design
- CAMotics - 3D simulation integration
- Ollama - Local LLM inference
- Anthropic - Claude AI API
- PyQt6 - UI framework
- Matplotlib - 2D plotting
Project Link: https://github.com/burnshall-ui/vibeCNC
Built by machinist and CNC enthusiast
Enhanced with AI by Claude Code