commands

package
v0.153.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 77 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultInitConfigPath = ".gofer.yaml"

DefaultInitConfigPath is where `gofer init [server]` writes the starter server config when no --config is given: ./.gofer.yaml, the highest-priority current-dir candidate in the loader lookup chain (loader.go CurrentDirConfigNames), so a freshly generated file is picked up automatically.

View Source
const DefaultWorkerConfigPath = "worker.yaml"

DefaultWorkerConfigPath is where `gofer init worker` writes the starter worker config when no --output is given. `gofer worker` reads --worker-config, falling back to <config-dir>/worker.yaml when the flag is omitted (loadWorkerConfig).

Variables

This section is empty.

Functions

func NewAgentCmd

func NewAgentCmd() *gcli.Command

NewAgentCmd builds the `agent` command group (list/detect/show). P3 logic. The config path is the app-level global -c (config.InputCfgFile), not a per-command flag (P1).

func NewApp

func NewApp(version string) *gcli.App

NewApp assembles the gofer gcli application and registers all top-level commands (serve/project/agent/job/mcp/worker). Stopping a backgrounded daemon is a subcommand of its starter: `serve stop` / `worker stop`.

func NewAppWithBuildInfo

func NewAppWithBuildInfo(info buildinfo.Info) *gcli.App

NewAppWithBuildInfo assembles the CLI with linker build metadata available to commands that need to surface it through runtime APIs.

func NewConfigCmd

func NewConfigCmd() *gcli.Command

NewConfigCmd builds the `config` command group. v1 exposes `config validate`, the global counterpart to `project validate <key>`: it loads the config via the lookup chain (including the structural validate(cfg) check) and runs the per-project filesystem/reference checks for every registered project.

func NewHookCmd

func NewHookCmd() *gcli.Command

