Skip to main content

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]
FlagDescription
-y, --yesAccept defaults (non-interactive).
--manualSkip 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.

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]
FlagDescription
--jsonJSON output (non-zero exit on any failure).
--aiDeep 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]
FlagDescriptionDefault
-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, --mandatoryMark as mandatory.false.
--pausedShip paused (invisible until rollout set).false.
--hermesCompile to Hermes bytecode.false.
--hermesc-path <path>Custom hermesc binary.Auto-resolve.
-e, --entry-file <path>Metro entry file.index.js.
--devCreate a dev bundle (non-production).false.
--sourcemapUpload source maps.false.
-k, --private-key <path>Ed25519 private key..swiftpatchrc signingKey.
--allow-unsignedShip 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, --yesSkip confirmation prompts.false.
--jsonJSON 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
FlagDescription
--jsonOne 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]
FlagDescriptionDefault
-o, --output <dir>Where to write the keys../.swiftpatch/keys.
-f, --forceOverwrite existing keys (irreversible).false.
--jsonJSON 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]
FlagDescription
--title <title>Override the PR title.
--body <body>Override the PR body.
--dry-runPrint the plan without opening a PR.
--localUse the local git apply flow instead of the GitHub App.
--branch <name>Override the branch name.
--base <branch>Override the base branch.
--jsonJSON 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
KeyPurpose
apiUrlOverride the API endpoint.
defaultOrgDefault organization.
defaultAppDefault app.
defaultPlatformDefault platform for deploy.
defaultChannelDefault channel.
claudeApiKeyClaude API key for local AI commands.

Exit codes​

Every command exits with a stable code:

CodeMeaning
0Success.
1Generic failure.
2Validation error (bad flag, missing arg).
3Authentication failure.
4Network / API error.
5Signing error.
6Build / 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.