code-push-itspar
v1.0.5
Published
Management CLI for CodePush - deploy mobile app updates over-the-air
Maintainers
Readme
CodePush CLI
The CodePush CLI is a Node.js application that allows users to deploy and manage over-the-air updates for React Native applications.
📦 NPM Package: https://www.npmjs.com/package/code-push-itspar
Installation & Usage
Global Installation (recommended)
npm install -g code-push-itsparAfter global installation, you can use the CLI directly:
code-push-itspar <command>Yarn Global Installation (optional)
yarn global add code-push-itsparIf code-push-itspar is not found after a yarn global install, your shell PATH
does not include Yarn’s global bin. Use npm global install (recommended) or add
Yarn’s global bin to PATH.
Troubleshooting: If you get a "permission denied" error on macOS/Linux, run:
chmod +x $(npm root -g)/code-push-itspar/bin/script/cli.jsProject Installation
# Using npm
npm install --save-dev code-push-itspar
# Using yarn
yarn add --dev code-push-itsparAfter project installation, you can use the CLI through npm/yarn:
# Using npm
npm run code-push-itspar <command>
# Using yarn
yarn code-push-itspar <command>
# Using npx
npx code-push-itspar <command>Authentication
Most commands require authentication. You'll need an access key and server URL to use the CLI.
Login
# Login with access key and server URL
code-push-itspar login --accessKey <your-access-key> <server-url>
# Example
code-push-itspar login --accessKey abc123xyz https://server.codepush.online
# Check login status
code-push-itspar whoami
# Logout
code-push-itspar logoutTo get an access key:
- Visit your CodePush Dashboard
- Go to Settings → Generate New Token
- 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:
- Full Bundle (sending fully updated bundle)
- Patch Bundle (sending only the diff)
Command Structure
code-push-itspar release <appName> <updateContents> <targetBinaryVersion>
[--deploymentName <deploymentName>]
[--description <description>]
[--disabled <disabled>]
[--mandatory]
[--noDuplicateReleaseError]
[--rollout <rolloutPercentage>]
[--isPatch <true|false>] # 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:
--deploymentNameor-d: Target deployment ("Staging" or "Production", defaults to "Staging")--descriptionor-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). Default is 2% if not specified.--isPatch: Whether this is a patch updatefalse(default): Full bundle updatetrue: Patch update (requires patch bundle)
--compression: Compression algorithm to usedeflate(default): Standard compressionbrotli: Better compression, smaller bundle size
Full Bundle Release
Release a complete new bundle:
# Release to staging with deflate compression (default)
code-push-itspar release MyApp-iOS ./codepush 1.0.0 \
--deploymentName Staging \
--description "New features" \
--isPatch false
# Release with brotli compression (better compression)
code-push-itspar release MyApp-iOS ./dist/bundle "^1.0.0" \
--deploymentName Production \
--mandatory \
--isPatch false \
--compression brotliNote about compression: Brotli typically achieves better compression ratios than deflate (e.g., 23.1MB → 8.14MB with Brotli vs 11.04MB with deflate).
Patch Bundle Release
For smaller updates, first create a patch and then release it:
- Create patch between old and new bundles:
code-push-itspar create-patch \
./old-bundle \
./new-bundle \
./.codepush/patches- Release the patch:
# Release patch with brotli compression
code-push-itspar release MyApp-iOS ./.codeupush/patches "1.0.0" \
--deploymentName Staging \
--description "Bug fixes" \
--isPatch true \
--compression brotliNote about patches: Patch updates significantly reduce the update size as they only contain the changes between versions. Always use
--isPatch truewhen 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.
Promote Updates
After testing in staging, promote to production:
# Basic promotion
code-push-itspar promote MyApp-iOS Staging Production
# Promotion with options
code-push-itspar promote MyApp-iOS Staging Production \
--rollout 25 \ # Release to 25% of users
--description "Verified update" # Update descriptionContributing
For information about contributing to CodePush CLI, please see our Contributing Guide.
Note: For additional commands and advanced features, see our Advanced Usage Guide.
