Documentation
¶
Overview ¶
Command herrscher is the composition root and CLI for a Herrscher host: it wires the registered gateway/backend/orchestrator plugins and the core into one binary. It exposes the always-on daemon (serve/bridge/service), the session verbs, and the host self-management verbs (init/plugin/update/install). It stays gateway-agnostic: it never imports a concrete chat adapter (dctl lives in the discord-gateway plugin), driving platforms only through the contracts gateway port. Output is deliberately minimal so an LLM driving it spends few tokens.
Config (env): the active gateway plugin declares its own required vars (the discord gateway needs DISCORD_BOT_TOKEN); the host resolves them generically.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
core
|
|
|
bridge
Package bridge implements the bridge as a pure backend runner: the daemon hub owns all gateway I/O and feeds inputs over a control socket, the bridge runs the injected backend per turn and emits events back.
|
Package bridge implements the bridge as a pure backend runner: the daemon hub owns all gateway I/O and feeds inputs over a control socket, the bridge runs the injected backend per turn and emits events back. |
|
cli
Package cli is the native, channel-agnostic command dispatcher.
|
Package cli is the native, channel-agnostic command dispatcher. |
|
config
Package config loads the daemon's declarative defaults from a user-authored ~/.config/herrscher/config.json.
|
Package config loads the daemon's declarative defaults from a user-authored ~/.config/herrscher/config.json. |
|
envx
Package envx resolves the daemon's environment variables under the HERRSCHER_ prefix.
|
Package envx resolves the daemon's environment variables under the HERRSCHER_ prefix. |
|
internal/agent
Package agent models a durable companion agent: a persistent home directory holding the agent's persona (SOUL.md), its MCP server declaration (mcp.json), and its Claude settings (settings.json).
|
Package agent models a durable companion agent: a persistent home directory holding the agent's persona (SOUL.md), its MCP server declaration (mcp.json), and its Claude settings (settings.json). |
|
internal/control
Package control is the bridge's control channel: a per-session local socket (or named pipe on Windows) the daemon hub accepts on and the bridge dials.
|
Package control is the bridge's control channel: a per-session local socket (or named pipe on Windows) the daemon hub accepts on and the bridge dials. |
|
internal/forge
Package forge wraps the gh / glab CLIs to list and clone remote repos.
|
Package forge wraps the gh / glab CLIs to list and clone remote repos. |
|
internal/instanceid
Package instanceid resolves and validates the per-daemon instance identifier used to namespace global resources (git branches, worktree paths, channel titles) so multiple daemons can share one gateway home.
|
Package instanceid resolves and validates the per-daemon instance identifier used to namespace global resources (git branches, worktree paths, channel titles) so multiple daemons can share one gateway home. |
|
internal/metrics
Package metrics is a lightweight in-process metrics registry (atomic counters plus a bounded latency reservoir, stdlib only).
|
Package metrics is a lightweight in-process metrics registry (atomic counters plus a bounded latency reservoir, stdlib only). |
|
internal/obs
Package obs is the operator-observability seam.
|
Package obs is the operator-observability seam. |
|
internal/redact
Package redact scrubs credential-shaped substrings from external command output before it is surfaced in an error, and caps the size so a misbehaving tool can't flood logs.
|
Package redact scrubs credential-shaped substrings from external command output before it is surfaced in an error, and caps the size so a misbehaving tool can't flood logs. |
|
service
Package service installs the `herrscher serve` daemon as a native, boot-started background service on Linux (systemd user unit), macOS (launchd LaunchAgent), and Windows (Task Scheduler onlogon task).
|
Package service installs the `herrscher serve` daemon as a native, boot-started background service on Linux (systemd user unit), macOS (launchd LaunchAgent), and Windows (Task Scheduler onlogon task). |
|
skills
Package skills discovers SKILL.md skills and runs a progressive-disclosure engine that injects a skill menu into a turn and expands a skill's body on demand — so backends that do not load skills natively can still use them.
|
Package skills discovers SKILL.md skills and runs a progressive-disclosure engine that injects a skill menu into a turn and expands a skill's body on demand — so backends that do not load skills natively can still use them. |
|
Package manage is the host's self-management surface: it edits the managed plugins.go composition and rebuilds the binary.
|
Package manage is the host's self-management surface: it edits the managed plugins.go composition and rebuilds the binary. |
|
plugins
|
|
|
terminal
Package terminal is the terminal gateway plugin: a chat gateway whose "channels" are tabs in the local TUI.
|
Package terminal is the terminal gateway plugin: a chat gateway whose "channels" are tabs in the local TUI. |
|
terminal/tui
Package tui renders a gateway's live event stream and captures the operator's input, driving it through the narrow Backend interface.
|
Package tui renders a gateway's live event stream and captures the operator's input, driving it through the narrow Backend interface. |