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 blank-import block below keeps every production driver self-registering via its init() (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 cobra command tree lives in root.go (NewRootCmd) and is executed here.
Only `harbor version` is fully implemented at this phase. The other six subcommands (`dev`, `scaffold`, `validate`, `inspect-events`, `inspect-runs`, `inspect-topology`) are stubs that exit non-zero with a structured CLIError pointing to their implementing phase — the §13 "test stubs as production defaults" amendment is satisfied by the structured error + non-zero exit.
Source Files
¶
- cmd_console.go
- cmd_dev.go
- cmd_dev_catalog_view.go
- cmd_dev_executor.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_validate.go
- cmd_version.go
- console_embed.go
- devauth.go
- devmock.go
- devseed.go
- errors.go
- inspect_common.go
- main.go
- root.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. |