Console
Internal service/architecture reference for the in-game console. For command syntax and day-to-day usage, see Console (extending).
The service id is Console. Runtime behavior is split across:
GnosisConsoleService: service function surface and input-action bridge.PersistentConsoleService: singleton runtime state (input/history/suggestions/logs).GnosisConsoleCommandInvoker: built-in console commands and reflection-based command table.ConsoleAdapter: Unity UI bridge (TMP, scroll, Unity log hook).
State
| Path | Purpose |
|---|---|
Persistent.settings.enableConsole | Global enable/disable gate for opening the console |
Persistent.console | Runtime console settings (formats, colors, limits, aliases, behavior) |
Persistent.console.commandAliases | Full-line alias expansions (from → to) |
Persistent.console.readFromStorePageSize | Page size used by ReadFromStore (default 1024) |
ReadFromStore / WriteToStore operate on live State.Root (Persistent/Ephemeral) through the invoker commands documented on the extending page.
How it looks in persistent.json
persistent.json (excerpt)
{
"Persistent": {
"settings": {
"enableConsole": true
},
"console": {
"suggestionDisplayOrder": "Descending",
"autoScroll": "OnInvoke",
"showPopupDisplay": true,
"maxSuggestionDisplaySize": -1,
"useFuzzySearch": false,
"collapseSuggestionOverloads": true,
"maxStoredLogs": 1024,
"readFromStorePageSize": 1024,
"maxLogSize": 16384,
"commandLogFormat": "gnosis > {0}",
"unityLogFormat": "unity > {0}",
"commandLogColor": "#39FF14FF",
"unityLogColor": "#DDDDDDFF",
"warningLogColor": "#FF8000FF",
"errorLogColor": "#FF0000FF",
"suggestionColor": "#808080FF",
"selectedSuggestionColor": "#FFFF8CFF",
"defaultReturnValueColor": "#FFFFFFFF",
"typeColorRules": "System.String=#8BE9FDFF;System.Boolean=#50FA7BFF;System.Int32=#FFB86CFF;System.Int64=#FFB86CFF;System.Single=#FF79C6FF;System.Double=#FF79C6FF;System.Decimal=#FF79C6FF;System.DateTime=#BD93F9FF;System.TimeSpan=#BD93F9FF;System.Guid=#F1FA8CFF",
"collectionFormatRules": "System.Array=[|, |];System.Collections.Generic.List`1=[|, |];System.Collections.Generic.Dictionary`2={|, |};System.Collections.Generic.HashSet`1={|, |}",
"prependTimestamps": false,
"verboseErrors": false,
"commandAliases": [
{ "from": "clear()", "to": "CallService(\"Console\", \"ClearConsole\", \"{}\")" },
{ "from": "ls()", "to": "ListServices()" },
{ "from": "Hierarchy()", "to": "CallService(\"Unity\", \"GetSceneHierarchy\", \"{}\")" }
]
}
}
}Events
None.
Input arrives through REQUEST_INPUT_ACTION payloads (from input adapters), including ids like ConsoleToggleVisibility, ConsoleSubmit, history/suggestion navigation, and cancel/delete helpers.
Default keybindings (desktop)
| Key | Action id |
|---|---|
Return | ConsoleSubmit |
UpArrow | ConsoleHistoryNext |
DownArrow | ConsoleHistoryPrevious |
Tab | ConsoleSuggestionNext |
Shift + Tab | ConsoleSuggestionPrevious |
Ctrl + Backspace | ConsoleDeleteWordBeforeCursor |
Ctrl + C | ConsoleCancelActions |
Slash | ConsoleToggleVisibility |
Functions (InvokeFunction)
| Function | Parameters | Behavior |
|---|---|---|
InvokeCommand | optional commandText | Executes a console command line |
ClearConsole | — | Clears console logs |
GetState | — | Snapshot of open/input/history/suggestions |
ToggleOpen | — | Toggles visibility (subject to enable gate) |
SetOpen | open (bool) | true is rejected (open must come from toggle action); false closes |
GetRuntimeSettings | — | Returns runtime console settings |
UpdateRuntimeSettings | patch object | Applies runtime settings patch |
Usage example — invoke from another service
ConsoleService.Example1.cs
private void RunConsoleCommand(string line)
{
if (Context?.Store == null || Context.CallService == null)
return;
var args = GnosisNode.CreateObject(Context.Store);
args.Set("commandText", line ?? string.Empty);
CallService("Console", "InvokeCommand", args);
}Statistics
None.
Last updated on