gcode

Generate, dry-run, and validate FDM G-code from 3D mesh files using slicer CLIs.

465|41|Updated Aug 4, 2026
One-click install
npx skills add https://github.com/autonomous-ai/openharness --skill gcode-autonomous-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gcode
Source: https://github.com/autonomous-ai/openharness/tree/main/store/agents/text-to-cad/skills/gcode
Command: npx skills add https://github.com/autonomous-ai/openharness --skill gcode-autonomous-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires trimesh, and includes scripts (resource) and references (resource) components.

What problem does it solve? Turning a 3D mesh into printer-ready G-code normally requires manual slicer setup, profile selection, and post-slice sanity checks. This Skill orchestrates real slicer CLIs (OrcaSlicer, PrusaSlicer, CuraEngine) so an agent can slice meshes, inspect inputs, and statically validate the resulting G-code without touching a printer. ## Core Features & Use Cases - Backend Discovery and Slicing: Detect installed slicer backends, build the exact CLI command, dry-run it first, then execute with an explicit printer profile JSON. - Input Inspection and Conversion: Classify .stl, .obj, .3mf, .ply, .glb, and .gltf inputs, convert non-native formats to STL via trimesh, and reject out-of-scope files (STEP, DXF, URDF) with structured remediation guidance. - Static G-code Validation: Check generated files for movement commands, extrusion moves, temperature commands, and XYZ motion bounds against the printer profile. - Use Case: Given a new bracket.stl and an OrcaSlicer profile for a 180mm-bed printer, slice it to /tmp/bracket.gcode and confirm the output passes bounds and extrusion checks before handing it to a printer-specific workflow. ## Quick Start Use the gcode skill to slice model.stl with my OrcaSlicer profile JSON, dry-run the command first, then validate the generated G-code.

Frequently Asked Questions about gcode

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I slice an STL file to G-code from the command line?

Run the gcode_tool.py slice command with your input mesh, output path, and a wrapper profile JSON pointing to a native slicer config. Always use --dry-run first to inspect the generated OrcaSlicer, PrusaSlicer, or CuraEngine command before adding --execute.

Which slicer CLI should I use for G-code generation?

The preferred backend order is OrcaSlicer, then PrusaSlicer, then CuraEngine. Bambu Studio is detected but not preferred because its CLI export path has shown macOS instability. Run the discover command to see which backends are installed.

Can I slice STEP, DXF, or URDF files directly to G-code?

No, these formats are rejected because they are not meshes. STEP files must be exported to STL via CAD tooling first, DXF/SVG are 2D drawings requiring 3D modeling, and URDF/SDF robot descriptions require slicing their referenced per-link meshes individually.

Does the G-code validator guarantee a file is safe to print?

No, validation is static only. It checks for movement commands, extrusion moves, temperature commands, and XYZ bounds against the profile, but it does not simulate firmware behavior or extrusion physics. You must still review profile match, temperatures, and start/end G-code.

What mesh formats are supported for slicing?

STL, OBJ, and unsliced 3MF pass directly to the slicer. PLY, GLB, and GLTF are converted to temporary STL at execution time using the trimesh Python package. Already-sliced Bambu .gcode.3mf files are refused to prevent re-slicing.