Documentation
¶
Overview ¶
Package configcmd implements the `vigolium config` command group.
It is the first command group split out of the flat pkg/cli package into its own subpackage. Rather than self-registering via init() into a package-private rootCmd, it exposes an explicit NewCommand(deps, examples) constructor that pkg/cli wires onto the root command. All of the implicit package-global state the commands previously reached for (the --config / --force flag values and the first-run reinitializer) is passed in explicitly via Deps, so this package has no dependency back on pkg/cli.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Deps ¶
type Deps struct {
// ConfigFlag returns the raw --config flag value (may be empty).
ConfigFlag func() string
// Force returns the --force flag value.
Force func() bool
// Reinitialize regenerates ~/.vigolium with fresh defaults (used by `config clean`).
Reinitialize func() error
// JSON reports whether the caller asked for machine output. The config
// commands accepted the persistent --json flag and ignored it, printing
// ANSI-colored prose to stdout and exiting 0 — so a consumer's parse failed
// for a reason the exit code did not describe.
JSON func() bool
// WriteJSON emits a result through the CLI's shared envelope writer, so a
// config result has the same schema_version/items/generated_at spine as every
// other -j payload rather than a second shape invented here. total is the row
// count, which the caller already knows — passing it avoids reflecting over
// the slice on the other side of the seam.
WriteJSON func(command, legacyKey string, items any, total int, extra map[string]any) error
}
Deps carries the runtime dependencies the config commands need, injected by pkg/cli so this package stays decoupled from the CLI's global flag state.