cli

package
v0.0.0-...-6b8ee43 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: AGPL-3.0 Imports: 34 Imported by: 0

Documentation

Overview

Design: docs/architecture/config/syntax.md — stdin ("-") wiring for config editor commands Overview: main.go — dispatch and exit codes

Design: docs/architecture/config/syntax.md — config CLI commands Detail: cmd_edit.go — edit subcommand handler Detail: cmd_validate.go — validate subcommand handler Detail: cmd_migrate.go — migrate subcommand handler Detail: cmd_fmt.go — fmt subcommand handler Detail: cmd_dump.go — dump subcommand handler Detail: cmd_diff.go — diff subcommand handler Detail: cmd_completion.go — completion query handler Detail: cmd_history.go — history subcommand handler Detail: cmd_rollback.go — rollback subcommand handler Detail: cmd_set.go — set subcommand handler Detail: cmd_archive.go — archive subcommand handler Detail: cmd_import.go — import subcommand handler Detail: cmd_rename.go — rename subcommand handler

Package config provides the ze config subcommand.

Design: docs/architecture/api/commands.md — config command ownership

Register the `config` root command and its `show config *` / `validate config` offline shortcuts with the importable command registry. This is the owner package: the offline configuration CLI lives with internal/component/config, not under cmd/ze.

The root command and the snapshot shortcuts (history, ls, cat) need the blob store, which is opened only after global flag parsing. The root handler receives it through the RuntimeContext; the local shortcuts (which have the func(args)int signature and so get no context) resolve it lazily through the registry's runtime storage resolver, which cmd/ze/main.go installs.

Index

Constants

This section is empty.

Variables

View Source
var ErrOldConfig = errors.New("config needs migration")

ErrOldConfig is returned when fmt is called on an old config.

Functions

func ConfigFmtBytes

func ConfigFmtBytes(input []byte) (string, bool, error)

ConfigFmtBytes formats config bytes and returns formatted output and whether changes were made. Exported for testing.

func Run

func Run(args []string) int

Run executes the config subcommand with filesystem storage (backward compat). Returns exit code.

func RunWithStorage

func RunWithStorage(store storage.Storage, args []string) int

RunWithStorage executes the config subcommand with the given storage backend. Returns exit code.

func ValidateContent

func ValidateContent(input, path string) error

ValidateContent runs the same validation as `ze config validate` and returns an error containing all validation errors. Warnings do not fail validation, matching the CLI command exit-code semantics.

Types

This section is empty.

Jump to

Keyboard shortcuts

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