maxicfg

CLI reference

All commands accept --help. Global flags may be placed before or after the subcommand.

Global flags

FlagDescription
-c, --config <path>path to .maxicfg.yaml
-p, --profile <name>profile to operate on
-f, --format <fmt>text, json, github, junit
-q, --quietsuppress output, rely on the exit code
--no-colordisable ANSI colours
-v, --verboseshow what is being read and why

maxicfg lint

Validate one or more sources against a schema.

maxicfg lint [paths...] [flags]
FlagDescription
--schema <path>schema file (overrides the project file)
--stricttreat unknown keys as errors
--warn-unusedreport schema keys no source sets
--max-problems <n>stop after n problems
$ maxicfg lint ./config --strict --warn-unused
config/base.yaml        ok
config/production.yaml  1 problem

  production.yaml:22:5  cache.ttl: "90" is not a valid duration
                        (did you mean "90s"?)

warning: schema key "tracing.sample_rate" is never set

maxicfg diff

Compare two sources, or two profiles, key by key.

maxicfg diff <a> <b> [flags]
FlagDescription
--ignore-secretsskip keys marked secret
--only <prefix>limit to keys under a prefix
--exit-codeexit 1 when differences are found
--missing-onlyonly keys present in one side
$ maxicfg diff --profile staging --profile production --only database

~ database.pool_size  10 -> 40
~ database.timeout    5s -> 30s
+ database.replica_host              (only in production)

3 differences under "database"

maxicfg render

Render a template, substituting environment variables.

maxicfg render <template> [flags]
FlagDescription
-o, --out <path>write to a file instead of stdout
--env-file <path>load variables from a dotenv file
--allow-emptypermit unset variables to render empty
--checkfail if the output would differ from an existing file

--check is the flag to use in CI: it verifies that the committed rendered file matches the template, without writing anything.

maxicfg scan

Look for credentials and common mistakes in configuration files.

maxicfg scan [paths...] [flags]
$ maxicfg scan ./config

config/local.yaml:8    aws access key id
config/local.yaml:9    aws secret access key
config/staging.yaml:31 private key block
config/staging.yaml:44 database url with inline password

4 findings in 2 files

scan uses pattern matching and will produce false positives on example values. Add paths to scan.ignore in the project file rather than disabling the command.

maxicfg fmt

Normalise formatting: consistent indentation, sorted keys, no trailing whitespace.

maxicfg fmt [paths...] [--check] [--sort-keys]

maxicfg schema

Generate a starting schema from existing configuration files.

$ maxicfg schema infer ./config/production.yaml --out config/schema.yaml
inferred 34 keys, 6 required, 3 enums
review the result before committing

Exit codes

CodeMeaning
0success, nothing to report
1problems found (lint failures, findings, drift with --exit-code)
2usage error — bad flags or missing arguments
3a file could not be read or parsed
4the schema itself is invalid