Appearance
CLI
The command-line entry point. It reads the arguments, runs lint or explain, prints the result in the format --format selects, and sets the exit code.
Both executables, sdc-lint and its alias sdc-questionnaire-lint, run the same file. The CLI does no analysis itself: lint calls the same lintWithRules() the library uses, and only then writes the report. Until then the report is buffered, so a run that fails never prints half a report. Console output from the config and plugins goes to stderr, so stdout holds only the report.
| Exit code | Meaning |
|---|---|
| 0 | The run completed with no errors; warnings and info may remain |
| 1 | The run completed with one or more errors |
| 2 | The run did not complete: wrong usage, a bad config, no Questionnaires or a rule crash |
CLI reference is the full contract: commands, flags, output formats and exit codes.
Schema
Code
main.ts: the executable, built asdist/cli.js. Sends console output to stderr and sets the process exit code.run.ts:runClipicks the command, writes the report or the failure, and returns the exit code.args.ts:parseCliArgsturns the arguments into a command, or a usage error.explain.ts:runExplainlists the rules, or prints one rule's documentation. It loads the config but reads no forms.help.ts: the--helptext.output-guard.ts:guardStdoutsendsconsole.logand other stdout writes from the config and plugins to stderr.step-summary.ts:appendStepSummaryadds the job summary in GitHub Actions.colour.ts: colour only in a terminal, and never whenNO_COLORis set.
The output formats themselves are in Report and formatters, and failures in Failures.