Overview
Console Overview
The Cade Console is an interactive REPL (Read-Eval-Print Loop) for debugging and testing the Cade scoring system. It provides real-time inspection of game state, expression evaluation, event triggering, and variable monitoring.
Operating Modes
The console operates in three modes, selected automatically based on terminal capabilities.
TUI Mode
The default mode when running in an interactive terminal. TUI mode provides a full Terminal User Interface with multiple visual panels, real-time monitoring, tab completion, command history, and color output.
cade console
cade console --config my-game.cade
Pipe Mode
The console automatically detects piped input and switches to a non-interactive mode suitable for scripting and automation.
echo "eval 2+2" | cade console
cat <<EOF | cade console
set var.score 1000
eval ${var.score} * 2
exit
EOF
cade console < my_debug_script.txt
echo "inspect score" | cade console | grep "Value:"
Fallback Mode
When the terminal does not support the full TUI, the console falls back to basic line-editing mode. Fallback is triggered when:
- The
TERMenvironment variable is set todumb - No TTY is available (pipes, Docker without
-t, SSH without PTY) - The
CIenvironment variable istrue - The terminal does not support required capabilities
In fallback mode, basic line editing is available but cursor movement within the line, tab completion UI, color output, and Ctrl+R history search are not.
Mode Comparison
| Feature | TUI Mode | Pipe Mode | Fallback Mode |
|---|---|---|---|
| Visual panels | Yes | No | No |
| Color output | Yes | Optional | No |
| Tab completion | Yes | No | No |
| Command history | Yes | No | Stored only |
| Scriptable | No | Yes | No |
| Stdin commands | No | Yes | No |
Terminal Compatibility
Full Support
- Linux – Complete readline with all features in modern terminal emulators (Alacritty, Kitty, GNOME Terminal, Konsole)
- macOS – Full support in Terminal.app and iTerm2
- Windows 10+ – Full support in Windows Terminal
Platform Notes
- On Windows, use
Home/Endinstead ofCtrl+A/Ctrl+EandCtrl+Left/Ctrl+Rightfor word navigation. - On macOS, Meta key combinations may conflict with system shortcuts.
Launching the Console
# Start with the default configuration
cade console
# Load a specific game configuration
cade console --config my-game.cade
# Force pipe mode (disable TUI)
cade console --no-tui
# Enable debug logging
cade console --log-level debug
Once launched, the console displays the prompt:
cade:debug>
Type help for available commands or press Tab for completions.