Interactive Mode
Moonriver's interactive mode provides a powerful REPL (Read-Eval-Print Loop) for controlling your printer.
Starting Interactive Mode
Launch Moonriver with connection parameters:
moonriver --host 192.168.1.100 --port 7125You'll see the welcome screen:
🌙 Moonriver - Klipper Console 🌙
Type your G-code commands below. Use Ctrl+D or 'exit' to quit.
Use ',' to separate multiple commands on one line.
Type 'M112' for emergency stop.
>Command Input
Basic Commands
Simply type G-code commands or Klipper macros:
> G28
> M105
> QUERY_ENDSTOPSMultiple Commands
Separate commands with commas:
> G28, M105, GET_POSITIONAll commands execute sequentially.
Case Insensitivity
G-code commands are case-insensitive:
> g28 # Same as G28
> m105 # Same as M105Klipper macros preserve their case.
Tab Completion
Press Tab to autocomplete commands:
> G2<Tab>
G28 G29
> SET_<Tab>
SET_HEATER_TEMPERATURE SET_PRESSURE_ADVANCE SET_VELOCITY_LIMITMacro Completion
Tab completion includes your custom Klipper macros:
> PRINT_<Tab>
PRINT_START PRINT_END PRINT_PAUSECommand History
Navigation
↑- Previous command↓- Next commandHome- Beginning of lineEnd- End of line
Search
Press Ctrl+R to search history:
(reverse-i-search)`temp': M105Type to filter, press Enter to execute, or Esc to cancel.
Persistence
Command history is automatically saved to ~/.moonriver_history and loaded on startup.
Syntax Highlighting
Commands are color-coded as you type:
- Green: G-code commands (G0, M105, etc.)
- Cyan: Klipper macros (PRINT_START, etc.)
- White: Unknown/unrecognized commands
Output Coloring
Responses are color-coded for easy readability:
- Green: Successful responses, "ok" messages
- Cyan: Informational messages
- Yellow: Warnings, notices starting with "//"
- Red: Errors, messages containing "error" or "!!"
Example:
> G28
// Homing X Y Z (cyan)
ok (green)
> M105
T:20.5 /0.0 B:21.1 /0.0 (cyan)
> INVALID_COMMAND
!! Unknown command: "INVALID_COMMAND" (red)Keyboard Shortcuts
| Shortcut | Action |
|---|---|
↑ / ↓ | Navigate history |
Tab | Autocomplete |
Ctrl+R | Search history |
Ctrl+C | Cancel current input (doesn't exit) |
Ctrl+D | Exit Moonriver |
Ctrl+L | Clear screen |
Home / Ctrl+A | Beginning of line |
End / Ctrl+E | End of line |
Ctrl+W | Delete word backward |
Ctrl+K | Delete to end of line |
Ctrl+U | Delete entire line |
Special Commands
Exit
Exit Moonriver:
> exitOr press Ctrl+D.
Emergency Stop
Immediately stop the printer:
> M112This sends an emergency stop signal and clears the command buffer.
Real-Time Updates
Moonriver subscribes to printer status updates and displays them automatically:
> M104 S200
// Setting extruder temperature to 200.0
// T:25.3 /200.0
// T:45.2 /200.0
// T:75.8 /200.0
...
// T:200.1 /200.0Tips
Quick Temperature Check
> M105Monitor While Heating
Set temperature and watch updates:
> M104 S200Real-time temperature updates appear automatically.
Combine Common Tasks
> G28, M105, GET_POSITION, QUERY_ENDSTOPSClear Screen
Press Ctrl+L to clear the terminal while keeping your connection.
Next Steps
- Scripting Mode - Automate tasks
- Configuration - Customize behavior
- Features - Learn advanced features