Management CLI for CodePush - deploy mobile app updates over-the-air
npm install code-push-itsparThe CodePush CLI is a Node.js application that allows users to deploy and manage over-the-air updates for React Native applications.
bash
npm install -g code-push-itspar
`Or using yarn:
`bash
yarn global add code-push-itspar
`After global installation, you can use the CLI directly:
`bash
code-push-itspar
`$3
`bash
Using npm
npm install --save-dev code-push-itsparUsing yarn
yarn add --dev code-push-itspar
`
After project installation, you can use the CLI through npm/yarn:
`bash
Using npm
npm run code-push-itspar Using yarn
yarn code-push-itspar Using npx
npx code-push-itspar
`Authentication
Most commands require authentication. You'll need an access key and server URL to use the CLI.
$3
`bash
Login with access key and server URL
code-push-itspar login --accessKey Example
code-push-itspar login --accessKey abc123xyz https://codepush.jaswantdhayal.comCheck login status
code-push-itspar whoamiLogout
code-push-itspar logout
`To get an access key:
1. Visit your CodePush Dashboard
2. Go to Settings → Generate New Token
3. Generate a new access key
Release Management
The
release command allows you to deploy updates to your app. There are two types of updates you can release:1. Full Bundle (sending fully updated bundle)
2. Patch Bundle (sending only the diff)
$3
`bash
code-push-itspar release
[--deploymentName ]
[--description ]
[--disabled ]
[--mandatory]
[--noDuplicateReleaseError]
[--rollout ]
[--isPatch ] # Default false. Specify true in case sending patch bundle.
[--compression <'deflate' | 'brotli'>] # 'deflate' (default) or 'brotli' (better compression)
`Parameters:
Required Parameters:
-
appName: Name of your app (e.g., "MyApp-iOS")
- updateContents: Path to your update files (bundle/assets)
- targetBinaryVersion: App store version this update is for. Can be:
- Exact version: "1.0.0"
- Range: "^1.0.0" (compatible with 1.x.x)
- Wildcard: "*" (all versions)Optional Parameters:
-
--deploymentName or -d: Target deployment ("Staging" or "Production", defaults to "Staging")
- --description or -des: Release notes or changelog
- --disabled: Prevents update from being downloaded (useful for staged rollouts)
- --mandatory: Forces users to accept this update
- --noDuplicateReleaseError: Shows warning instead of error if releasing same content
- --rollout: Percentage of users who should receive this update (1-100)
- --isPatch: Whether this is a patch update
- false (default): Full bundle update
- true: Patch update (requires patch bundle)
- --compression: Compression algorithm to use
- deflate (default): Standard compression
- brotli: Better compression, smaller bundle size$3
Release a complete new bundle:
`bash
Release to staging with deflate compression (default)
code-push-itspar release MyApp-iOS ./codepush 1.0.0 \
--deploymentName Staging \
--description "New features" \
--isPatch falseRelease with brotli compression (better compression)
code-push-itspar release MyApp-iOS ./dist/bundle "^1.0.0" \
--deploymentName Production \
--mandatory \
--isPatch false \
--compression brotli
`> Note about compression: Brotli typically achieves better compression ratios than deflate (e.g., 23.1MB → 8.14MB with Brotli vs 11.04MB with deflate).
$3
For smaller updates, first create a patch and then release it:1. Create patch between old and new bundles:
`bash
code-push-itspar create-patch \
./old-bundle \
./new-bundle \
./.codepush/patches
`2. Release the patch:
`bash
Release patch with brotli compression
code-push-itspar release MyApp-iOS ./.codeupush/patches "1.0.0" \
--deploymentName Staging \
--description "Bug fixes" \
--isPatch true \
--compression brotli
`> Note about patches: Patch updates significantly reduce the update size as they only contain the changes between versions. Always use
--isPatch true when releasing a patch bundle._Note: Make sure to upload assets alongwith patch bundle._
For more details about the binary diff implementation, see bsdiff/README.md.
$3
After testing in staging, promote to production:
`bash
Basic promotion
code-push-itspar promote MyApp-iOS Staging ProductionPromotion with options
code-push-itspar promote MyApp-iOS Staging Production \
--rollout 25 \ # Release to 25% of users
--description "Verified update" # Update description
``For information about contributing to CodePush CLI, please see our Contributing Guide.
---
Note: For additional commands and advanced features, see our Advanced Usage Guide.