CLI reference
All commands accept --help. Global flags may be placed before or
after the subcommand.
Global flags
| Flag | Description |
|---|---|
-c, --config <path> | path to .maxicfg.yaml |
-p, --profile <name> | profile to operate on |
-f, --format <fmt> | text, json, github, junit |
-q, --quiet | suppress output, rely on the exit code |
--no-color | disable ANSI colours |
-v, --verbose | show what is being read and why |
maxicfg lint
Validate one or more sources against a schema.
maxicfg lint [paths...] [flags]
| Flag | Description |
|---|---|
--schema <path> | schema file (overrides the project file) |
--strict | treat unknown keys as errors |
--warn-unused | report 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]
| Flag | Description |
|---|---|
--ignore-secrets | skip keys marked secret |
--only <prefix> | limit to keys under a prefix |
--exit-code | exit 1 when differences are found |
--missing-only | only 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]
| Flag | Description |
|---|---|
-o, --out <path> | write to a file instead of stdout |
--env-file <path> | load variables from a dotenv file |
--allow-empty | permit unset variables to render empty |
--check | fail 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
| Code | Meaning |
|---|---|
0 | success, nothing to report |
1 | problems found (lint failures, findings, drift with --exit-code) |
2 | usage error — bad flags or missing arguments |
3 | a file could not be read or parsed |
4 | the schema itself is invalid |