Skip to main content

CLI Overview

swiftpatch-cli is how you ship OTA updates. Bundle your JavaScript, sign it with Ed25519, upload to the CDN, and create a live release — all in one command.

Install

npm install -g swiftpatch-cli

Requires Node.js 20 or higher. Or run without installing globally via npx swiftpatch-cli <command>.

The three-command workflow

# 1. Log in (opens a browser)
swiftpatch login

# 2. Link your project (first time only)
npx swiftpatch init

# 3. Ship
swiftpatch deploy -p ios --hermes

For the full story of what swiftpatch init does, see SDK installation.

Core commands

CommandDescription
swiftpatch initSet up Swiftpatch in your project. Patches native files, generates keys, creates the app.
swiftpatch unlinkReverse swiftpatch init cleanly.
swiftpatch deployBundle, sign, upload, and release in one step.
swiftpatch loginAuthenticate via browser or API key.
swiftpatch logoutClear stored credentials.
swiftpatch whoamiShow the current authenticated user.
swiftpatch doctorDiagnose setup issues. Add --ai for deep analysis.
swiftpatch status <releaseId>Live SSE stream of rollout progress.

Releases

CommandDescription
swiftpatch releases list -a <app>List releases for an app.
swiftpatch releases rollout <id> --percent 50Update a rollout percent.
swiftpatch releases rollback <id>Roll back a release across all devices.
swiftpatch release-bundle --hash <hash>Promote a pre-built bundle (CI two-step flow).

Channels

CommandDescription
swiftpatch channels list -a <app>List channels for an app.
swiftpatch channels create <name> -a <app>Create a channel.
swiftpatch channels delete <id> -a <app>Delete a channel.

Signing

CommandDescription
swiftpatch generate-key-pairGenerate an Ed25519 keypair.

AI

CommandDescription
swiftpatch pr <clusterId>Open a draft GitHub PR for a crash cluster (F8).
swiftpatch ai doctorDeep project analysis via Claude.
swiftpatch ai explainGenerate a changelog from git log.
swiftpatch ai reviewSafety-review your JS/TS changes.
swiftpatch ai crashesList AI-clustered crash reports.
swiftpatch ai risk-score <releaseId>Get the AI risk assessment for a release.
swiftpatch ai insightsView AI-generated insights.

CI tokens

CommandDescription
swiftpatch ci-tokens createGenerate a CI token.
swiftpatch ci-tokens listList CI tokens.
swiftpatch ci-tokens delete <id>Revoke a CI token.
swiftpatch ci-tokens regenerate <id>Regenerate a CI token.

Authentication

Local dev

swiftpatch login

Opens a browser, completes OAuth, stores an encrypted token at ~/.swiftpatch/config. Subsequent commands authenticate automatically.

CI

Use a scoped CI token:

export SWIFTPATCH_CI_TOKEN=sp_ci_xxxxx
swiftpatch deploy -p ios --hermes

Or pass with --ci-token:

swiftpatch deploy -p ios --hermes --ci-token sp_ci_xxxxx

Create tokens from swiftpatch ci-tokens create or the dashboard. Scope them to specific apps and channels.

Output modes

Every command supports --json for machine-readable output:

swiftpatch deploy -p ios --hermes --json
{
"ok": true,
"release": {
"id": "r_abc123",
"version": "1.2.3",
"bundleHash": "sha256:...",
"rolloutPercent": 100
}
}

Exit codes follow a stable taxonomy — see CI/CD.

Environment variables

VariablePurpose
SWIFTPATCH_CI_TOKENCI authentication token.
SWIFTPATCH_API_URLOverride the API endpoint (self-hosted, staging).
SWIFTPATCH_CLAUDE_API_KEYClaude API key for AI commands.
DEBUGEnable verbose logs.

Next steps

  • Installation — install the CLI.
  • Commands — full flag reference for every command.
  • CI/CD — GitHub Actions, CircleCI, Bitrise examples.