Skip to content

CLI reference

sh
norm [OPTIONS] COMMAND [ARGS]...

Global options

OptionDescription
--config PATHPath to norm.yaml (default: ./norm.yaml under --cwd or current directory)
--cwd PATHProject root; paths resolve relative to this directory
-v, --verboseIncrease verbosity (repeat for more detail)
-q, --quietSuppress success and progress output
--no-colorDisable colored output (also respects NO_COLOR)
--error-formathuman (default), json, or github
--versionPrint package version

Exit codes

CodeMeaning
0Success
1Configuration, SQL, or code generation errors
2Usage errors (invalid arguments, unimplemented migration commands)

Commands

CommandDescription
initCreate norm.yaml and target directories
targetsList configured targets and paths
generateGenerate code from SQL sources
checkVerify generated output is up to date
schema pullPull Postgres schema via pg_dump
migrationsPlaceholder (not implemented)

Shell completion

nORM uses Click shell completion when enabled in your shell environment.

  • --config completes paths to norm.yaml files under --cwd
  • --target / -t completes target names from norm.yaml

Error formats

Human (default)

Rich panels with an error code, message, optional source location, and hints.

JSON

sh
norm --error-format json check

Prints a single JSON object to stdout:

json
{"code": "OUTOFDATE", "message": "...", "hint": "...", "context": {}}

GitHub Actions

sh
norm --error-format github check

Prints GitHub Actions workflow command annotations for CI.

Typical workflow

sh
norm init
norm schema pull --target default
norm generate
norm check

Released under the MIT License.