Documentation
¶
Overview ¶
Package main hosts the `harbor` CLI binary.
This file defines CLIError — the structured-error type the binary surfaces to operators (stderr + non-zero exit code). It is the single sink for CLI exit errors; subcommand bodies never hand-roll JSON.
Distinct from internal/protocol/errors.Error: that type is the Protocol *wire* error code consumed by Protocol clients over REST/SSE; CLIError is the *operator-facing* exit surface and lives in its own home so the two surfaces evolve independently (CLAUDE.md §8 — Protocol error codes are single-sourced under internal/protocol/errors; this file does NOT add a Protocol code).
Wire shape (--json mode), pinned by D-084:
{"error":"<message>","code":"<code>","hint":"<hint>"}
Human shape (default), pinned by D-084:
Error: harbor <subcommand>: <message> [(<hint>)]
Command harbor is the Harbor binary entry point.
Phase 63 (RFC §8, D-084) turns this from a driver-registration stub into a cobra-rooted CLI. The production driver set self-registers via the `internal/drivers/prod` aggregator blank import below (so the audit / events / state / artifacts / memory / skills / tools / telemetry / llm / governance / distributed factories resolve when something Opens them — the §4.4 seam pattern; the per-driver imports were collapsed into the aggregator by Phase 110c, D-196). The cobra command tree lives in root.go (NewRootCmd) and is executed here.
cmd/harbor/session_ensurer.go — adapts the concrete sessions.Registry to the protocol.SessionEnsurer seam (D-171).
The Protocol ControlSurface owns the create-on-first-use behaviour on `start` but must not import the sessions package (it depends only on the error-only `protocol.SessionEnsurer` interface). This adapter lives at the cmd/harbor wiring boundary — the one place allowed to know both the concrete registry and the Protocol surface — and translates the registry's lifecycle sentinels into the protocol-side sentinels the surface's error mapper understands.
Source Files
¶
- cmd_console.go
- cmd_dev.go
- cmd_dev_hot_reload.go
- cmd_dev_runloop.go
- cmd_init.go
- cmd_inspect_events.go
- cmd_inspect_runs.go
- cmd_inspect_topology.go
- cmd_scaffold.go
- cmd_skill.go
- cmd_validate.go
- cmd_version.go
- console_embed.go
- dev_enricher.go
- devauth.go
- devmock.go
- devseed.go
- errors.go
- inspect_common.go
- main.go
- root.go
- session_ensurer.go
- topology_render.go
- topology_synthesise.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package harborinit ships the `harbor init` engine.
|
Package harborinit ships the `harbor init` engine. |
|
Package scaffold implements the `harbor scaffold` engine — the template registry, the renderer, and the on-disk writer.
|
Package scaffold implements the `harbor scaffold` engine — the template registry, the renderer, and the on-disk writer. |