-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commandog Dispatcher
Sucrose.Commandog.exe is the heart of the Sucrose process model: a short-lived command dispatcher / process broker. Almost every cross-process action — set/restart/cycle the wallpaper, kill a process, open the Portal, run a service, import/export a theme, register startup, show a crash dialog — is performed by spawning Commandog with a single encoded argument string. Commandog parses that string, performs exactly one action (usually by launching the right executable or calling a shared helper), and then exits. It is not a resident service. This page explains how the broker works internally; the full command catalogue lives on the Command Reference page.
Stability disclaimer: Commandog's command string is an internal IPC protocol, not a stable, supported public CLI. End users never type these commands — the UI builds them. The format and the command set may change between versions. See Command Reference and Automation Examples.
- What Commandog is (and is not)
- Entry point and lifecycle
- The command string wire format
- Parse flow
- Typed value parsing
- Routing: what the dispatcher does
- Who emits commands
- See also
-
It is a console (hidden) process at
src/Project/Sucrose.Commandog, re-runnable, that runs one command and exits viaEnvironment.Exit(0). - It is not a long-lived service, and it is not related to the live-data IPC channels (Pipe / Signal / Transmission). Despite the shared "command" wording, Commandog is process-argument based; the live-data transports are described on the IPC page.
Key files: src/Project/Sucrose.Commandog/App.cs (entry point), Helper/Arguments.cs (the command switch), Helper/Parse.cs (typed argument parsing), Helper/Scheduler.cs (Windows Task Scheduler operations), Helper/Miscellaneous.cs (runtime type sniffing for Test). The command enum is src/Shared/Sucrose.Shared.Dependency/Enum/CommandType.cs; the delimiter constants are in src/Library/Sucrose.Memory/Manage/Readonly/General.cs.
App.cs Main():
-
SSDHG.Configure()(graphics — high-performance GPU) andSSDHR.Configure()(runtime — bundled private .NET runtime, RELEASE-only). - Sets
Console.InputEncoding/OutputEncoding = UTF8— required so the✔/✖Unicode delimiters survive (mojibake here means the wrong console encoding). - Sets thread culture from
Sucrose.Manager.Manage.General.Culture. - Runs
Arguments.Parse(args). - Always calls
Environment.Exit(0)infinally— it does not stay resident.
Built from constants in src/Library/Sucrose.Memory/Manage/Readonly/General.cs:
| Constant | Value |
|---|---|
StartCommandChar |
'✔' (U+2714) |
StartCommand |
"✔" |
ValueSeparatorChar |
'✖' (U+2716) |
ValueSeparator |
"✖" |
Layout:
✔<CommandName>✖<Value0>✖<Value1>✖<Value2>...
Examples:
✔Interface✖<path-to-Portal.exe>
✔Interface✖<path-to-Portal.exe>✖GeneralSetting
✔Live✖<path-to-engine.exe>
✔RestartLive✖Unknown
✔Watchdog✖<path-to-Watchdog.exe>✖<Base64(app✖ex✖show✖log)>
Anyone reproducing a command externally must emit these exact ✔ / ✖ characters.
Arguments.Parse (Helper/Arguments.cs):
-
string.Join(" ", args)to recombine the argument tokens into one string. - Require the combined string to
StartsWith("✔")ANDContains("✖"). - Strip the leading
✔(Combined[1..]), thenSplit('✖'). - First segment = command Name; remaining segments = Values (at least one is required; total parts ≥ 2).
-
Enum.TryParse<CommandType>(Name, ignoreCase: true, ...)— command names are case-insensitive. -
switchon the parsedCommandType.
Values are coerced by Parse.ArgumentValue<T> (Helper/Parse.cs):
T |
Conversion |
|---|---|
int |
int.TryParse |
bool |
bool.TryParse |
| an enum type | Enum.Parse |
| anything else | the raw string |
Miscellaneous.GetType(string) sniffs bool first, then int, else string — used only by the diagnostic Test command.
The switch in Arguments.cs maps each CommandType to a side effect. Run(x) below is Sucrose.Shared.Space.Helper.Processor.Run (a ShellExecute); many "open" commands simply pass a path or URL to Run. A representative slice:
| Command | Action in Commandog |
|---|---|
Live |
Run(value) — start the given engine exe directly. |
Kill |
Processor.Kill(name) — kill all processes by name. |
Interface |
Start Portal (Run(portal[, settingPage])); optional 2nd value = settings-page selector (ArgumentCommandType). |
Property / PropertyA
|
Launch Sucrose.Property.exe (the Customize UI), with or without a theme argument. |
Update |
Launch Sucrose.Update.exe (optional 2nd value, run hidden). |
Reportdog / Backgroundog
|
Launch the respective service exe. |
Watchdog |
When exactly 2 values: launch Sucrose.Watchdog.exe with the Base64 error payload (hidden). |
RestartLive |
Stop live + stop subprocess, kill Sucrose.Backgroundog.exe, Run.Start(), wait 1500 ms, retry if not running. (Wallpaper reload.) |
Cycyling |
Same as RestartLive but without killing Backgroundog (wallpaper slideshow advance; note the in-code spelling "Cycyling"). |
Scheduler |
Create / Enable / Disable / Delete a Windows scheduled task (SchedulerCommandType), task name Autorun for Sucrose. |
Startup / StartupM / StartupP
|
Register Windows startup (per-user / machine / priority) via Skylark.Wing. |
Import / Export / Reset / Temp / Versioning
|
Theme/library/file operations through Sucrose.Shared.Space.Helper.* (Import/Export/Reset/Temp are awaited async; Versioning calls the synchronous Delete.Folder). |
Log / Wiki / Report / Publish / Official / Repository / Discussions / QuotingGoogle / QuotingTranslate / Bundle
|
Run(value) — open a URL or file (the Bundle case launches the downloaded installer). |
Test |
Diagnostic echo: prints each typed value to the console. |
The full CommandType table (31 commands), plus ArgumentCommandType (settings-page targets) and SchedulerCommandType, are documented on the Command Reference page. Two sub-enums:
-
ArgumentCommandType:OtherSetting, DonateSetting, SystemSetting, GeneralSetting, PersonalSetting, WallpaperSetting, PerformanceSetting— the 2nd value ofInterface. -
SchedulerCommandType:Create, Enable, Delete, Disable.
Commands are built by the UI and helper layers, never by end users:
-
Launcher tray actions — each tiny static
Command()undersrc/Shared/Sucrose.Shared.Launcher/Command/*.csbuilds a✔...✖...string and callsProcessor.Run(Commandog, ...):Interface.cs→✔Interface✖<Portal>,Setting.cs→✔Interface✖<Portal>✖GeneralSetting,Property.cs→✔Property✖<Property>,Reload.cs→✔RestartLive✖Unknown,Update.cs→✔Update✖<Update>(or...✖Falsefor silent),Reportdog.cs→✔Reportdog✖<Reportdog>,Version.cs→✔Versioning✖<LocalAppData\Sucrose>✖<version>✖false. -
Crash path —
Sucrose.Shared.Space/Helper/Watchdog.csbuilds✔Watchdog✖<Watchdog>✖<Base64 payload>. -
Updater —
Sucrose.Update's MainWindow builds✔Bundle✖<path>to launch the downloaded installer. -
Engine —
Sucrose.Shared.Engine/Event/Handler.csemits✔RestartLive✖Unknown.
Note that Close.cs and Engine.cs are exceptions — they act locally (kill processes / start the engine) and do not route through Commandog.
- Command Reference — the full 31-command catalogue and sub-enums.
- Automation Examples — practical command examples and the stability disclaimer.
- IPC — the separate live-data Pipe / Signal / Transmission channels.
- Architecture Overview — why everything routes through a broker.
- Lifecycle — where Reload / Cycle / Watchdog commands fire during runtime.
Getting Started
- Installation
- System Requirements
- Quick Start
- Portal Interface Tour
- Updating Sucrose
- Uninstalling Sucrose
Wallpaper Types
Using Sucrose
- Managing Library
- Using Store
- Customizing Wallpaper
- Multi-Monitor
- Wallpaper Cycling
- Choosing Engines
- Performance Rules
- Theme, Tray & Startup
- Discord Rich Presence
Settings Reference
- Settings Overview
- Settings: General
- Settings: Personal
- Settings: Performance
- Settings: Wallpaper
- Settings: System
- Settings: Other
- Settings: All Keys
Creating Wallpapers
- Create Overview
- Create: Step By Step
- Create: Package Format
- Create: Customization Controls
- Create: JS Bridge
- Create: Audio API
- Create: System API
- Create: Property Listener & Filters
- Create: Web Architecture
- Create: Compatibility
- Create: Example Wallpapers
- Create: Sharing & Publishing
Engine Reference
- Engines Overview
- Engine: MpvPlayer
- Engine: VlcPlayer
- Engine: WebView
- Engine: CefSharp
- Engine: Nebula
- Engine: Vexana
- Engine: Xavier
- Engine: Aurora
- Engine Comparison
Automation & Command Line
Architecture & Internals
- Architecture Overview
- Lifecycle
- Commandog Dispatcher
- Single-Instance Mutexes
- IPC
- Backgroundog Service
- Crash Reporting
- Update Internals
- Property Service
- Undo Internals
Data, Files & Diagnostics
Building & Contributing
- Building From Source
- Repository Layout
- Shared Item Projects
- Code Conventions
- Preprocessor Symbols
- Publish Pipeline
- Bundle Installer Internals
- Extending Sucrose
- Contributing
- Translating with Localizer
- Localization Coverage
- Security Policy
- Privacy & Telemetry
Help & Support