CLI Reference
Complete command reference for CodePush CLI tools
CodePush CLI Commands
Comprehensive reference for all CodePush CLI commands and options.
Installation
npm install -g code-push-cli
Global Options
These options can be used with any command:
--version
- Display CLI version--help
- Show help for any command--server <url>
- Specify CodePush server URL--proxy <url>
- Specify proxy server--no-color
- Disable colored output
login
Authenticate with your CodePush server.
code-push login [server-url] Options: --server <url> CodePush server URL --accessKey <key> Use existing access key Examples: code-push login {process.env.SERVER_URL || 'https://server.codepush.online'} code-push login --accessKey abc123...
logout
Sign out of your current session.
code-push logout Examples: code-push logout
whoami
Display current authenticated user.
code-push whoami Examples: code-push whoami
access-key add
Create a new access token.
code-push access-key add <description> Options: --ttl <seconds> Token time-to-live (default: no expiration) Examples: code-push access-key add "CI/CD Pipeline" code-push access-key add "CLI Token" --ttl 86400
access-key list
List all access tokens.
code-push access-key list code-push access-key ls Examples: code-push access-key list
access-key remove
Remove an access token.
code-push access-key remove <keyName> code-push access-key rm <keyName> Examples: code-push access-key remove "CLI Token"
app add
Create a new application.
code-push app add <appName> <platform> Platforms: ios iOS platform android Android platform Examples: code-push app add MyApp-iOS ios code-push app add MyApp-Android android
app list
List all applications.
code-push app list code-push app ls Options: --format <table|json> Output format (default: table) Examples: code-push app list code-push app list --format json
app remove
Delete an application.
code-push app remove <appName> code-push app rm <appName> Examples: code-push app remove MyApp-iOS
app rename
Rename an application.
code-push app rename <currentName> <newName> Examples: code-push app rename MyApp-iOS MyNewApp-iOS
deployment add
Create a new deployment.
code-push deployment add <appName> <deploymentName> Examples: code-push deployment add MyApp-iOS Staging code-push deployment add MyApp-iOS Production
deployment list
List deployments for an application.
code-push deployment list <appName> code-push deployment ls <appName> Options: --format <table|json> Output format (default: table) --displayKeys Show deployment keys Examples: code-push deployment list MyApp-iOS code-push deployment list MyApp-iOS --displayKeys
deployment remove
Delete a deployment.
code-push deployment remove <appName> <deploymentName> code-push deployment rm <appName> <deploymentName> Examples: code-push deployment remove MyApp-iOS Staging
deployment rename
Rename a deployment.
code-push deployment rename <appName> <currentName> <newName> Examples: code-push deployment rename MyApp-iOS Staging Beta
release
Release an update to a deployment.
code-push release <appName> <updateContents> <targetBinaryVersion> Options: --deploymentName <name> Deployment name (default: Staging) --description <desc> Update description --mandatory Mark update as mandatory --rollout <percentage> Rollout percentage (1-100, default: 100) --disabled Release in disabled state --privateKeyPath <path> Code signing private key path Examples: code-push release MyApp-iOS ./CodePush 1.0.0 code-push release MyApp-iOS ./CodePush 1.0.0 --mandatory code-push release MyApp-iOS ./CodePush 1.0.0 --rollout 25
release-react
Release a React Native update.
code-push release-react <appName> <platform> Options: --bundleName <name> Bundle name (default: platform dependent) --deploymentName <name> Deployment name (default: Staging) --description <desc> Update description --development Generate dev build --entryFile <file> Entry file (default: index.js) --gradleFile <file> Gradle file path (Android) --mandatory Mark update as mandatory --outputDir <dir> Output directory --plistFile <file> Plist file path (iOS) --rollout <percentage> Rollout percentage (1-100, default: 100) --sourcemapOutput <path> Source map output path --targetBinaryVersion <version> Target binary version Examples: code-push release-react MyApp-iOS ios code-push release-react MyApp-Android android --mandatory code-push release-react MyApp-iOS ios --rollout 50 --description "Bug fixes"
promote
Promote a release from one deployment to another.
code-push promote <appName> <sourceDeployment> <destDeployment> Options: --description <desc> New description --mandatory Mark as mandatory --rollout <percentage> Rollout percentage (1-100, default: 100) --targetBinaryVersion <version> Target binary version Examples: code-push promote MyApp-iOS Staging Production code-push promote MyApp-iOS Staging Production --mandatory --rollout 25
rollback
Rollback to a previous release.
code-push rollback <appName> <deploymentName> Options: --targetRelease <label> Specific release to rollback to Examples: code-push rollback MyApp-iOS Production code-push rollback MyApp-iOS Production --targetRelease v5
patch
Update release metadata without releasing new content.
code-push patch <appName> <deploymentName> Options: --label <label> Release label to patch (default: latest) --mandatory <true|false> Update mandatory status --rollout <percentage> Update rollout percentage --description <desc> Update description --disabled <true|false> Enable/disable release Examples: code-push patch MyApp-iOS Production --rollout 100 code-push patch MyApp-iOS Production --label v5 --mandatory true
deployment history
View release history for a deployment.
code-push deployment history <appName> <deploymentName> Options: --format <table|json> Output format (default: table) --displayAuthor Show release author Examples: code-push deployment history MyApp-iOS Production code-push deployment history MyApp-iOS Production --format json
collaborator add
Add a collaborator to an application.
code-push collaborator add <appName> <email> Examples: code-push collaborator add MyApp-iOS user@example.com
collaborator list
List collaborators for an application.
code-push collaborator list <appName> code-push collaborator ls <appName> Examples: code-push collaborator list MyApp-iOS
collaborator remove
Remove a collaborator from an application.
code-push collaborator remove <appName> <email> code-push collaborator rm <appName> <email> Examples: code-push collaborator remove MyApp-iOS user@example.com
Configuration
Configure CLI defaults and server settings:
Set Default Server
# Set global server URL code-push login http://your-server.com # Use environment variable export CODE_PUSH_SERVER=http://your-server.com
Proxy Configuration
# Use proxy for all requests code-push login --proxy http://proxy.company.com:8080 # Set environment variable export HTTPS_PROXY=http://proxy.company.com:8080
Exit Codes
0
- Success1
- General error2
- Authentication error3
- Permission denied4
- Resource not found5
- Conflict (resource already exists)