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:

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

FeatureTUI ModePipe ModeFallback Mode
Visual panelsYesNoNo
Color outputYesOptionalNo
Tab completionYesNoNo
Command historyYesNoStored only
ScriptableNoYesNo
Stdin commandsNoYesNo

Terminal Compatibility

Full Support

Platform Notes

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.