Early docs These pages are very early. Structure and tone are still being worked out, so anything here may change drastically.
Skip to content
Rendered from src/cli/README.md in the repository — edit it there.

Command-Line Interface ​

User-friendly commands for slicing, configuration, and build info.

Commands ​

CommandDoes
sliceModel(s) → G-code
settingsshow · get · set · validate · diff
configshow · init · path — the layered slicer.toml
serveHost the web UI and WebSocket API
infoVersion and build information
changelogRelease notes embedded in this build
gen-schemasRegenerate the JSON schemas the UI consumes
gen-gcode-templatesRegenerate the UI's built-in G-code presets

Slice: model → G-code ​

Convert one or more 3D models to printer-ready G-code. Repeat --input to slice a multi-object build plate — every model is placed in one scene and merged into a single mesh before slicing.

bash
# Basic
slicer-engine slice --input model.stl --output output.gcode

# Multi-object build plate, packed without overlap
slicer-engine slice -i part_a.stl -i part_b.stl --arrange --output plate.gcode

# Custom layer height
slicer-engine slice --input model.stl --output out.gcode --layer-height 0.15

# Klipper firmware flavor
slicer-engine slice --input model.stl --gcode-flavor klipper

# Custom start/end G-code (string or file path)
slicer-engine slice --input model.stl \
  --start-print-gcode "START_PRINT BED_TEMP=60 EXTRUDER_TEMP=210" \
  --end-print-gcode "END_PRINT"

# Force-enable or disable layer lifecycle markers
slicer-engine slice --input model.stl --lifecycle-markers
slicer-engine slice --input model.stl --no-lifecycle-markers

# Use an explicit project config file
slicer-engine slice --input model.stl --config ./slicer.toml

# Center and drop mesh to Z=0 before slicing
slicer-engine slice --input model.stl --center --drop-to-floor --verbose

--export-3mf plate.3mf also saves the placed plate — after every transform and --arrange — as a 3MF that reopens with the same layout.

Transform flags are plate-wide: --translate, --rotate, --scale, --align-face, --center, and --drop-to-floor apply to every --input model, since the CLI has no syntax for addressing a single object. Objects that fall outside the build volume or overlap each other are reported as warnings — the slice still runs.

--center and --drop-to-floor are retained aliases that log a deprecation warning and dispatch the equivalent scene operation. Every transform goes through the scene engine; do not add a flag that bypasses it.

Arguments:

