Command-line interface for releasing and managing over-the-air (OTA) React Native updates with Codemagic Patch. Provides the cmpatch command.
- Node.js
20.19+or22.12+
npm install -g @codemagic/patch-cli# 1. Authenticate against your Codemagic Patch server
# (opens the dashboard sign-in in your browser; add --no-browser to just
# print the URL, or --token <cm_pat_...> for headless machines)
cmpatch login --server-url https://updates.example.com
# 2. Set up project defaults
cmpatch init
# 3. Publish a React Native bundle as an OTA release
cmpatch release-react --deployment Staging --dry-run # preview first
cmpatch release-react --deployment Staging| Group | Description |
|---|---|
release |
Publish, inspect, patch, promote, and roll back OTA releases. |
management |
Manage apps, deployments, and deployment history. |
auth |
Authenticate, manage tokens, and manage team members. |
diagnostics |
Diagnose local setup and OTA readiness (cmpatch doctor). |
config |
Store defaults and inspect the effective local context. |
fingerprint |
Compute fingerprints and inspect device update logs. |
Use cmpatch help <group> for the commands in a group, cmpatch help <command> for per-command usage and examples, and cmpatch --version to print the CLI version.
Most commands accept --format json|table. When stdout is a terminal, output defaults to a human-readable table; when piped, it defaults to JSON, so the CLI is directly scriptable:
cmpatch app list --format json | jq '.apps[].name'| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Server or runtime error (not found, conflict, rate limited, …) |
| 2 | Authentication required or usage error |
| 3 | Validation error |
| 4 | Account disabled |
| 130 | Interactive prompt aborted (Ctrl-C) |
- User config:
~/.codemagic-patch/config.json— CLI-wide defaults such asserverUrl. Credentials are stored per server in~/.codemagic-patch/credentials.json. Set theCODEMAGIC_PATCH_HOMEenvironment variable to relocate this directory. - Project config:
codemagic-patch.config.jsonat your project root (or acodemagicPatchkey inpackage.json) — per-project defaults such asapp,deployment, and platform-specific overrides. Created bycmpatch init.
Explicit flags always take precedence over configured defaults. Run cmpatch context to inspect the effective configuration, and cmpatch doctor to diagnose setup issues.