CLI Reference

CLI reference

The CLI is schema-independent and never resolves declarations. Every command supports --help/-h; root help describes the architecture and documentation.

CommandArguments / flagsBehavior
gogenconf format [FILE]FILE defaults to - (stdin); --write, --check default falseCanonical stdout, atomic in-place write, or noncanonical check.
gogenconf validate [FILE]FILE defaults to stdinSyntax/structure only, silent success.
gogenconf expr format [EXPRESSION]Omitted or - reads stdinCanonical expression, no resolution.
gogenconf expr validate [EXPRESSION]Omitted or - reads stdinExpression grammar only, silent success.
gogenconf versionNo flagsBuild version, commit, and date; dev/none/unknown for development builds.
gogenconf format service.conf
cat service.conf | gogenconf format
gogenconf format --check service.conf
gogenconf format --write service.conf
gogenconf validate service.conf
gogenconf expr format 'from_file(from_env(CREDENTIAL_FILE))'
gogenconf expr validate 'from_json_file(from_env(CONFIG_FILE), .auth.token)'

--write requires a regular input file, rejects symlinks/stdin, preserves its permissions and uses a same-directory atomic replacement. --check and --write are mutually exclusive. Syntax errors, I/O errors and noncanonical checks exit nonzero. Do not pass secret literal contents on argv. Formatting is not redaction. validate cannot check application fields, resolver registration, required values, or supported schema versions; those require application schema/binding APIs.

CLI code, extended help, and per-command man pages are generated by pinned go-subcommand v0.0.30 from internal/cli/commands.go. The local internal/cligen driver disables volatile provenance and the generated unpinned regeneration shortcut via a main-template overlay. It aggregates generated command pages/help into gogenconf(1) with deterministic gzip output. No go-subcommand runtime dependency enters either the CLI or library.

Installation and man pages

Tagged releases are pending. Until merge/release, use the extraction PR’s public commit in place of REV; after merge main is also available:

go get github.com/arran4/gogenconf@REV
go install github.com/arran4/gogenconf/cmd/gogenconf@REV

Once releases exist, the usual forms are:

go get github.com/arran4/gogenconf
go install github.com/arran4/gogenconf/cmd/gogenconf@latest

The release pipeline is configured for Linux/macOS/Windows on amd64/arm64, tar.gz/Windows zip archives, checksums, and Linux deb/rpm/apk packages. Releases will include README, license and man pages. None has been published by this PR.

gzip -dc man/man1/gogenconf.1.gz | man -l -
# Optional system installation from a checkout or release archive:
sudo install -Dm644 man/man1/gogenconf.1.gz /usr/local/share/man/man1/gogenconf.1.gz
man gogenconf