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
| Command | Lifecycle stage | Primary file |
|---|---|---|
pnpm qa | Manual pre-commit assessment | scripts/qa-commit.mjs |
pnpm qa:commit | Automatic pre-commit hook runner | scripts/qa-commit.mjs |
pnpm qa:ci | Continuous integration and pull requests | scripts/qa-ci.mjs |
pnpm qa:release | Staging and production release checks | scripts/qa-release.mjs |
pnpm qa:setup | Machine and repository setup | scripts/qa-setup.mjs |
pnpm check | Fast deterministic code and QA checks | package.json |
pnpm test:qa | QA system self-test suite | tests/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.

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 qafails 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
- Calls
git write-treeto capture what is staged. - Unpacks the candidate files into an isolated temporary directory.
- Strips sensitive tokens and passwords from the environment.
- Runs deterministic test suites inside the clean directory.
- Sends the staged diff and review instructions to a fresh reviewer session.
- Checks
git write-treeagain on the host to verify that you did not modify the index while tests were running. - 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 toorigin/main, then to the initial empty tree.--head=<sha>. The tip commit of the pull request. Defaults toHEAD.--require-receipts. Fails if any introduced commit lacks a valid pre-commit receipt.
What it does
- Lists all commits introduced between
baseandhead. - Inspects
.qa-reports/receipts/<commitSha>.jsonfor each commit. If a valid receipt exists and its policy digest matches, CI knows that commit was already verified. - Tests the merge candidate tree in isolation.
- 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
- Validates that the artifact hash matches the candidate build.
- Inspects
tooling/qa/manifest/acceptance-manifest.json. - Verifies that all 28 acceptance criteria are marked
implementedand 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
- Node.js version 26.8.2 or higher.
- pnpm version 12.3.4 or higher.
- git version 2.0.0 or higher.
- Google Antigravity CLI, binary name
agy, version 1.1.9 or higher. Checks/opt/homebrew/bin/agyfirst, then falls back toPATH.
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.