Commands
Full reference for every Swiftpatch CLI command. Every command supports --help (or -h) for inline docs, and most support --json for machine-readable output.
Project setup
swiftpatch init
Initialize Swiftpatch in a React Native project. Patches native files, generates an Ed25519 keypair, creates (or links) an app in the dashboard, writes .swiftpatchrc, and updates .gitignore.
swiftpatch init [options]
| Flag | Description |
|---|---|
-y, --yes | Accept defaults (non-interactive). |
--manual | Skip auto-patching of native files. Print the exact snippets to paste, still generate keys and config. |
Idempotent — re-running is a no-op on already-patched files.
swiftpatch unlink
Reverse swiftpatch init cleanly. Removes the // swiftpatch-begin / // swiftpatch-end blocks from AppDelegate / MainApplication / Info.plist / strings.xml. Leaves your signing keys and .swiftpatchrc untouched.
swiftpatch unlink
swiftpatch doctor
Diagnose setup issues.
swiftpatch doctor [options]
| Flag | Description |
|---|---|
--json | JSON output (non-zero exit on any failure). |
--ai | Deep analysis via Claude. Requires a Claude API key. |
See AI doctor for the full story.
Authentication
swiftpatch login
Authenticate via browser OAuth.
swiftpatch login
swiftpatch logout
Clear stored credentials.
swiftpatch whoami
Print the current authenticated user and org.
Deploying
swiftpatch deploy
Bundle, sign, upload, and release in one step. The main command you'll use.
swiftpatch deploy -p <platform> [options]
| Flag | Description | Default |
|---|---|---|
-p, --platform <platform> | ios or android. Required. | Auto-detect. |
-a, --app <appIdOrSlug> | App to deploy to. | .swiftpatchrc app field. |
-o, --org <orgId> | Organization ID. | Default org. |
--app-version <semver> | Target app version. | package.json version. |
--channel <name> | Channel to ship to. | production. |
--rollout <percent> | Initial rollout percent (0–100). | Channel default. |
-n, --release-note <note> | Release notes. | Empty. |
-m, --mandatory | Mark as mandatory. | false. |
--paused | Ship paused (invisible until rollout set). | false. |
--hermes | Compile to Hermes bytecode. | false. |
--hermesc-path <path> | Custom hermesc binary. | Auto-resolve. |
-e, --entry-file <path> | Metro entry file. | index.js. |
--dev | Create a dev bundle (non-production). | false. |
--sourcemap | Upload source maps. | false. |
-k, --private-key <path> | Ed25519 private key. | .swiftpatchrc signingKey. |
--allow-unsigned | Ship without a signature (dev only). | false. |
--reproducible [true/false] | Strip absolute paths so the same commit hashes identically on any machine. | true. |
--ci-token <token> | CI auth token. | $SWIFTPATCH_CI_TOKEN. |
-y, --yes | Skip confirmation prompts. | false. |
--json | JSON output. | false. |
Example:
swiftpatch deploy -p ios --hermes --rollout 5 --release-note "v1.2.3 hotfix"
swiftpatch release-bundle
Two-step CI flow. Use when you bundle and upload in one job, then promote in another.
swiftpatch release-bundle --hash <bundleHash> [options]
swiftpatch status <releaseId>
Live SSE stream of rollout progress.
swiftpatch status r_abc123
| Flag | Description |
|---|---|
--json | One compact JSON object per line (one per SSE event). |
--watch [duration] | Stream for a given duration (e.g. 30s, 5m). |
--timeout <duration> | Disconnect after N seconds of silence. |
swiftpatch migrate from codepush / from expo-updates
Generate a migration plan for your project.
swiftpatch migrate from codepush
swiftpatch migrate from expo-updates
The plan includes file-by-file diffs, dependency swaps, and a checklist. See Migrating from CodePush.
Releases
swiftpatch releases list
swiftpatch releases list -a <appId> [--channel <name>] [--limit <n>] [--json]
swiftpatch releases rollout
Update a live rollout percent.
swiftpatch releases rollout r_abc --percent 50
swiftpatch releases rollback
Roll back a release for all devices on the next check.
swiftpatch releases rollback r_abc
Channels
swiftpatch channels list
swiftpatch channels list -a <app> [--json]
swiftpatch channels create
swiftpatch channels create <name> -a <app>
swiftpatch channels delete
swiftpatch channels delete <id> -a <app>
Apps
swiftpatch apps list / create / info / update / delete
swiftpatch apps list
swiftpatch apps create
swiftpatch apps info <appId>
swiftpatch apps update <appId>
swiftpatch apps delete <appId>
Signing
swiftpatch generate-key-pair
Generate an Ed25519 keypair for release signing.
swiftpatch generate-key-pair [options]
| Flag | Description | Default |
|---|---|---|
-o, --output <dir> | Where to write the keys. | ./.swiftpatch/keys. |
-f, --force | Overwrite existing keys (irreversible). | false. |
--json | JSON output. | false. |
See Bundle signing and Key rotation.
CI tokens
swiftpatch ci-tokens create / list / delete / regenerate
swiftpatch ci-tokens create --name "GitHub Actions"
swiftpatch ci-tokens list
swiftpatch ci-tokens delete <tokenId>
swiftpatch ci-tokens regenerate <tokenId>
Scope tokens with --apps and --channels:
swiftpatch ci-tokens create --apps my-ios-app,my-android-app --channels staging,production
AI
swiftpatch pr <clusterId>
Open a draft GitHub PR from a crash cluster (F8). See F8 setup.
swiftpatch pr crash_abc123 [options]
| Flag | Description |
|---|---|
--title <title> | Override the PR title. |
--body <body> | Override the PR body. |
--dry-run | Print the plan without opening a PR. |
--local | Use the local git apply flow instead of the GitHub App. |
--branch <name> | Override the branch name. |
--base <branch> | Override the base branch. |
--json | JSON output. |
swiftpatch ai doctor / explain / review
Local AI commands. See AI doctor.
swiftpatch ai ask / risk-score / crashes / insights
Backend AI commands. Require Swiftpatch auth (no Claude API key needed).
swiftpatch ai ask "Why did r_abc crash?"
swiftpatch ai risk-score r_abc
swiftpatch ai crashes -a my-app
swiftpatch ai insights -a my-app
Configuration
swiftpatch config
CLI-level config. Stored encrypted at ~/.swiftpatch/config.
swiftpatch config set <key> <value>
swiftpatch config get <key>
swiftpatch config delete <key>
swiftpatch config list
| Key | Purpose |
|---|---|
apiUrl | Override the API endpoint. |
defaultOrg | Default organization. |
defaultApp | Default app. |
defaultPlatform | Default platform for deploy. |
defaultChannel | Default channel. |
claudeApiKey | Claude API key for local AI commands. |
Exit codes
Every command exits with a stable code:
| Code | Meaning |
|---|---|
0 | Success. |
1 | Generic failure. |
2 | Validation error (bad flag, missing arg). |
3 | Authentication failure. |
4 | Network / API error. |
5 | Signing error. |
6 | Build / bundle error. |
--json always includes { "ok": boolean, "code": string, ... }.
Next steps
- CI/CD — GitHub Actions, CircleCI, Bitrise.
- Overview — tour of the most-used commands.
- Staged rollouts — automate multi-step rollouts.