Configuration Reference

Upshift reads configuration from .upshiftrc.json, .upshiftrc, or upshift.config.json in the project directory. Create a file with upshift init.

File location

  • Lookup order: .upshiftrc.json.upshiftrcupshift.config.json
  • Scope: Project directory (where you run upshift). No global config file; use env vars or repeat config per project.

Schema overview

{
  "ignore": [],
  "defaultMode": "minor",
  "autoTest": true,
  "autoConfirm": false,
  "ai": { "autoEnable": false, "maxCredits": 50 },
  "scan": { "exclude": [], "minSeverity": "low" },
  "approval": { "mode": "prompt", "requireFor": ["major"], "webhookUrl": null },
  "upgradePolicy": null,
  "registry": { "url": null, "token": null }
}

Top-level options

OptionTypeDefaultDescription
ignorestring[][]Package names (or globs like @types/*) to skip when upgrading.
defaultMode"all" | "minor" | "patch""minor"Default mode for batch upgrade (upshift upgrade --all).
autoTestbooleantrueRun tests after upgrade; roll back if tests fail.
autoConfirmbooleanfalseSkip confirmation prompts (e.g. major upgrade, batch confirm). Use with care.
testCommandstring | string[]autoFor Python/non-Node: command to run after upgrade (e.g. "pytest" or ["poetry", "run", "pytest"]). If tests fail, upgrade is rolled back.

ai

OptionTypeDefaultDescription
autoEnablebooleanfalseAutomatically use AI for explain when available.
maxCreditsnumber50Max credits to use per session (cap).

scan

OptionTypeDefaultDescription
excludestring[][]Package names to exclude from scan results.
minSeverity"low" | "moderate" | "high" | "critical""low"Minimum severity to include in scan output.

approval (HITL)

Controls when Upshift asks for approval before applying an upgrade.

OptionTypeDefaultDescription
mode"prompt" | "none" | "webhook""prompt"prompt — Ask in terminal for major (or all) upgrades. none — Never prompt. webhook — POST proposed upgrade to webhookUrl; 200 = approve, non-200 = reject.
requireFor("major" | "all")[]["major"]When to require approval: major = only major version bumps; all = every upgrade.
webhookUrlstring | nullnullURL for webhook approval. POST body: { event: "upgrade_proposed", packageName, currentVersion, targetVersion, cwd, timestamp }. Respond 200 to approve.

Example (webhook):

"approval": {
  "mode": "webhook",
  "requireFor": ["major"],
  "webhookUrl": "https://your-service.com/upshift/approve"
}

upgradePolicy

Block upgrades above a risk level. Risk is computed from major delta, vulnerabilities, and popularity.

OptionTypeDefaultDescription
blockRisk("high" | "medium")[]Block upgrades with this risk level. E.g. ["high"] blocks high-risk only; ["high", "medium"] blocks both. Use -y on the CLI to override.

Example:

"upgradePolicy": {
  "blockRisk": ["high"]
}

registry

OptionTypeDefaultDescription
urlstring | nullnullCustom npm registry URL.
tokenstring | nullnullAuth token (or env var reference like $NPM_TOKEN).

Example: strict policy + webhook

{
  "ignore": ["@types/*"],
  "defaultMode": "minor",
  "autoTest": true,
  "autoConfirm": false,
  "approval": {
    "mode": "webhook",
    "requireFor": ["major"],
    "webhookUrl": "https://api.example.com/upshift/approve"
  },
  "upgradePolicy": {
    "blockRisk": ["high"]
  }
}

Override with CLI

  • -y / --yes — Skips approval prompts and policy block (use with care).
  • --skip-tests — Skips running tests after upgrade (overrides autoTest for that run).
  • --dry-run — No file changes; policy and approval still apply unless -y.

Environment variables (Team / audit)

For Team/Enterprise and audit logging, the CLI supports:

VariableDescription
UPSHIFT_AUDIT_URLWhen set, the CLI POSTs audit events (upgrade, fix, scan_upload) to this URL after each action. Fire-and-forget; no impact on CLI flow if the request fails. You can use the built-in Supabase Edge Function: deploy audit-events and set this to https://<project-ref>.supabase.co/functions/v1/audit-events.
UPSHIFT_ORGWhen set, included as org_id in audit payloads (and future credit/billing calls) so the platform can attribute usage to the org.
UPSHIFT_API_TOKENOptional. Sent as Authorization: Bearer <token> when POSTing to UPSHIFT_AUDIT_URL.

See Team features for platform schema and API shape.

See also