NewHookCmd builds `gofer hook <agent>` — the executor Claude Code / Codex hook configs call (session relay, SESS-01 D1). It is not meant for humans: it reads the hook payload from stdin, reports the event to the hub and, on Stop with relay on, blocks for the web reply and prints the continuation JSON. It never exits non-zero for hub/network trouble (that would surface in the agent's UI); only a malformed invocation does.

func NewInitCmd

func NewInitCmd(info buildinfo.Info) *gcli.Command

NewInitCmd builds the top-level `gofer init [target]` command (E3). target is `server` (default), `worker`, `client`, or `skill`. For server/worker it writes the matching embedded starter to its default path (./.gofer.yaml / worker.yaml) or --output <path>; for client it writes the client node's <config-dir>/.env starter (the node holds only the connection env — no config file); for skill it installs the embedded gofer-usage/ tree to BOTH .claude/skills/ and .agents/skills/ (--output narrows to one dir). It refuses to overwrite an existing target unless --force is given (design D6).

`gofer init worker --server …` DELEGATES to the CFG-05 wizard (one implementation, two entry points); without --server the worker target keeps writing the embedded template. info is handed to the delegated wizard so its register probe reports the same version the worker itself would.

func NewIssueCmd

func NewIssueCmd() *gcli.Command

func NewJobCmd

func NewJobCmd() *gcli.Command

NewJobCmd builds the `job` command group (run/show/logs/cancel). It wraps the server's /v1/jobs HTTP API so the host can drive jobs without curl (plan §9-P6).

func NewMcpCmd

func NewMcpCmd() *gcli.Command

NewMcpCmd builds the `mcp` command: run the stdio MCP server (plan P8/E28). Two backend modes (E28 D1/D2):

  • client mode (default when --server/GOFER_SERVER_ADDR is set, no --standalone): the mcp process is a thin client — the 10 gofer_* tools forward to a central serve via internal/client. NO Core/DB is built.
  • standalone mode (--standalone, or no server addr resolved): the現状 in-process path — load config + build Core + serve the localBackend, identical to `serve` so the MCP tools never duplicate execution logic.

IMPORTANT: the MCP protocol owns stdout (newline-delimited JSON over stdin/ stdout), so this command MUST NOT print anything to stdout — no startup banner, no logs, in EITHER mode. Errors surface via the returned (coded) error on stderr (finishMcp).

func NewMemoryCmd

func NewMemoryCmd() *gcli.Command

func NewPlanCmd

func NewPlanCmd() *gcli.Command

NewPlanCmd builds the `plan` command group for lightweight job grouping.

func NewPresenceCmd

func NewPresenceCmd() *gcli.Command

NewPresenceCmd builds the `presence` command group: inspect the driver-agent registry and drive the inbox from the CLI (E36). It is the DRIVER-agent surface — distinct from `agent` (which inspects the configured JOB-agents claude/codex/ exec). The design's core二分: driver agents collaborate via the mailbox, job agents are work units. Wraps the server's /v1/agents/* + /v1/messages API.

func NewProjectCmd

func NewProjectCmd() *gcli.Command

NewProjectCmd builds the `project` command group with sub commands list/show/add/remove/validate.

func NewRepoCmd

func NewRepoCmd() *gcli.Command

func NewScheduleCmd

func NewScheduleCmd() *gcli.Command

NewScheduleCmd builds the `schedule` command group. It talks to the running serve HTTP API and reuses job run request flags for the scheduled JobRequest.

func NewServeCmd

func NewServeCmd(infos ...buildinfo.Info) *gcli.Command

NewServeCmd builds the `serve` command: load config, wire the job service and the httpapi server, then start the HTTP control plane (plan §9-P5).

func NewServeReloadCmd

func NewServeReloadCmd() *gcli.Command

NewServeReloadCmd builds `gofer serve reload`: request a reload from the locally running serve process through its pid-scoped signal/event.

func NewServeStopCmd

func NewServeStopCmd() *gcli.Command

NewServeStopCmd builds `gofer serve stop`: stop the running serve through its pidfile (the -d child, or a foreground instance a supervisor started). See stopDaemon for the platform-specific stop + wait semantics.

func NewSessionCmd

func NewSessionCmd() *gcli.Command

NewSessionCmd builds the `session` command group: the human/CLI face of the session relay (SESS-01 §6.2) — list registered terminal agent sessions, flip a session's relay switch, answer a waiting turn.

func NewStewardCmd

func NewStewardCmd() *gcli.Command

NewStewardCmd builds the `steward` command group.

func NewTemplateCmd

func NewTemplateCmd() *gcli.Command

NewTemplateCmd builds the `template` command group.

func NewToolCmd

func NewToolCmd() *gcli.Command

NewToolCmd builds the `tool` command group (Category is assigned by NewApp's addGroup, like every other group).

func NewTunnelCmd

func NewTunnelCmd() *gcli.Command

NewTunnelCmd builds tunnel subcommands.

func NewWorkCmd

func NewWorkCmd() *gcli.Command

NewWorkCmd builds the `work` command group.

func NewWorkerAddCmd

func NewWorkerAddCmd() *gcli.Command

func NewWorkerCmd

func NewWorkerCmd(info buildinfo.Info) *gcli.Command

NewWorkerCmd builds the `worker` command: load worker.yaml, build the local job service (the worker runs jobs locally with its OWN config), dial the hub, register and run the dispatch loop (ws-worker §4/§6). info carries the linker build metadata down to the worker client, which reports it to the hub on register (gofer_version node info).

func NewWorkerDoctorCmd

func NewWorkerDoctorCmd(info buildinfo.Info) *gcli.Command

NewWorkerDoctorCmd builds `gofer worker doctor`: a read-only self-check of this machine's worker.yaml (CFG-09). It NEVER starts a worker and never writes config; the only outbound action is the optional register probe (--connect), which is skipped while this worker_id is running locally (see doctorConnectRow).

func NewWorkerInitCmd

func NewWorkerInitCmd(info buildinfo.Info) *gcli.Command

NewWorkerInitCmd builds `gofer worker init <flags>`: the CFG-05 one-command worker onboarding. It asks the server which projects this worker may run, infers the roots mapping onto this machine's paths, probes the installed agent CLIs, writes <config-dir>/worker.yaml + <config-dir>/.env, then runs the doctor against the file it just wrote and prints the startup command. It NEVER starts the worker (how a daemon is started differs by platform) and never touches a running one.

func NewWorkerListCmd

func NewWorkerListCmd() *gcli.Command

NewWorkerListCmd builds `gofer worker list`, a read-only server view of all configured workers (including disconnected workers).

func NewWorkerProjectsCmd

func NewWorkerProjectsCmd() *gcli.Command

func NewWorkerReloadCmd

func NewWorkerReloadCmd() *gcli.Command

NewWorkerReloadCmd builds `gofer worker reload <id>`: ask a CONNECTED worker to re-read its own worker.yaml, without restarting it (its running jobs keep going).

Unlike `worker stop`, this is a SERVER-side operation — it goes over HTTP to the hub, which relays the request down the worker's live connection — so it runs wherever the CLI can reach the server, not necessarily on the worker's host. It waits for the worker's receipt and reports what the worker said: a config the worker refuses fails the command (non-zero exit) with the worker's own reason.

func NewWorkerRemoveCmd

func NewWorkerRemoveCmd() *gcli.Command

func NewWorkerShowCmd

func NewWorkerShowCmd() *gcli.Command

func NewWorkerStopCmd

func NewWorkerStopCmd() *gcli.Command

NewWorkerStopCmd builds `gofer worker stop [<id>]`: stop the running worker through its id-namespaced pidfile (the -d child, or a foreground instance). When <id> is omitted and exactly one worker is running it is auto-detected, so the common single-worker host can just run `gofer worker stop` (resolveDefaultWorkerID).

func NewWorkerUpgradeCmd

func NewWorkerUpgradeCmd() *gcli.Command

NewWorkerUpgradeCmd builds the remote worker upgrade entry point (protocol v15+). Without --file the server upgrades the worker with its own executable (same os/arch only); with --file the binary is uploaded to the server first. The command waits for the final outcome unless --no-wait is given.

func NewWorkflowCmd

func NewWorkflowCmd() *gcli.Command

NewWorkflowCmd builds the `workflow` command group (run/show/list/cancel). It wraps the server's /v1/workflows HTTP API so the host can submit and inspect job-chains without curl (P3-a). A workflow file is yaml (title + steps[]); the CLI parses it into a workflow.Spec and POSTs it.

Types

type StaleCandidate

type StaleCandidate struct {
	ID         int64  `json:"id"`
	ProjectKey string `json:"project_key"`
	JobID      string `json:"job_id"`
	AgeDays    int    `json:"age_days"`
	Text       string `json:"text"`
}

StaleCandidate is one pending knowledge candidate older than staleCandidateAge.

Jump to

Keyboard shortcuts

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