Skip to content

CLI commands and workflows

Run the executable installed with @terra-symposium/quality:

Terminal window
npx terra-quality [command] [options]

The runner reads quality.json from the current working directory. Run terra-quality --help for the CLI usage.

Terminal window
npx terra-quality
npx terra-quality quality --warn
npx terra-quality quality --all
npx terra-quality quality --all --warn

The two options control separate things: default scope is changed/untracked files, --all expands scope to all configured source files; default mode allows configured autofixes, --warn makes the run review-only.

InvocationFiles checkedWrites source changes?Configured build/test commands
npx terra-qualityChanged and untrackedYes, for enabled safe fixesRun
npx terra-quality quality --warnChanged and untrackedNoRun
npx terra-quality quality --allAll configured source filesYes, for enabled safe fixesRun
npx terra-quality quality --all --warnAll configured source filesNoRun
npx terra-quality quality --all --warn --skip-commandsAll configured source filesNoSkipped

--warn suppresses autofixes, including autofixes enabled in quality.json. To disable one fixer permanently, set its key under autofix to false. The --strict option makes naming errors fail. --skip-recommendations skips advisory commands for one run.

Terminal window
# Local feedback on the files you changed; safe configured fixes are allowed.
npx terra-quality
# Review changed files without modifying them.
npx terra-quality quality --warn
# CI: check the whole repository without writing. Keep command checks enabled
# here unless build and tests are already run in separate CI steps.
npx terra-quality quality --all --warn
# Static-only CI step when build and tests run elsewhere.
npx terra-quality quality --all --warn --skip-commands --skip-recommendations

Changed-file mode needs a Git worktree. If you run from a source archive or want a complete scan, add --all.

CommandPurpose
documentCheck/maintain documentation structure.
formatFormat selected source files.
lintInvoke ESLint.
knipCheck unused files, exports, dependencies, and reachability.
typesRun the configured type boundary.
single-useFind or inline declarations with one in-scope consumer.
dead-codeInspect private unused function declarations.
securityCheck environment, client-boundary, import, and term policies.
repeated-classesDetect or safely extract repeated static class strings.
regex-dedupDetect or consolidate duplicate regex patterns.
ui-patternsCheck configured UI pattern strings.
domain <name>Run a configured quality command by name.
{
"scripts": {
"quality": "terra-quality",
"quality:all": "terra-quality quality --all",
"quality:check": "terra-quality quality --all --warn"
}
}

Use fix mode for local deterministic cleanup. In CI, --all --warn checks the full scope without editing files. Keep configured build and test commands enabled unless another workflow step runs them.