Skip to main content

CLI Overview

The Source Push CLI is a powerful command-line tool that enables you to manage your apps, deployments, and releases.

Installation

Install the CLI globally using npm:

npm install -g @srcpush/code-push-cli

Authentication

Before using the CLI, you need to authenticate:

srcpush login

Core Commands

App Management

# Create a new app
srcpush app add <appName>

# List all apps
srcpush app list

# Remove an app
srcpush app remove <appName>

# Rename an app
srcpush app rename <currentName> <newName>

Deployment Management

# List deployments
srcpush deployment list <appName>

# Add a deployment
srcpush deployment add <appName> <deploymentName>

# Remove a deployment
srcpush deployment remove <appName> <deploymentName>

# Rename a deployment
srcpush deployment rename <appName> <oldDeploymentName> <newDeploymentName>

Release Management

# Release an update (React Native)
srcpush release-react <appName> <platform>

# Release with options
srcpush release-react <appName> <platform> --description "Bug fixes" --mandatory

# Promote a release
srcpush promote <appName> <sourceDeployment> <destDeployment>

# Rollback a release
srcpush rollback <appName> <deploymentName>

Common Options

Most commands support the following options:

  • -h, --help: Show help information
  • -v, --version: Show CLI version
  • -a, --app <appName>: Specify the app name
  • -d, --deployment <deploymentName>: Specify the deployment name

Environment Variables

The CLI supports the following environment variables:

  • SRCPUSH_ACCESS_KEY: Authentication token
  • SRCPUSH_PROXY: HTTP proxy for API calls
  • SRCPUSH_CUSTOM_API_URL: Custom API server URL

CI/CD Integration

For CI/CD environments, you can authenticate using an access key:

srcpush login --accessKey <accessKey>

Examples

Basic Release Workflow

# Create a new app
srcpush app add MyApp

# Release to staging
srcpush release-react MyApp ios -d Staging

# Promote to production after testing
srcpush promote MyApp Staging Production

Advanced Release Options

# Release with specific options
srcpush release-react MyApp android \
--description "New feature: Dark mode" \
--mandatory \
--rollout 25 \
--targetBinaryVersion "~1.2.0"

Next Steps