Configuration
Configuration
The console reads its settings from an HCL file that controls the prompt, history, display, colors, completion, startup commands, and session behavior.
You can write this file by hand, or capture your live settings from inside the console with config save.
File Location
On startup the console looks for, in order (earlier entries win):
./.cade-console.hcl(project-local, relative to the working directory)~/.cade_console_config.hcl(the per-user default, and whereconfig savewith no argument writes)~/.cade/console.hcl(a third, older location — kept but not preferred)
Point it somewhere else with --console-config:
cade console --console-config ./my-console.hcl
Only .hcl is supported — any other extension is rejected. config save with no path writes ~/.cade_console_config.hcl.
Every block below, including the nested
score_formatandcustomblocks, is optional — omit a block entirely and it keeps every one of its defaults, the same as omitting an individual attribute inside a block you do write. A file with just aprompt {}and ahistory {}loads cleanly; nothing fails with a missing-block error.
Individual attributes within a block you do write are likewise optional — anything you leave out keeps its default.
Note: This file is plain HCL data. Unlike
.cadetable files it is evaluated without variables, locals, or functions, sovar.,local., andenv()do not work here — write literal values.
Example
prompt {
format = ""
show_player = true
show_watched_count = true
show_variable_count = true
prefix = "cade"
suffix = "> "
}
history {
enabled = true
file_path = ""
max_entries = 1000
save_on_exit = true
ignore_duplicates = true
ignore_space = false
case_sensitive_search = false
}
display {
show_welcome = true
show_goodbye = true
output_format = "normal"
show_timestamps = false
timestamp_format = "15:04:05"
clear_on_startup = false
score_format {
style = "commas"
thousand_separator = ","
}
}
colors {
enabled = true
scheme = "default"
custom {}
}
completion {
enabled = true
case_sensitive = false
show_descriptions = true
max_suggestions = 20
use_optimized = true
}
startup {
commands = [
"watch var.score",
]
scripts = []
default_player = "debug"
auto_load_session = false
}
session {
auto_save = false
auto_save_interval = 300
auto_restore = false
session_dir = ""
save_output = true
max_output_lines = 1000
}
debug {
enabled = false
tui_enabled = false
tui_log_path = "/tmp/tui_debug.log"
performance_timing = false
verbose = false
}Options Reference
Prompt
| Option | Type | Default | Description |
|---|---|---|---|
format | string | "" | Custom prompt format; empty uses prefix/suffix |
show_player | bool | true | Show the active player |
show_watched_count | bool | true | Show the count of watched variables |
show_variable_count | bool | true | Show the count of set variables |
prefix | string | "cade" | Text before the prompt |
suffix | string | "> " | Text after the prompt |
format accepts these placeholders:
| Placeholder | Expands to |
|---|---|
%p | Active player |
%w | Watched-variable count |
%v | Variable count |
%s | The suffix value |
%% | A literal % |
History
| Option | Type | Default | Description |
|---|---|---|---|
enabled | bool | true | Enable persistent command history |
file_path | string | "" | History file; empty means ~/.cade_debug_history |
max_entries | int | 1000 | Maximum entries kept; 0 means unlimited |
save_on_exit | bool | true | Save history when the console exits |
ignore_duplicates | bool | true | Do not store consecutive duplicate commands |
ignore_space | bool | false | Do not store commands starting with a space |
case_sensitive_search | bool | false | Case-sensitive history search |
max_entries must not be negative; values below 10 or above 10000 load but warn. If you set file_path, its parent directory must already exist.
Display
| Option | Type | Default | Description |
|---|---|---|---|
show_welcome | bool | true | Show the welcome message on startup |
show_goodbye | bool | true | Show the goodbye message on exit |
output_format | string | "normal" | Verbosity: compact, normal, or verbose |
show_timestamps | bool | false | Prefix output with timestamps |
timestamp_format | string | "15:04:05" | Timestamp layout |
clear_on_startup | bool | false | Clear the screen on start |
Score Format
Nested inside display, and itself optional — omit it and scores render as comma-grouped.
| Option | Type | Default | Description |
|---|---|---|---|
style | string | "" → renders as commas | raw, commas, abbreviated, or custom |
use_thousand_separator | bool | false | Accepted, but has no effect: style alone decides whether separators appear |
thousand_separator | string | "" → renders as , | Separator character |
abbreviate | bool | false | Accepted, but has no effect: use style = "abbreviated" for 1.2M-style scores |
custom_format | string | "" | A printf-style format string, used only when style = "custom" |
custom_format takes a format of %[flags][width][.precision]verb, with two verbs — d for a plain integer and a for SI-abbreviated (1.2M) — and flags , (comma grouping), 0 (zero-pad), + (always show sign), and - (left-justify):
display {
score_format {
style = "custom"
custom_format = "%012,d" # zero-padded to 12 digits, with commas
}
}Other examples: %d (plain), %,d (comma-grouped), %.1a (abbreviated to one decimal). Setting custom_format without style = "custom" loads fine but is ignored with a warning; style = "custom" with an empty or unparseable custom_format is a load error.
Colors
These control the console’s own output colors, independent of the TUI theme.
| Option | Type | Default | Description |
|---|---|---|---|
enabled | bool | true | Enable colored output |
scheme | string | "default" | default, solarized, monokai, or custom |
The nested custom block sets individual colors, used when scheme = "custom". Each value must be an ANSI escape sequence:
colors {
enabled = true
scheme = "custom"
custom {
error = "\033[91m"
success = "\033[92m"
warning = "\033[93m"
}
}Available keys: command, keyword, string, number, variable, operator, error, success, warning, info, prompt, player.
Tip: The
solarizedandmonokaischemes set every color exceptoperator, which keeps the default. Setoperatorexplicitly under acustomscheme if that matters to you.
Completion
| Option | Type | Default | Description |
|---|---|---|---|
enabled | bool | true | Enable tab completion |
case_sensitive | bool | false | Case-sensitive matching |
show_descriptions | bool | true | Show descriptions alongside completions |
max_suggestions | int | 20 | Maximum suggestions displayed |
use_optimized | bool | true | Use the optimized completion engine |
Values below 5 or above 100 for max_suggestions load but warn.
Startup
| Option | Type | Default | Description |
|---|---|---|---|
commands | list(string) | [] | Commands to run on startup |
scripts | list(string) | [] | Script files to load on startup |
default_player | string | "debug" | Player selected at start |
auto_load_session | bool | false | Restore the previous session |
Startup commands are screened — entries containing rm , del , format, dd , or mkfs are rejected.
Session
The only optional block.
| Option | Type | Default | Description |
|---|---|---|---|
auto_save | bool | false | Automatically save session state |
auto_save_interval | int | 300 | Auto-save interval in seconds |
auto_restore | bool | false | Restore the previous session on startup |
session_dir | string | "" | Directory for session files |
save_output | bool | true | Include console output in saved sessions |
max_output_lines | int | 1000 | Maximum output lines saved |
Debug
| Option | Type | Default | Description |
|---|---|---|---|
enabled | bool | false | Enable debug logging |
tui_enabled | bool | false | Enable TUI debug logging |
tui_log_path | string | "/tmp/tui_debug.log" | Where TUI debug logs are written |
performance_timing | bool | false | Log performance timings |
verbose | bool | false | Include stack traces in errors |
Command History
History is written to ~/.cade_debug_history unless history.file_path says otherwise. It loads on startup and saves on exit when save_on_exit is enabled; max_entries caps it, trimming oldest-first.
The history command with no arguments lists recent commands:
cade:debug> history 5See Querying Game History for its subcommands, which query recorded games rather than typed commands.
Hot Reload
The console watches its config file and reapplies changes without a restart. Saves are debounced by 500 ms, so rapid edits coalesce into one reload.
Every reload is validated first. If the new file is invalid, the console keeps the previous config and reports:
⚠️ Config reload failed: <error> (keeping previous config)These are preserved across a reload:
- The active player
- Watched variables and watched expressions
- Variables you have set
Colors, display settings, completion, and history are rebuilt immediately. Prompt changes appear at the next prompt.
Trigger a reload or inspect its state by hand:
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 applyingNote: Hot reload only runs when a config file exists at one of the searched paths. Without one,
reloadreportshot reload is not enabled (no config file found)— create the file (easiest viaconfig save) and restart.