expo-push-cli
v1.0.1
Published
A command-line tool for uploading Expo bundles to S3/R2 storage and managing bundle deployments.
Readme
Expo Push CLI
A command-line tool for uploading Expo bundles to S3/R2 storage and managing bundle deployments.
Installation
npm install -g expo-push-cliOr use with npx:
npx expo-push-cli [command] [options]Commands
updates
Upload Expo bundles to S3/R2 storage.
Usage:
expo-push-cli updates [options]Required Options
--environment, --env
- Type:
string - Required: Yes
- Choices:
production,development - Description: Environment configuration for the bundle export
Examples:
# Production environment
expo-push-cli updates --environment production
# Development environment (using alias)
expo-push-cli updates --env development--platform
- Type:
string - Required: Yes
- Choices:
ios,android,all - Default:
all - Description: Target platform(s) for the bundle generation
Examples:
# All platforms (default)
expo-push-cli updates --platform all
# iOS only
expo-push-cli updates --platform ios
# Android only
expo-push-cli updates --platform android--runtimeVersion
- Type:
string - Required: Yes
- Default:
"1" - Description: Runtime version identifier for the update bundle
Examples:
# Default runtime version
expo-push-cli updates --runtimeVersion 1
# Custom semantic version
expo-push-cli updates --runtimeVersion 1.2.3
# Development version
expo-push-cli updates --runtimeVersion dev-2024-01Optional Options
--apiKey
- Type:
string - Required: No
- Description: API key for authentication when accessing expo push server
Example:
expo-push-cli updates --apiKey your-secret-api-key-hereComplete Examples
# Minimum required options
expo-push-cli updates --environment production --platform all --runtimeVersion 1
# Full production deployment with API key
expo-push-cli updates \
--environment production \
--platform all \
--runtimeVersion 1.0.0 \
--apiKey your-production-api-key
# iOS production release
expo-push-cli updates --env production --platform ios --runtimeVersion 1.2.0
# Android development build
expo-push-cli updates --env development --platform android --runtimeVersion dev-1.0
# Quick development update
expo-push-cli updates --env development --runtimeVersion dev-$(date +%Y%m%d)Process Flow
When you run the updates command, it performs these steps:
- Environment Validation - Ensures all required environment variables are set
- Bundle Export - Runs
expo exportwith the specified environment and platform - Directory Creation - Creates a timestamped target directory
- File Copy - Copies the distribution files to the target directory
- Config Generation - Generates the appropriate Expo configuration
- Bundle Processing - Processes bundles with metadata for upload
- S3/R2 Upload - Uploads all bundle files to your configured storage
Success Output
🎉 All steps completed successfully!
📊 Summary:
Environment: production
Platform: all
Runtime Version: 1.0.0
Target Directory: /path/to/target/dir
Timestamp: 2024-07-01T12:00:00.000Z
Bundles Found: 2
✅ Successfully uploaded 2 bundlesError Handling
If the command fails, you'll see detailed error information:
❌ Upload process failed: 400 Bad RequestCommon issues:
- Missing environment variables
- Invalid API key
- Network connectivity problems
- Insufficient S3/R2 permissions
Other Commands
clear-s3
Clear all files from S3/R2 storage (useful for development environment cleanup).
expo-push-cli clear-s3env
Manage environment variables.
expo-push-cli envGlobal Options
--verbose, -v- Run with verbose logging--help- Show help information
Configuration
Make sure to set up your environment variables for S3/R2 access:
# Example environment variables (add to your .env file)
R2_ENDPOINT=https://your-account-id.r2.cloudflarestorage.com
R2_ACCESS_KEY_ID=your-access-key
R2_SECRET_ACCESS_KEY=your-secret-key
R2_BUCKET_NAME=your-bucket-namePrerequisites
- Node.js 16+ or Bun runtime
- Expo CLI configured in your project
- S3/R2 credentials configured
- Valid Expo project structure
- Valid
app.jsonorapp.config.js - Network access to your storage endpoint
Requirements
- Node.js 16+ or Bun runtime
- Expo CLI configured in your project
- S3/R2 credentials configured
- Valid Expo project structure
