1. CLI command reference

CLI command reference

Everyday QA commands with flags, options, and exit codes.

You interact with the QA system through scripts defined in package.json. Each script handles a specific stage of the development and release lifecycle.

Everyday commands

CommandLifecycle stagePrimary file
pnpm qaManual pre-commit assessmentscripts/qa-commit.mjs
pnpm qa:commitAutomatic pre-commit hook runnerscripts/qa-commit.mjs
pnpm qa:ciContinuous integration and pull requestsscripts/qa-ci.mjs
pnpm qa:releaseStaging and production release checksscripts/qa-release.mjs
pnpm qa:setupMachine and repository setupscripts/qa-setup.mjs
pnpm checkFast deterministic code and QA checkspackage.json
pnpm test:qaQA system self-test suitetests/qa/

pnpm qa

This is the primary command you run locally to verify changes before committing. It runs the full commit assessment on your staged files, even when the auto-run switch in tooling/qa/policy/switch.json is turned off.

Automatic hooks versus manual invocation

pnpm qa

Flags

  • --verbose. Prints candidate tree hashes, staged file lists, and real-time suite execution updates.
  • --dry-run. Resolves and displays the planned test suites and agent tasks without executing tests or calling the reviewer agent.
  • --repair. Automatically runs up to two repair cycles to fix staged formatting issues before failing the gate.

Staged vs unstaged changes

The pre-commit runner tests the exact files in your Git staging index.

  • You must stage files first. If no changes are staged, pnpm qa fails immediately with an error: No staged changes detected in git index. Stage candidate changes with 'git add' before running qa:commit.
  • Unstaged files are ignored. Edits left unstaged in your working directory are excluded from the test sandbox. This ensures tests only pass if the actual committed files work.

What it does

  1. Calls git write-tree to capture what is staged.
  2. Unpacks the candidate files into an isolated temporary directory.
  3. Strips sensitive tokens and passwords from the environment.
  4. Runs deterministic test suites inside the clean directory.
  5. Sends the staged diff and review instructions to a fresh reviewer session.
  6. Checks git write-tree again on the host to verify that you did not modify the index while tests were running.
  7. Evaluates the gate, prints a summary, and writes artifacts to .qa-reports/runs/<runId>/.

Exit codes

  • 0: Gate passed. Staged files are clean and a receipt is issued.
  • 1: Demonstrated failure. A test failed, linting failed, or the QA agent filed a critical finding.
  • 2: Blocked. The index was modified during the run, a tool timed out, or required prerequisites were missing.

pnpm qa:commit

This script is called by .git/hooks/pre-commit when you run git commit.

pnpm qa:commit

When tooling/qa/policy/switch.json has autoRun: "off", this command prints a notice pointing to pnpm qa and exits cleanly with code 0. When the switch is "on", it runs the exact same evaluation as pnpm qa.


pnpm qa:ci

Continuous integration runs this command on incoming commits and pull requests. It operates on committed Git history rather than the staging index.

pnpm qa:ci --base=origin/main --head=HEAD

Flags

  • --base=<sha>. The base branch or commit hash to compare against. Defaults to origin/main, then to the initial empty tree.
  • --head=<sha>. The tip commit of the pull request. Defaults to HEAD.
  • --require-receipts. Fails if any introduced commit lacks a valid pre-commit receipt.

What it does

  1. Lists all commits introduced between base and head.
  2. Inspects .qa-reports/receipts/<commitSha>.json for each commit. If a valid receipt exists and its policy digest matches, CI knows that commit was already verified.
  3. Tests the merge candidate tree in isolation.
  4. Checks whether remote branch protection is active and prints an advisory notice if running locally without a remote.

pnpm qa:release

Run this command before promoting a build artifact to staging or production.

pnpm qa:release --artifact=<sha256> --env=staging

Flags

  • --artifact=<sha256>. The 64 character sha256 hash of the deployable application bundle.
  • --env=<staging|production>. The deployment target environment.

What it does

  1. Validates that the artifact hash matches the candidate build.
  2. Inspects tooling/qa/manifest/acceptance-manifest.json.
  3. Verifies that all 28 acceptance criteria are marked implemented and backed by passing automated tests.

During current development, while product features are being built, qa:release truthfully exits with code 2 (blocked). This stops unfinished software from deploying to real users.


pnpm qa:setup

Run this command once when setting up a fresh machine or clone. It verifies that your local environment has the required tools and configures Git hooks.

pnpm qa:setup

Flags

  • --force. Overwrites existing Git hooks even if they already contain QA runners.

What it checks

  1. Node.js version 26.8.2 or higher.
  2. pnpm version 12.3.4 or higher.
  3. git version 2.0.0 or higher.
  4. Google Antigravity CLI, binary name agy, version 1.1.9 or higher. Checks /opt/homebrew/bin/agy first, then falls back to PATH.

Git hook installation

The script installs .git/hooks/pre-commit and .git/hooks/pre-merge-commit.

If you already had custom hooks installed, the script preserves them. It renames the existing file to <hookName>.legacy, makes it executable, and writes a new hook that calls the legacy script first. If your legacy hook exits with an error, the commit aborts before QA begins.


pnpm check

Runs the repository’s deterministic test and governance pipeline:

pnpm check

This runs code formatting verification, ESLint, TypeScript type checking, architectural boundary checks, knip unused file analysis, repository rules, and all unit and QA test suites. It does not call AI models or external network APIs.


pnpm test:qa

Runs the adversarial test suite that proves the QA system itself works reliably:

pnpm test:qa

This command runs all 18 automated test files across tests/qa/. It creates temporary Git repositories on disk and proves that:

  • Staged changes pass while unstaged changes are ignored.
  • Tests fail if a symlink attempts to escape the root directory.
  • Tests block if the Git index is modified during execution.
  • The gate fails if the agent returns malformed JSON or invented evidence.
  • Releases fail closed when product criteria are unimplemented.
  • The auto-repair loop fixes formatting errors without losing staged changes.