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
| Command | Description |
|---|---|
swiftpatch init | Set up Swiftpatch in your project. Patches native files, generates keys, creates the app. |
swiftpatch unlink | Reverse swiftpatch init cleanly. |
swiftpatch deploy | Bundle, sign, upload, and release in one step. |
swiftpatch login | Authenticate via browser or API key. |
swiftpatch logout | Clear stored credentials. |
swiftpatch whoami | Show the current authenticated user. |
swiftpatch doctor | Diagnose setup issues. Add --ai for deep analysis. |
swiftpatch status <releaseId> | Live SSE stream of rollout progress. |
Releases
| Command | Description |
|---|---|
swiftpatch releases list -a <app> | List releases for an app. |
swiftpatch releases rollout <id> --percent 50 | Update 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
| Command | Description |
|---|---|
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
| Command | Description |
|---|---|
swiftpatch generate-key-pair | Generate an Ed25519 keypair. |
AI
| Command | Description |
|---|---|
swiftpatch pr <clusterId> | Open a draft GitHub PR for a crash cluster (F8). |
swiftpatch ai doctor | Deep project analysis via Claude. |
swiftpatch ai explain | Generate a changelog from git log. |
swiftpatch ai review | Safety-review your JS/TS changes. |
swiftpatch ai crashes | List AI-clustered crash reports. |
swiftpatch ai risk-score <releaseId> | Get the AI risk assessment for a release. |
swiftpatch ai insights | View AI-generated insights. |
CI tokens
| Command | Description |
|---|---|
swiftpatch ci-tokens create | Generate a CI token. |
swiftpatch ci-tokens list | List 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
| Variable | Purpose |
|---|---|
SWIFTPATCH_CI_TOKEN | CI authentication token. |
SWIFTPATCH_API_URL | Override the API endpoint (self-hosted, staging). |
SWIFTPATCH_CLAUDE_API_KEY | Claude API key for AI commands. |
DEBUG | Enable verbose logs. |
Next steps
- Installation — install the CLI.
- Commands — full flag reference for every command.
- CI/CD — GitHub Actions, CircleCI, Bitrise examples.