Skip to Content

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

PathPurpose
Persistent.settings.enableConsoleGlobal enable/disable gate for opening the console
Persistent.consoleRuntime console settings (formats, colors, limits, aliases, behavior)
Persistent.console.commandAliasesFull-line alias expansions (fromto)
Persistent.console.readFromStorePageSizePage 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)

KeyAction id
ReturnConsoleSubmit
UpArrowConsoleHistoryNext
DownArrowConsoleHistoryPrevious
TabConsoleSuggestionNext
Shift + TabConsoleSuggestionPrevious
Ctrl + BackspaceConsoleDeleteWordBeforeCursor
Ctrl + CConsoleCancelActions
SlashConsoleToggleVisibility

Functions (InvokeFunction)

FunctionParametersBehavior
InvokeCommandoptional commandTextExecutes a console command line
ClearConsoleClears console logs
GetStateSnapshot of open/input/history/suggestions
ToggleOpenToggles visibility (subject to enable gate)
SetOpenopen (bool)true is rejected (open must come from toggle action); false closes
GetRuntimeSettingsReturns runtime console settings
UpdateRuntimeSettingspatch objectApplies 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