daemonctl

package
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

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

func EnsureRunning(ctx context.Context, layout paths.Layout, opts Options) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL