harbor

command
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 82 Imported by: 0

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.

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.

Jump to

Keyboard shortcuts

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