@appspacer/cli
v1.0.1
Published
Professional-grade Over-The-Air (OTA) update CLI for React Native. Deploy JavaScript bundles and assets instantly — no app store review required.
Maintainers
Readme
AppSpacer CLI
Professional-grade Over-The-Air (OTA) update CLI for React Native. Deploy JavaScript bundles and assets instantly — no app store review required.
AppSpacer CLI lets you bundle, sign, and deploy over-the-air updates to your mobile apps in seconds. It also includes a built-in secrets vault for managing environment variables across teams.
Full documentation: docs.appspacer.com
Installation
npm install -g @appspacer/cliRequirements: Node.js 18 or higher.
Quick Start
# 1. Authenticate
appspacer login -t pat_your_token_here
# 2. Auto-configure your native project (React Native only)
appspacer setup
# 3. Push an OTA update
appspacer release-react-native android -a my-app -d Staging -t 1.0.0Commands
appspacer login
Authenticate with AppSpacer using a Personal Access Token (PAT).
appspacer login -t pat_your_token_here
# Interactive — prompts for token if -t is omitted
appspacer login| Flag | Description |
|------|-------------|
| -t, --token <token> | Personal Access Token (must start with pat_) |
| --api-url <url> | Override the API base URL (for self-hosted deployments) |
Generate tokens at appspacer.com/settings/tokens.
appspacer whoami
Display the currently authenticated user.
appspacer whoamiappspacer setup
Auto-configure native Android and iOS files to load OTA bundles from AppSpacer. Run this once after installing react-native-appspacer.
# Configure both platforms
appspacer setup
# Android only
appspacer setup --android-only
# iOS only
appspacer setup --ios-only
# Preview changes without writing files
appspacer setup --dry-run
# Point to a project in a different directory
appspacer setup --project-dir ../my-app| Flag | Description |
|------|-------------|
| --android-only | Only configure Android |
| --ios-only | Only configure iOS |
| --project-dir <dir> | Root of the React Native project (default: .) |
| --dry-run | Preview injected code without modifying files |
The command auto-detects your React Native architecture (New Architecture / Traditional) and injects the correct bundle resolver into MainApplication.kt / MainApplication.java (Android) and AppDelegate.mm / AppDelegate.swift (iOS). Original files are backed up as .appspacer.bak.
appspacer setup:undo
Remove all AppSpacer injections from native files.
appspacer setup:undo
appspacer setup:undo --project-dir ../my-appappspacer release-react-native
Bundle your React Native JavaScript and push it as an OTA update.
# Android
appspacer release-react-native android -a my-app -d Staging -t 1.0.0
# iOS — mandatory update with a description
appspacer release-react-native ios -a my-app -d Production -t 2.1.0 --mandatory --description "Critical bug fix"
# Include assets (images, fonts) in the bundle
appspacer release-react-native android -a my-app -d Staging -t 1.0.0 --include-assets| Flag | Description |
|------|-------------|
| <platform> | android or ios (required positional argument) |
| -a, --app <id> | App ID or Name (required) |
| -d, --deployment <name> | Deployment name, e.g. Staging, Production (required) |
| -t, --target-version <version> | App store version this update targets, e.g. 1.0.0 (required) |
| --description <text> | Human-readable release notes |
| --mandatory | Mark update as mandatory (applied immediately on next launch) |
| --include-assets | Bundle assets along with JS (increases bundle size) |
appspacer release-capacitor
Package your Capacitor web build (www/dist/build) and push it as an OTA update. Run from your project root after building your web app — the output directory is auto-detected, or pass it with -f.
# Android — auto-detect the web build directory
appspacer release-capacitor -p android -a my-app -d Staging -t 1.0.0
# iOS — mandatory, explicit build directory
appspacer release-capacitor -p ios -a my-app -d Production -t 2.0.0 --mandatory -f ./dist| Flag | Description |
|------|-------------|
| -a, --app <id> | App ID or Name (required) |
| -d, --deployment <name> | Deployment name (required) |
| -p, --platform <os> | android or ios (required) |
| -t, --target-version <version> | Target app version, e.g. 1.0.0 or ^1.0.0 (required) |
| -f, --file <path> | Web build directory or prebuilt .zip (auto-detects www/dist/build if omitted) |
| --description <text> | Release notes |
| --mandatory | Mark update as mandatory |
| --rollout <percentage> | Staged rollout percentage 0–100 (default 100) |
Zip the contents of the web build (with index.html at the top level). The SDK verifies the SHA-256, unzips the bundle, and serves it from the new path.
appspacer release-expo
Publish an asset OTA update for Expo apps. The Expo SDK delivers assets (not JS code) — it downloads the uploaded file and exposes it in-app via AppSpacer.readAssetJson("bundle.zip") / readAssetString / readAssetBytes. The version is auto-detected from app.json if not provided.
# Android — publish a remote config file
appspacer release-expo -p android -a my-app -d Staging -f ./remote-config.json
# iOS — mandatory content update with explicit version
appspacer release-expo -p ios -a my-app -d Production -f ./content.json -t 1.2.0 --mandatory| Flag | Description |
|------|-------------|
| -a, --app <id> | App ID or Name (required) |
| -d, --deployment <name> | Deployment name (required) |
| -p, --platform <os> | android or ios (required) |
| -f, --file <path> | Asset file to publish (required) |
| -t, --target-version <version> | Target app version (auto-detected from app.json if omitted) |
| --description <text> | Release notes |
| --mandatory | Mark update as mandatory |
| --rollout <percentage> | Staged rollout percentage 0–100 (default 100) |
appspacer release
Upload a pre-built zip bundle manually (platform-agnostic).
appspacer release -a my-app -d Staging -p android -t "1.x.x" -f ./bundle.zip| Flag | Description |
|------|-------------|
| -a, --app <id> | App ID or Name (required) |
| -d, --deployment <name> | Deployment name (required) |
| -p, --platform <os> | android or ios (required) |
| -t, --target-version <version> | Target app version (required) |
| -f, --file <path> | Path to the .zip bundle (required) |
| --description <text> | Release notes |
| --mandatory | Mark update as mandatory |
appspacer deployments
List all releases in a deployment.
appspacer deployments -a my-appappspacer rollback
Disable the latest release and reactivate the previous one.
appspacer rollback -a my-app -d Staging -p android
appspacer rollback -a my-app -d Production -p ios| Flag | Description |
|------|-------------|
| -a, --app <id> | App ID or Name (required) |
| -d, --deployment <name> | Deployment name (required) |
| -p, --platform <os> | android or ios (required) |
appspacer vault
Manage and sync environment variables (secrets) via AppSpacer Vault.
# Initialize vault in the current directory (interactive)
appspacer vault init
# Push local .env to the remote vault
appspacer vault push
# Pull secrets from the vault into a local .env file
appspacer vault pull
# Revert the most recent vault change
appspacer vault rollback
# View audit history
appspacer vault auditvault env — Environment management
# List environments in the current project
appspacer vault env list
# Switch the active environment (and pull its secrets)
appspacer vault env use Productionvault secrets — Individual secret management
# List all remote secrets (values masked)
appspacer vault secrets ls
# Set a single secret
appspacer vault secrets set API_KEY=abc123Configuration
AppSpacer CLI stores its configuration (token, API URL) in ~/.appspacer/config.json. No manual editing is required.
Links
- Dashboard: appspacer.com
- Documentation: docs.appspacer.com
- Issues / Support: appspacer.com/support
License
MIT
