Transform VS Code into a powerful, intuitive, and comprehensive IDE for G-code. G-code Genius is more than just a visualizer; it's a complete toolkit designed to boost your productivity, precision, and confidence when working with CNC.
Stop switching between different programs. Visualize, format, edit, and analyze toolpaths directly within your favorite code editor.
Bring perfect order to your G-code with a single command. Our formatter now uses the powerful new linting engine to find and fix all fixable errors in the entire file.
- Comprehensive Correction: Automatically splits multiple commands, standardizes capitalization and spacing, cleans up number formats, and more.
- Structure Preservation: Retains your comments and important empty lines, maintaining the logical structure of the file.
How to use: Simply open the Command Palette (Ctrl+Shift+P) and select "Format Document".
Write cleaner, error-free G-code with our new real-time linter. It continuously analyzes your code and highlights issues as you type.
- Instant Feedback: Detects a wide range of common errors, such as:
- Incorrect spacing between commands and parameters.
- Use of lowercase letters for commands (e.g.,
g0instead ofG0). - Improper number formatting (e.g.,
X.5instead ofX0.5, orG01instead ofG1). - Multiple commands on a single line.
- Use of commas instead of periods for decimal points.
- Flexible Quick Fixes: Hover over an error and choose how you want to fix it:
- Fix this issue: Corrects the single selected error.
- Fix all issues of this type: Applies the same fix to all identical errors in the file.
- Fix all fixable issues in file: Cleans up the entire document in one go.
- Toggle Diagnostics: You can enable or disable the error checking at any time.
No more invisible comments on a dark background! Our highlighting system doesn't just colorize your code—it guarantees that every character is readable on any VS Code theme.
- Guaranteed Contrast: Automatically adjusts color lightness to ensure a minimum 4.5:1 contrast ratio. Your text will always be clear.
- Intuitive Colors: Motion commands (
G0,G1,G2/G3) are colored to match their visualization (red for rapid moves, a primary color for feed moves). - Key Parameter Highlighting:
X,Y,Zcoordinates,I,J,Karc parameters, andF/Sfeed/speed commands have unique colors for quick visual analysis.
Instantly see your toolpath in a full 3D view. The visualizer opens with a single click on the icon in the editor's title bar and syncs with your code in real-time.
- Two-Way Sync: Click a line of code, and it's highlighted in 3D. Click a toolpath in 3D, and the cursor jumps to the corresponding line in the editor.
- Powerful Selection Tools:
- Box Selection: Select groups of lines by drawing a rectangle. It works just like in modern CAD software:
- Left-to-right selection grabs only the toolpaths fully contained within the box.
- Right-to-left selection grabs any toolpath that the box intersects.
Shift+ Click: Select a range.Ctrl+ Click: Add/remove from the current selection.Double-Click: Instantly select an entire cutting operation. This intelligently selects a continuous block of feed moves (G1,G2,G3) until a rapid move (G0) or other command breaks the path. It's the fastest way to select a specific feature on your model.- Hover to Highlight: As you move your mouse over the toolpath in the 3D view, the corresponding line is instantly highlighted, making it easy to identify and select the exact path you need.
- Box Selection: Select groups of lines by drawing a rectangle. It works just like in modern CAD software:
- Adaptive Color System: All visualizer colors (lines, background, highlights) automatically adapt to your current VS Code theme for a seamless and comfortable experience.
- Seamless Keyboard Integration: Work faster without leaving the 3D view. Standard keyboard shortcuts work out-of-the-box, directly manipulating the G-code in the text editor.
Ctrl+C/Ctrl+X/Ctrl+V: Copy, cut, or paste the G-code lines for your 3D selection.Ctrl+Z/Ctrl+Y: Undo or redo your last action.Delete: Delete the selected lines.Ctrl+A: Select the entire toolpath.Esc: Clear the current selection.- This creates a fluid workflow where you can visually manage G-code without clicking back into the text editor.
Want to see exactly how the tool will move? When you have a single line selected, a navigation slider appears in the 3D view.
- Scrub Through Time: Drag the slider to smoothly scrub forwards and backwards along the toolpath from your selected point.
- Visualize Tool Motion: This provides an intuitive, frame-by-frame preview of the tool's movement, perfect for understanding complex paths or checking for potential issues without reading a single line of code.
Edit your part's geometry directly from the 3D view. The transformation tools allow you to move and rotate toolpaths with instant visual feedback before applying any changes to the file.
- Move and Rotate: Intuitive panels for precise transformation adjustments.
- Move to Origin: Easily zero out your part. This tool lets you move the entire selection to the origin, with options to set the zero point at the object's center (for centered setups) or its minimum corner (to place the entire object in the positive coordinate space).
- Safe Editing: All changes are shown in a preview mode. You only commit them to your code when you are completely satisfied with the result.
- Install the
G-code Geniusextension from the VS Code Marketplace. - Open any file with a
.gcode,.nc,.cnc, or other common G-code extension. - Click the G-code Genius icon in the top-right of the editor to open the 3D visualization panel.
- To format your code, open the Command Palette (
Ctrl+Shift+P) and run the Format Document command.
A detailed history of all changes is available in our CHANGELOG.md.
G-code Genius is built to be your indispensable assistant in the world of CNC. Try it today!
If you find this extension useful and want to support development or speed up new features:
Donate via:
- 🇺🇦 Donatello — Ukrainian service supporting:
- 💳 Visa/Mastercard
- 🪙 Cryptocurrency (USDT)
- 🏦 Other payment methods
- 🌍 PayPal: [email protected]
Your support helps keep this project alive and growing. Thank you! / Дякую за підтримку! 💙💛
You can contact me via telegram or [email protected].
This project was inspired by the great work on nc_view_vscode.
This project was created with the help of Gemini CLI.



