CLI commands and workflows
Run the executable installed with @terra-symposium/quality:
npx terra-quality [command] [options]The runner reads quality.json from the current working directory. Run terra-quality --help for the CLI usage.
Choose a run mode
Section titled “Choose a run mode”npx terra-qualitynpx terra-quality quality --warnnpx terra-quality quality --allnpx terra-quality quality --all --warnThe 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.
| Invocation | Files checked | Writes source changes? | Configured build/test commands |
|---|---|---|---|
npx terra-quality | Changed and untracked | Yes, for enabled safe fixes | Run |
npx terra-quality quality --warn | Changed and untracked | No | Run |
npx terra-quality quality --all | All configured source files | Yes, for enabled safe fixes | Run |
npx terra-quality quality --all --warn | All configured source files | No | Run |
npx terra-quality quality --all --warn --skip-commands | All configured source files | No | Skipped |
--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.
Example workflows
Section titled “Example workflows”# 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-recommendationsChanged-file mode needs a Git worktree. If you run from a source archive or want a complete scan, add --all.
Focused commands
Section titled “Focused commands”| Command | Purpose |
|---|---|
document | Check/maintain documentation structure. |
format | Format selected source files. |
lint | Invoke ESLint. |
knip | Check unused files, exports, dependencies, and reachability. |
types | Run the configured type boundary. |
single-use | Find or inline declarations with one in-scope consumer. |
dead-code | Inspect private unused function declarations. |
security | Check environment, client-boundary, import, and term policies. |
repeated-classes | Detect or safely extract repeated static class strings. |
regex-dedup | Detect or consolidate duplicate regex patterns. |
ui-patterns | Check configured UI pattern strings. |
domain <name> | Run a configured quality command by name. |
Suggested scripts
Section titled “Suggested scripts”{ "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.