Documentation
¶
Overview ¶
Package daemonctl starts the gmcli daemon on demand. Clients (the approvals CLI, the MCP server, gmtui) call EnsureRunning before dialing the socket; if nothing is listening, it spawns `gmcli serve --auto` as a detached process and waits for the socket to come up. Auto-started daemons retire themselves after an idle period, so users never manage daemon lifecycle by hand.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureRunning ¶
EnsureRunning makes sure a daemon is listening on layout.Socket, spawning one if needed. A store with no paired session falls back to an offline daemon (archive queries and the approval queue still work; sends and backfills report unavailable until the user pairs).
Types ¶
type Options ¶
type Options struct {
// LogLevel is passed through to the spawned daemon (default "info").
LogLevel string
// Offline forces `serve --auto --offline` (no phone connection).
Offline bool
// StartTimeout bounds the wait for the socket (default 30s).
StartTimeout time.Duration
// IdleExit overrides the spawned daemon's idle-exit duration.
IdleExit time.Duration
}
Options tunes EnsureRunning.