FlagTypeRequiredDefaultPurpose
--inputpath✓–Input model file; repeat for a multi-object plate
--outputpathautoOutput G-code file (<first>_plate.gcode for several models)
--layer-heightfloatfrom settingsSlice spacing (mm)
--gcode-flavorstringfrom settingsmarlin or klipper
--start-print-gcodestringfrom settingsCustom start G-code or file path
--end-print-gcodestringfrom settingsCustom end G-code or file path
--lifecycle-markersflagfrom settingsForce-enable layer lifecycle markers
--no-lifecycle-markersflagfrom settingsForce-disable layer lifecycle markers
--configpathauto-discoverExplicit project slicer.toml path
--centerflagfalseCenter every model horizontally
--drop-to-floorflagfalseDrop every model to Z=0
--arrangeflagfalseNest all models onto the bed by their outlines, without overlap
--arrange-spacingfloat2.0Gap between arranged models, measured between outlines (mm)
--arrange-rotate-stepfloat90.0Rotation step the packer may turn a model by; 0 keeps every angle
--arrange-auto-orientflagfalseAuto-orient each model while arranging (applies the machine's preferred_print_rotation_deg)
--verboseflagfalsePrint mesh stats
--output-formatstringhumanjson or human

Support flags ​

Any of these implies --support, matching the other override groups.

FlagTypeDefaultDescription
--supportflagfalseGenerate support under overhangs
--support-typestringnormalnormal (grid columns) or tree (organic branches)
--support-densityfloat15Support body density, as a percentage
--support-threshold-anglefloat45Overhang angle from vertical (0–89) past which support is added
--support-interface-layersint2Dense contact layers between support and model
--support-on-build-plate-onlyflagfalseOnly support what can reach the bed; overhangs needing a column on the model print unsupported

Settings: Manage Configuration ​

Validate, compare, and modify slicing parameters.
Settings are persisted in ~/.config/slicer-engine/slicer.toml.

Get / Set ​

Both flat aliases and full dot-separated paths are accepted:

bash
# Get — flat alias or full path (equivalent)
slicer-engine settings get layer_height
slicer-engine settings get params.layer_height

# Set — flat alias or full path
slicer-engine settings set layer_height 0.15
slicer-engine settings set params.nozzle_temp 215

# Top-level fields
slicer-engine settings set gcode_flavor klipper
slicer-engine settings set start_print_gcode "START_PRINT BED_TEMP=60 EXTRUDER_TEMP=210"
slicer-engine settings set end_print_gcode "END_PRINT"

# Clear an optional field
slicer-engine settings set start_print_gcode null

# JSON output
slicer-engine settings get gcode_flavor --output-format json

Show / Validate / Diff ​

bash
# Display all persisted settings
slicer-engine settings show
slicer-engine settings show --output-format json

# Validate global and object settings files
slicer-engine settings validate \
  --global global.json --object object.json

# Show differences (what's overridden in an object file)
slicer-engine settings diff \
  --global global.json --object object.json

See Settings Reference for all parameters and the full priority cascade.

Info: Build Information ​

bash
slicer-engine info
slicer-engine info --verbose
slicer-engine info --output-format json

Shows: version, Rust info, Clipper2 details.

Complete Workflow ​

bash
# 1. Set your preferred defaults once
slicer-engine settings set gcode_flavor klipper
slicer-engine settings set params.nozzle_temp 215

# 2. Add a project-specific slicer.toml (overrides user settings for this project)
cat > slicer.toml << 'EOF'
[slicing]
layer_height = 0.15
gcode_flavor = "klipper"
EOF

# 3. Slice — picks up slicer.toml automatically
slicer-engine slice --input cube.stl --output cube.gcode

Input/Output Formats ​

FormatTypeSupportedExample
STLInputASCII, Binarymodel.stl
OBJInputWavefrontmodel.obj
3MFInputMulti-part; each build item becomes an objectplate.3mf
G-codeOutputFFF printermodel.gcode
TOMLConfigUser & projectslicer.toml

Example G-code Snippet ​

gcode
; Generated by slicer-engine | flavor: marlin
G21 ; millimetres
M104 S210 ; set nozzle temp
G28 ; home axes
M109 S210 ; wait for heat

;LAYER_CHANGE
;Z:0.200
;HEIGHT:0.200
;BEFORE_LAYER_CHANGE
;0.200
G92 E0
G1 Z0.200 F9000
;AFTER_LAYER_CHANGE
;0.200
;TYPE:WALL-OUTER
;WIDTH:0.40mm
G1 X10.000 Y10.000 F9000 ; travel
G1 X20.000 Y10.000 E0.12345 F3600

Global Flags ​

bash
slicer-engine --version   # Show version
slicer-engine --help      # Show help
slicer-engine slice --help  # Command help

Error Messages ​

ErrorFix
Cannot read input fileCheck STL path exists
Invalid STL formatRe-export from CAD tool
Invalid config fileFix the TOML syntax
Settings validation failedCheck parameter ranges
Cannot write outputCheck disk space & permissions
Invalid gcode_flavorUse marlin or klipper

See Also ​

  • Mesh Loading – STL, OBJ and 3MF parsing
  • Scene engine – where every transform flag ends up
  • Slicing – How slicing works
  • Settings – Parameter reference and priority cascade
  • Config – slicer.toml discovery and merge order
  • Root – Project overview