CodePush CLI
CodePush CLI was a command-line interface designed for the CodePush cloud service, enabling Cordova and React Native developers to deploy mobile app updates directly to user devices. It facilitated over-the-air updates for JavaScript, HTML, CSS, and images, allowing for rapid bug fixes and minor feature additions without requiring new app store submissions. While the last version observed is v4.2.3, which primarily included vulnerability fixes, `code-push-cli` is officially deprecated and no longer supported. Users are strongly advised to migrate to `AppCenter-CLI` or other modern alternatives like `NextPush`, `DeployPulse`, or `Stallion` for continued service and support. Its original key differentiator was enabling swift iteration and a direct engagement model for hybrid app developers.
Common errors
-
code-push: command not found
cause The `code-push-cli` package was not installed globally, or the global npm binaries directory is not in your system's PATH.fixRun `npm install -g code-push-cli`. If the issue persists on macOS/Linux, you might need `sudo npm install -g code-push-cli` or ensure npm's global bin path is in your shell's PATH environment variable. -
Error: No access key specified. Please login by running 'code-push login' or 'code-push register'.
cause The CLI requires authentication to interact with the CodePush service, and no active session or access key was found.fixExecute `code-push register` for initial setup, which launches a browser for authentication. If you have an existing account or access key, use `code-push login` or `code-push login --accessKey <YOUR_ACCESS_KEY>`. -
Error: There is no app with the name 'YourAppName' under your account.
cause The application name provided in a command (e.g., `code-push release-react YourAppName ...`) does not exactly match a registered application associated with your authenticated CodePush account.fixVerify the application name for typos. Use `code-push app list` to see all applications registered under your account and their exact names. If the app doesn't exist, create it using `code-push app add <appName>`.
Warnings
- breaking The `code-push-cli` package is officially deprecated and no longer supported by Microsoft. Users should migrate to `AppCenter-CLI` or community-driven alternatives for equivalent functionality, active maintenance, and continued support.
- gotcha Multiple security vulnerabilities (e.g., `vm2`, `ip`, `cookiejar`, `superagent-proxy`) have been identified and patched across various versions. While recent v4.x releases address many of these, using older, unpatched versions can expose development environments to risks.
- gotcha The CodePush service, particularly its backend provided by Microsoft App Center, was retired in March 2025. Even if the CLI is installed, the underlying service it connects to may no longer be operational, or its functionality severely limited.
Install
-
npm install code-push-cli -
yarn add code-push-cli -
pnpm add code-push-cli
Imports
- code-push
import codePush from 'code-push-cli'
npm install -g code-push-cli # Then use 'code-push <command>' in your terminal
- code-push release-react
import { releaseReact } from 'code-push-cli'code-push release-react MyAppName <platform> --target-binary-version "1.0.0" --output-dir ./build
- code-push app add
import { appAdd } from 'code-push-cli'code-push app add MyAppName-iOS ios react-native code-push app add MyAppName-Android android react-native
Quickstart
npm install -g code-push-cli # 1. Register/Login to your CodePush account (opens browser for authentication) code-push register # 2. Add an application (e.g., for iOS and Android) code-push app add MyAwesomeApp-iOS ios react-native code-push app add MyAwesomeApp-Android android react-native # 3. List your registered apps to verify code-push app list # 4. Release an update for a React Native iOS app to the 'Staging' deployment # Note: Replace 'MyAwesomeApp-iOS' with your app name and '1.0.0' with your target binary version code-push release-react MyAwesomeApp-iOS ios --target-binary-version "1.0.0" --description "Initial staging release" --mandatory true # IMPORTANT: This CLI is deprecated. Consider migrating to AppCenter CLI or alternatives: # npm install -g appcenter-cli # appcenter login # appcenter codepush release-react -a YourOrg/YourApp -d Staging