Documentation
¶
Overview ¶
Package cmd implements TaskSmith's command-line interface and commands built on github.com/spf13/cobra.
All commands communicate with the background TaskSmith Brain Daemon over its Unix domain socket using github.com/masterkeysrd/tasksmith/client and github.com/masterkeysrd/tasksmith/api, automatically starting the daemon on demand when not already running.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectOrStart ¶
func ConnectOrStart(ctx context.Context, socketPath string, spawnArgs ...string) (*client.Client, []string, error)
ConnectOrStart connects to an existing Brain Daemon at socketPath, or spawns a detached background daemon process (`os.Executable() daemon serve --socket <socketPath>`) and polls `/v1/health` until ready.
When the running daemon was built from a different version than the client, ConnectOrStart restarts it only once every session is confirmed idle. In any other case — an active session or an unknown session state — the existing daemon is kept and the skew is returned as a user-facing notice so callers can surface it in their own UI; the user then restarts the daemon when it is safe instead of having work interrupted.
func NewRootCmd ¶
NewRootCmd constructs the root `tasksmith` Cobra command and attaches all subcommands (`repl`, `exec`, `daemon`).
Types ¶
This section is empty.