Documentation
¶
Index ¶
- Constants
- func NewAgentCmd() *gcli.Command
- func NewApp(version string) *gcli.App
- func NewAppWithBuildInfo(info buildinfo.Info) *gcli.App
- func NewAuthCmd() *gcli.Command
- func NewConfigCmd() *gcli.Command
- func NewDoctorCmd(info buildinfo.Info) *gcli.Command
- func NewHookCmd() *gcli.Command
- func NewInitCmd(info buildinfo.Info) *gcli.Command
- func NewIssueCmd() *gcli.Command
- func NewJobCmd() *gcli.Command
- func NewMcpCmd() *gcli.Command
- func NewMemoryCmd() *gcli.Command
- func NewPlanCmd() *gcli.Command
- func NewProjectCmd() *gcli.Command
- func NewRefsCmd() *gcli.Command
- func NewRepoCmd() *gcli.Command
- func NewScheduleCmd() *gcli.Command
- func NewServeCmd(infos ...buildinfo.Info) *gcli.Command
- func NewServeReloadCmd() *gcli.Command
- func NewServeStopCmd() *gcli.Command
- func NewSessionCmd() *gcli.Command
- func NewSettingsCmd() *gcli.Command
- func NewStewardCmd() *gcli.Command
- func NewTemplateCmd() *gcli.Command
- func NewToolApiCmd() *gcli.Command
- func NewToolCmd() *gcli.Command
- func NewToolStepCmd() *gcli.Command
- func NewToolTriggerCmd() *gcli.Command
- func NewTunnelCmd() *gcli.Command
- func NewWorkCmd() *gcli.Command
- func NewWorkerAddCmd() *gcli.Command
- func NewWorkerCmd(info buildinfo.Info) *gcli.Command
- func NewWorkerDoctorCmd(info buildinfo.Info) *gcli.Command
- func NewWorkerInitCmd(info buildinfo.Info) *gcli.Command
- func NewWorkerJoinCmd(info buildinfo.Info) *gcli.Command
- func NewWorkerListCmd() *gcli.Command
- func NewWorkerProjectsCmd() *gcli.Command
- func NewWorkerReloadCmd() *gcli.Command
- func NewWorkerRemoveCmd() *gcli.Command
- func NewWorkerShowCmd() *gcli.Command
- func NewWorkerStopCmd() *gcli.Command
- func NewWorkerUpgradeCmd() *gcli.Command
- func NewWorkflowCmd() *gcli.Command
- type StaleCandidate
Constants ¶
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.
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 ¶
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 ¶
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 ¶
NewAppWithBuildInfo assembles the CLI with linker build metadata available to commands that need to surface it through runtime APIs.
func NewAuthCmd ¶ added in v0.162.0
NewAuthCmd builds the `auth` command group.
func NewConfigCmd ¶
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 NewDoctorCmd ¶ added in v0.203.0
NewDoctorCmd builds the privacy-safe diagnostic exporter. It deliberately does not collect job prompts, messages, memories, or arbitrary process environment values.
func NewHookCmd ¶
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 ¶
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` always writes the embedded template. Worker onboarding is intentionally a separate command: `gofer worker init`.
func NewIssueCmd ¶
func NewJobCmd ¶
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 ¶
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 NewPlanCmd ¶
NewPlanCmd builds the `plan` command group for lightweight job grouping.
func NewProjectCmd ¶
NewProjectCmd builds the `project` command group with sub commands list/show/add/remove/validate.
func NewRefsCmd ¶ added in v0.204.0
NewRefsCmd implements `gofer tool refs <id>`; kind is inferred from the id prefix.
func NewRepoCmd ¶
func NewScheduleCmd ¶
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 ¶
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 ¶
NewServeReloadCmd builds `gofer serve reload`: request a reload from the locally running serve process through its pid-scoped signal/event.
func NewServeStopCmd ¶
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 ¶
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 NewSettingsCmd ¶ added in v0.179.0
NewSettingsCmd builds the `settings` group. Every subcommand binds `-c/--config` and the server/token flags through the shared helpers (G011), so it talks to the same server as the rest of the CLI.
func NewStewardCmd ¶
NewStewardCmd builds the `steward` command group.
func NewTemplateCmd ¶
NewTemplateCmd builds the `template` command group.
func NewToolApiCmd ¶ added in v0.179.0
NewToolApiCmd builds the `tool api` subcommand (registered by NewToolCmd).
func NewToolCmd ¶
NewToolCmd builds the `tool` command group (Category is assigned by NewApp's addGroup, like every other group).
func NewToolStepCmd ¶ added in v0.181.0
NewToolStepCmd builds the sub-command. It is registered (hidden) under `gofer tool`.
func NewToolTriggerCmd ¶ added in v0.207.0
NewToolTriggerCmd builds the `tool trigger` group (registered by NewToolCmd).
func NewWorkerAddCmd ¶
func NewWorkerCmd ¶
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 ¶
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 ¶
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 NewWorkerJoinCmd ¶ added in v0.169.0
NewWorkerJoinCmd builds `gofer worker join`: ask a server to admit this machine. The command shows a pairing code, waits (long-polling) while a person accepts it in the console, then writes the token and worker.yaml here and optionally starts the worker. It never starts a worker unless --start is given, and it never prints the token.
func NewWorkerListCmd ¶
NewWorkerListCmd builds `gofer worker list`, a read-only server view of all configured workers (including disconnected workers).
func NewWorkerProjectsCmd ¶
func NewWorkerReloadCmd ¶
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 NewWorkerShowCmd ¶
func NewWorkerStopCmd ¶
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 ¶
NewWorkerUpgradeCmd builds the remote worker upgrade entry point (protocol v15+). Without --file the server picks the binary by platform (--source auto): its own executable for a worker of its platform, the release source for any other. With --file the binary is uploaded to the server first. The command waits for the final outcome unless --no-wait is given.
func NewWorkflowCmd ¶
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 ¶
Source Files
¶
- agent.go
- agent_install_hint.go
- agent_mcp.go
- agent_rule.go
- agent_skill.go
- app.go
- auth.go
- brief.go
- budget_flags.go
- comment.go
- config.go
- doctor.go
- dual_mode.go
- flags.go
- hook.go
- init_workspace.go
- issue.go
- job.go
- job_findings.go
- job_preview.go
- lang.go
- mcp.go
- memory.go
- memory_candidates.go
- memory_doctor_scope.go
- memory_scope.go
- memory_synthesis.go
- plan.go
- plan_import.go
- prime_keywords.go
- project.go
- refs.go
- reload_wait.go
- repo.go
- repo_changelog.go
- repo_focus.go
- repo_merge.go
- repo_mirror.go
- repo_projectkey.go
- schedule.go
- serve.go
- serve_management.go
- serve_management_linux.go
- serve_management_logs.go
- serve_management_test_backend_linux.go
- serve_management_unix.go
- serve_management_upgrade.go
- serve_token.go
- serve_upgrade_helper.go
- session.go
- session_mail.go
- session_nudge.go
- session_wait.go
- settings.go
- steward.go
- stop.go
- template.go
- timefmt.go
- tool.go
- tool_api.go
- tool_deliver.go
- tool_stats.go
- tool_step.go
- tool_trigger.go
- tracker_sync.go
- tunnel.go
- work.go
- worker.go
- worker_doctor.go
- worker_init.go
- worker_join.go
- worker_tools.go
- workflow.go