Skip to content

CLI Reference

The public CLI entrypoint is diffpal.

Installation

Verified distribution paths in this repository:

MethodCommand or entrypointNotes
npm one-shotnpx -y @diffpal/diffpal@latest <command>Used by the quickstart.
npm globalnpm install --global @diffpal/diffpal@latestProvides the diffpal executable.
GitHub Actiondiffpal/action@v1Wraps DiffPal for GitHub Actions. See GitHub Actions.
Azure extensionDiffPalReview@1Wraps DiffPal for Azure Pipelines. See Azure Pipelines.

Release builds are produced by Omnidist for npm packages and platform binaries. The npm meta-package is @diffpal/diffpal.

Global Flags

FlagDefaultPurpose
--config-diremptyExtra config root directory searched before .config/diffpal/config.yaml.
--debugfalseEnable debug logging.
--profileemptyConfig profile name.

Command Overview

CommandPurpose
diffpal initGenerate starter workspace configuration.
diffpal review localRun provider-backed local review and print Markdown.
diffpal review githubRun review and publish/emit GitHub outputs.
diffpal review gitlabRun review and publish/emit GitLab outputs.
diffpal review adoRun review and publish/emit Azure DevOps outputs. Alias: azure.
diffpal doctorValidate runtime, provider, workspace, and platform auth.
diffpal debug promptRender prompts and task snapshots without a provider call.
diffpal sarifConvert a findings bundle to SARIF.
diffpal versionPrint version metadata.
diffpal completionGenerate shell completion scripts.

All public commands take flags only; there are no positional arguments in the commands documented below.

diffpal init

