{"id":16974,"library":"code-push-cli","title":"CodePush CLI","description":"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.","status":"deprecated","version":"3.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/Microsoft/code-push","tags":["javascript","code","push","cordova","react-native","react"],"install":[{"cmd":"npm install code-push-cli","lang":"bash","label":"npm"},{"cmd":"yarn add code-push-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add code-push-cli","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is a global command-line interface. It is not designed for programmatic import or usage within a Node.js application via `require` or `import` statements. Its functionality is accessed directly through shell commands after global installation.","wrong":"import codePush from 'code-push-cli'","symbol":"code-push","correct":"npm install -g code-push-cli\n# Then use 'code-push <command>' in your terminal"},{"note":"This is a common subcommand pattern used for releasing React Native updates. It's invoked via the main `code-push` command in the terminal, not through programmatic imports. The command handles bundling and uploading.","wrong":"import { releaseReact } from 'code-push-cli'","symbol":"code-push release-react","correct":"code-push release-react MyAppName <platform> --target-binary-version \"1.0.0\" --output-dir ./build"},{"note":"This subcommand is used for registering new applications with the CodePush service via the command line. Each platform (iOS/Android) typically requires a separate application registration.","wrong":"import { appAdd } from 'code-push-cli'","symbol":"code-push app add","correct":"code-push app add MyAppName-iOS ios react-native\ncode-push app add MyAppName-Android android react-native"}],"quickstart":{"code":"npm install -g code-push-cli\n\n# 1. Register/Login to your CodePush account (opens browser for authentication)\ncode-push register\n\n# 2. Add an application (e.g., for iOS and Android)\ncode-push app add MyAwesomeApp-iOS ios react-native\ncode-push app add MyAwesomeApp-Android android react-native\n\n# 3. List your registered apps to verify\ncode-push app list\n\n# 4. Release an update for a React Native iOS app to the 'Staging' deployment\n# Note: Replace 'MyAwesomeApp-iOS' with your app name and '1.0.0' with your target binary version\ncode-push release-react MyAwesomeApp-iOS ios --target-binary-version \"1.0.0\" --description \"Initial staging release\" --mandatory true\n\n# IMPORTANT: This CLI is deprecated. Consider migrating to AppCenter CLI or alternatives:\n# npm install -g appcenter-cli\n# appcenter login\n# appcenter codepush release-react -a YourOrg/YourApp -d Staging","lang":"javascript","description":"Demonstrates the global installation of the CodePush CLI, account registration, adding applications, and performing a basic React Native release to a staging environment, highlighting its deprecated status."},"warnings":[{"fix":"Install `appcenter-cli` globally (`npm install -g appcenter-cli`) and use `appcenter codepush` commands. Alternatively, explore solutions like `NextPush` (`dpctl`), `Revopush` (`@revopush/code-push-cli`), or `Stallion` as drop-in replacements, following their respective migration guides.","message":"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.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"If you absolutely must use `code-push-cli`, always update to the latest available version (`npm update -g code-push-cli`) to ensure you have the most recent security patches. Ideally, migrate to an actively maintained alternative.","message":"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.","severity":"gotcha","affected_versions":"<4.2.3"},{"fix":"Migrate to a actively maintained CodePush alternative that provides both a client SDK and a server backend (e.g., AppCenter, NextPush, DeployPulse, Revopush, Stallion, Codemagic, or a self-hosted solution) to ensure operational continuity.","message":"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.","severity":"gotcha","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Run `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.","cause":"The `code-push-cli` package was not installed globally, or the global npm binaries directory is not in your system's PATH.","error":"code-push: command not found"},{"fix":"Execute `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>`.","cause":"The CLI requires authentication to interact with the CodePush service, and no active session or access key was found.","error":"Error: No access key specified. Please login by running 'code-push login' or 'code-push register'."},{"fix":"Verify 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>`.","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.","error":"Error: There is no app with the name 'YourAppName' under your account."}],"ecosystem":"npm","meta_description":null}