Using the CLI

Global options, workspace resolution, exit codes, JSON, and CI gates.

prism runs the same engine as the extension, with real exit codes and clean JSON — what makes it useful in a script.

Full command list: CLI reference.

Global options

OptionEffect
-w, --workspace <path>Which repository to analyse
--jsonEmit JSON on stdout instead of a human table
--no-colorDisable ANSI colour (NO_COLOR honoured too)
-q, --quietSuppress progress on stderr
--verboseWorkspace chosen + index timing on stderr
-y, --yesConsent to an operation that would otherwise be refused
-V, --versionEngine version and API level

No subcommand prints help and exits 0. A near-miss typo exits 2 with a suggestion.

Which repository?

Most explicit wins: --workspacePRISM_WORKSPACE → nearest .git ancestor → cwd. prism doctor prints which rule won. Path arguments resolve from your directory; paths outside the workspace are refused, not clamped.

Exit codes

CodeMeaning
0Ran successfully
1Ran successfully, and found what you gated on
2Usage error
3Prism itself failed

Failing a build

prism blast src/core/index.ts --fail-on high
prism review --base origin/main --fail-on high
prism cycles --fail-on any
prism engineering --fail-on high

--fail-on takes a band and fires at or above it.

Scripting

prism dna --json | jq '.data.rankedDomains'

Success and failure share one JSON envelope. In --json mode errors go to stdout inside that envelope. Colour is never emitted when stdout is not a TTY. --json is never truncated; --limit bounds only the human table.

Worth knowing

  • First command in a repo is slow (builds the index); later commands reuse it.
  • prism review with no args reviews the working tree, including untracked files. Pass --base in CI.
  • prism rename and prism safe-delete never write — they only report.
  • prism security is a config checklist, not a vulnerability scanner.

Commands · Wire into CI · Troubleshooting

On this page