Generates .config/diffpal/config.yaml, .config/diffpal/.gitignore, .config/diffpal/templates/*, .config/diffpal/state/, and .diffpalignore.

FlagDefaultAllowed values
--wizardfalseboolean
--setupcodex-api-keycodex-api-key, codex-subscription, copilot-github-token, opencode-acp, generic-acp
--platformautoauto, github, gitlab, azure, none
--profileciletters, numbers, ., _, -
--block-onhighlow, medium, high, critical
--config.config/diffpal/config.yamlpath
--state.config/diffpal/statepath
--forcefalseoverwrite existing files

Example:

bash
npx -y @diffpal/diffpal@latest init --wizard --setup codex-api-key --platform github

Review Commands

Shared review flags:

FlagDefaultPurpose
--baseemptyBase revision. Host commands can also resolve this from CI metadata.
--heademptyHead revision. Host commands can also resolve this from CI metadata.
--repolocalRepository ID used in deterministic fingerprints and links.
--review-idcommand-specificReview identifier used in deterministic output.
--out.artifacts/diffpal/findings.jsonFindings bundle output path.
--languageconfig valueLanguage for findings and summaries.
--instructionsconfig valueReplace config review instructions for this run.
--instructions-fileemptyAppend instructions from a file.
--block-onconfig value or highMinimum blocking severity.
--feedbackreviewsummary or review.
--gatefalseReturn non-zero when blocking findings exist.

diffpal review local

Outputs:

  • writes the findings bundle to --out;
  • prints Markdown summary or review output to stdout.

Example:

bash
diffpal --profile ci review local \
  --base origin/main \
  --head HEAD \
  --feedback summary \
  --out .artifacts/diffpal/findings.json

diffpal review github

Additional flags:

FlagDefaultPurpose
--review-channeldiffpalGitHub publishing channel for PR reviews.
--summary-overviewtrueInclude semantic change overview in summaries.
--dry-runfalsePrint host review Markdown without publishing. Supported for GitHub only.

Environment inputs:

  • GITHUB_TOKEN for publishing unless config auth supplies a token;
  • GITHUB_REPOSITORY, GITHUB_EVENT_PATH, GITHUB_EVENT_NAME from GitHub Actions;
  • GITHUB_BASE_SHA and GITHUB_HEAD_SHA as fallback base/head inputs;
  • DIFFPAL_GITHUB_API_URL for tests or GitHub Enterprise API override.

Default surfaces:

  • summary: SARIF and summary;
  • review: PR review comments, SARIF, and summary.

Example:

bash
diffpal --profile ci review github \
  --base "$BASE_SHA" \
  --head "$HEAD_SHA" \
  --repo "$GITHUB_REPOSITORY" \
  --review-id "github-pr-${PR_NUMBER}" \
  --feedback review \
  --gate

diffpal review gitlab

--dry-run appears in the shared host help, but GitLab review rejects it.

Environment inputs:

  • GITLAB_TOKEN or CI_JOB_TOKEN for publishing unless config auth supplies a token;
  • CI_PROJECT_PATH, CI_MERGE_REQUEST_IID, CI_MERGE_REQUEST_DIFF_BASE_SHA, CI_MERGE_REQUEST_SOURCE_BRANCH_SHA, CI_COMMIT_SHA, CI_COMMIT_SHORT_SHA;
  • GITLAB_EVENT_PATH or CI_MERGE_REQUEST_EVENT_PATH as payload fallback;
  • CI_JOB_URL for status target URL;
  • DIFFPAL_GITLAB_API_URL for tests or self-managed GitLab API override.

Default surfaces:

  • summary: Code Quality, SARIF, status, and summary;
  • review: Code Quality, discussions, status, SARIF, and summary.

diffpal review ado

Alias: diffpal review azure.

--dry-run appears in the shared host help, but Azure review rejects it.

Environment inputs:

  • SYSTEM_ACCESSTOKEN or AZURE_DEVOPS_EXT_PAT for publishing unless config auth supplies a token;
  • SYSTEM_COLLECTIONURI, SYSTEM_TEAMPROJECT, BUILD_REPOSITORY_NAME, BUILD_REPOSITORY_ID, BUILD_REPOSITORY_URI, BUILD_BUILDID;
  • SYSTEM_PULLREQUEST_PULLREQUESTID, SYSTEM_PULLREQUEST_SOURCEBRANCH, SYSTEM_PULLREQUEST_TARGETBRANCH, SYSTEM_PULLREQUEST_SOURCECOMMITID, SYSTEM_PULLREQUEST_TARGETCOMMITID;
  • BUILD_SOURCEVERSION as a head/base fallback;
  • SYSTEM_PULLREQUEST_EVENT_PAYLOAD as payload fallback.

Default surfaces:

  • summary: status and summary;
  • review: PR threads, status, and summary.

diffpal doctor

Validates local runtime and environment.

FlagDefaultAllowed values
--modelocallocal, github, gitlab, ado

Outputs diagnostic lines to stdout. Missing selected-provider auth is a warning in local mode and an error in host modes. Platform auth is checked for host modes.

bash
diffpal --profile ci doctor --mode github

diffpal debug prompt

Renders the system prompt, task snapshot, and a mock findings bundle without a provider call. It still loads config and resolves the review scope.

Additional flags:

FlagDefaultAllowed values
--formattexttext, json
--dry-runtruesuppress normal review summary output

It also accepts the shared review analysis and policy flags.

bash
diffpal --profile ci debug prompt --base origin/main --head HEAD --format text

diffpal sarif

Converts a findings bundle to SARIF.

FlagDefaultPurpose
--input.artifacts/diffpal/findings.jsonInput findings bundle.
--out.artifacts/diffpal/diffpal.sarifOutput SARIF report.

Output line:

text
sarif=<path> findings=<count> version=<bundle-version>

diffpal version

Prints:

text
diffpal <version>+<git-commit> (<build-date>)

Development builds use 0.0.0-dev+unknown (unknown).

diffpal completion

Generates Cobra shell completion scripts. Use diffpal completion --help for the shell-specific subcommands generated by the CLI framework.

Released as open source software.