Commands
Command Reference
The Cade Console provides commands for expression evaluation, event simulation, variable management, engine control, gameplay simulation, and debugging.
Type help for the built-in list, or help <command> for detail on one. help -i opens an interactive browser you navigate with arrow keys, search with /, and drill into with Enter.
Command Summary
| Command | Syntax | Description |
|---|---|---|
eval | eval <expression> [--vars k=v] | Evaluate an expression with current variables |
trigger | trigger <event|switch> [key=value ...] | Trigger a scoring event or switch |
set | set <variable> <value> | Set a variable value for the current player |
unset | unset <variable> | Remove a variable |
inspect | inspect <target> [--json|--hcl] | Inspect a variable or event in detail |
watch | watch <variable|expression> | Monitor a variable or expression for changes |
unwatch | unwatch <variable> | Stop monitoring |
player | player [number] | Show or set the active player |
status | status | Display current debug session state |
coin | coin | Insert a coin |
start | start | Queue the next player (consumes a credit) |
go | go | Launch the game with all queued players |
engine | engine <start|stop|pause|resume|restart|reload|status> | Control the scoring engine |
load | load <path> | Load a game configuration file |
config | config save [path] | Persist current console settings to an HCL file |
reload | reload [config|status|diff|--watch] | Reload the console configuration |
history | history [subcommand] | Command history, or query recorded game history |
list-events | list-events [--source <source>] | List available events |
validate-event | validate-event <event> | Check whether an event is valid |
event-info | event-info <event> | Show detailed event information |
profile | profile <start|stop|status|export|reset> | Manage the scoring profiler |
scenario | scenario <list|run|status|warp> | Manage scenario testing |
cascade | cascade <last|export|depth> | Work with captured event cascades |
trace | trace <clear|stats> | Manage the event trace buffer |
session | session | Manage debug sessions |
breakpoint | breakpoint <set|remove|list|clear> [condition] | Manage conditional breakpoints |
watchpoint | watchpoint <add|remove|enable|disable|list> | Manage watchpoints |
mode | mode <off|live|simulation> | Set the debugging mode |
step | step | Step to the next breakpoint |
continue | continue | Continue execution after a breakpoint |
theme | theme [name] | Show or change the color theme |
timestamps | timestamps [on|off] | Toggle timestamp display |
filter | filter <add|remove|list|clear> | Manage log output filters |
loglevel | loglevel <level> | Set log verbosity (DEBUG, INFO, WARN, ERROR) |
tui | tui | Switch to TUI mode |
help | help [command] [-i] | Show help |
clear | clear | Clear the screen |
exit / quit | exit | Exit the console |
step and continue also accept the short forms s and c; breakpoint accepts break, and watchpoint accepts wp.
Expression Evaluation
eval evaluates an expression against the variables in the current session. Reference variables bare — var.score, not ${var.score}:
cade:debug> eval 100 + 50
Result: 150
cade:debug> eval var.score * 2
Result: 2000
cade:debug> eval var.score + (var.bonus.multiplier * 500)
Result: 2500
cade:debug> eval var.score > 1000 && var.multiball.active
Result: falsePass extra variables inline without setting them:
cade:debug> eval var.x + var.y --vars x=10,y=20
Result: 30The console evaluator is a compact calculator — arithmetic, comparison, logic, and min/max/abs. See Expressions for the exact surface, and Writing Expressions for the richer language your .cade files use.
Event Triggering
trigger fires events into the scoring engine — both named scoring events and hardware switches. Extra parameters are given as key=value pairs:
cade:debug> trigger target.hit
Event: target.hit
Player: 1
Total points: 500
New score: 1500
cade:debug> trigger target.hit points=500 multiplier=2
cade:debug> trigger switch.ramp_entryWhen an event is triggered the console captures the resulting cascade. Press F7 to view it, or run cascade last.
Variable Management
Setting
cade:debug> set var.score 1000
Set var.score = 1000 for player 1
cade:debug> set var.bonus.multiplier 3
cade:debug> set var.multiball.active trueValues are parsed as integer, then float, then boolean, then string — so true becomes a boolean and 1000 an integer.
Inspecting
inspect shows detail about a variable or event, auto-detecting which you meant. Switch output format with --json or --hcl:
cade:debug> inspect score
Variable: score
Type: int
Scope: player
Current value: 1,000
Initial value: 0
cade:debug> inspect vars # list all variables
cade:debug> inspect events # list all events
cade:debug> inspect events --live # recent live events from the hardware bridge
cade:debug> inspect bumper.hit # inspect as event: triggers, conditions, actions
cade:debug> inspect score --jsonWatching
cade:debug> watch var.score
Now watching variable: var.score
[WATCH] var.score changed from 1000 to 1500 for player 1
cade:debug> unwatch var.score
Stopped watching variable: var.scorePlayer Management
cade:debug> player
Current player: 1
cade:debug> player 2
Active player set to: 2Simulating a Game
coin, start, and go reproduce the front-of-machine sequence without hardware — useful for exercising attract mode, credits, and multiplayer flow.
cade:debug> coin
Credit! Balance: 1
cade:debug> start
Player 1 joined. Press 'start' to add more players, or 'go' to begin.
cade:debug> start
Player 2 joined. Press 'start' to add more players, or 'go' to begin.
cade:debug> go
Game started with 2 player(s): [Player 1 Player 2]coin grants credits per your coins_per_credit setting — with a value above 1 the console reports Coin accepted (accumulating) until a full credit lands. Each start consumes a credit and queues one more player, up to the configured maximum; start also works mid-game to join a player late. go launches with everyone queued and puts the first ball in play.
Engine Control
cade:debug> engine start
✓ Engine started
cade:debug> engine pause
cade:debug> engine resume
cade:debug> engine restart
cade:debug> engine reload # re-read the table configuration
cade:debug> engine stop
cade:debug> engine statusengine status reports state, running and paused flags, and engine metrics. engine start and engine restart verify the engine actually came up and report the underlying error if it did not — most often a missing or invalid table configuration.
Configuration
Load a table:
cade:debug> load my-game.cadeSave your live console settings so they persist across sessions:
cade:debug> config save
✓ Console config saved to /home/you/.cade_console_config.hcl
cade:debug> config save ./my-console.hclThe path must end in .hcl. The written file round-trips through the loader unchanged, so it is also a good starting point to hand-edit. See Configuration.
Reload the console configuration without restarting:
cade:debug> reload # reload and show what changed
cade:debug> reload config # reload
cade:debug> reload status # config path, version, last reload time
cade:debug> reload diff # compare loaded config against disk, without applyingQuerying Game History
With no arguments, history lists your recent commands. With a subcommand it queries the recorded game history database — a full record of past sessions, scores, and cascades.
| Subcommand | Syntax | Shows |
|---|---|---|
games | history games [N] | Last N game sessions (default 10) |
scores | history scores [N] | Top N player scores (default 10) |
switches | history switches [last N] | Switch hit counts over the last N games (default 5) |
modes | history modes [last N] | Mode statistics over the last N games (default 10) |
ball | history ball <game#> <player> <ball#> | Details for one ball turn |
spans | history spans <game#> | Span tree for a game session |
cascade | history cascade <game#> <correlation_id> | Cascade event tree for a correlation |
queries | history queries | List the available named queries |
query | history query <name> [--param value ...] | Run a named query |
sql | history sql "<query>" | Run arbitrary read-only SQL |
cade:debug> history games 5
cade:debug> history scores
cade:debug> history ball 12 "Player 1" 3
cade:debug> history sql "SELECT name, COUNT(*) FROM switch_hits GROUP BY name"Profiler
profile controls the scoring profiler, which tracks event and expression evaluation performance.
cade:debug> profile start
Profiling started
cade:debug> profile status
Scoring profiler: ACTIVE
Event types tracked: 12
Expression types tracked: 8
Top events by P95 latency:
bumper.hit P95: 45.2 us
cade:debug> profile export ./my-profiles/
Profile exported to: ./my-profiles/scoring_profile_20250315_143022.json
cade:debug> profile stop
cade:debug> profile resetScenario Testing
scenario runs predefined test scenarios against the scoring engine.
cade:debug> scenario list
cade:debug> scenario run tests/basic_scoring.yaml
cade:debug> scenario run --all tests/
cade:debug> scenario status
cade:debug> scenario warp tests/multiball_setup.yamlwarp loads a scenario’s initial state without running its assertions — a fast way to reach a complex game state for manual testing.
You can also play a scenario straight into the live event tree at launch:
cade console --scenario tests/multiball.cade.test
Session Information
cade:debug> status
Debug Session Status
==================
Active Player: 1
Total Players: 4
Variables Set: 3
Watched Variables: 1 (score)
Commands Executed: 15Tab Completion
Completion is context-aware — commands, variables, event names, and subcommands:
cade:debug> he<Tab>
help history
cade:debug> set var.bo<Tab>
var.bonus.active var.bonus.multiplier var.bonus.value
cade:debug> trigger tar<Tab>
target.hit target.dropped target.raised
cade:debug> history q<Tab>
query queriesRunning Commands from Scripts
Every command also works in Pipe mode, where the console reads one command per line from stdin instead of showing the TUI:
cat <<'EOF' | cade console
# lines starting with '#' are comments and are skipped
set var.score 1000
set var.bonus.multiplier 3
eval var.score + (var.bonus.multiplier * 500)
inspect score
exit
EOF
Pipe mode activates automatically when stdin is redirected, or force it with --no-tui. Results print to stdout, so you can filter them with standard tools:
echo "inspect score" | cade console --no-tui | grep "value"
The console returns a non-zero exit code when a command fails, so scripts and CI jobs can detect problems. See Exit Codes.