finan-code-push
v1.0.3
Published
CLI for Finan CodePush - Self-hosted OTA update service for React Native
Downloads
418
Maintainers
Readme
Finan CodePush CLI
CLI tool for managing OTA (Over-The-Air) updates for React Native apps via Finan CodePush server.
Installation
npm install -g finan-code-pushQuick Start
# 1. Login to server
finan-code-push login --accessKey YOUR_ACCESS_KEY
# 2. Create an app
finan-code-push app add MyApp
# 3. Release an update
finan-code-push release-react MyApp ios -d StagingAuthentication
Login with Access Key
finan-code-push login --accessKey YOUR_ACCESS_KEYGet your access key from the CodePush dashboard at https://cp.sobanhang.com
Check Current Session
finan-code-push whoamiLogout
finan-code-push logoutApp Management
Add a New App
finan-code-push app add <appName>
# Example
finan-code-push app add MyAppList All Apps
finan-code-push app lsRemove an App
finan-code-push app rm <appName>Rename an App
finan-code-push app rename <currentName> <newName>Transfer App Ownership
finan-code-push app transfer <appName> <email>Deployment Management
Each app has deployments (e.g., Staging, Production). By default, Staging and Production are created.
List Deployments
finan-code-push deployment ls <appName>
# Example
finan-code-push deployment ls MyAppAdd a Deployment
finan-code-push deployment add <appName> <deploymentName>
# Example
finan-code-push deployment add MyApp BetaView Release History
finan-code-push deployment history <appName> <deploymentName>
# Example
finan-code-push deployment h MyApp StagingClear Deployment History
finan-code-push deployment clear <appName> <deploymentName>Remove a Deployment
finan-code-push deployment rm <appName> <deploymentName>Releasing Updates
Release React Native App (Recommended)
Automatically bundles and releases your React Native app:
finan-code-push release-react <appName> <platform> [options]Platforms: ios, android, windows
Examples:
# Release iOS to Staging
finan-code-push release-react MyApp ios
# Release Android to Production
finan-code-push release-react MyApp android -d Production
# Release with description
finan-code-push release-react MyApp ios --des "Bug fixes and performance improvements"
# Release as mandatory update
finan-code-push release-react MyApp ios -m
# Release with specific target version
finan-code-push release-react MyApp ios -t "1.2.0"
# Release with Hermes enabled
finan-code-push release-react MyApp android --useHermes
# Release to 25% of users (gradual rollout)
finan-code-push release-react MyApp ios -r 25%Options:
| Option | Description | Default |
|--------|-------------|---------|
| -d, --deploymentName | Target deployment | Staging |
| --des, --description | Release description | - |
| -m, --mandatory | Mandatory update | false |
| -x, --disabled | Disabled initially | false |
| -r, --rollout | Rollout percentage | 100% |
| -t, --targetBinaryVersion | Target app version | Auto-detect |
| -h, --useHermes | Enable Hermes | false |
| -e, --entryFile | Entry JS file | Auto-detect |
| -b, --bundleName | Bundle file name | Auto-detect |
| -s, --sourcemapOutput | Sourcemap output path | - |
| -o, --outputDir | Output directory | - |
| -p, --plistFile | Info.plist path (iOS) | Auto-detect |
| -g, --gradleFile | build.gradle path (Android) | Auto-detect |
Release Pre-built Bundle
If you have a pre-built bundle:
finan-code-push release <appName> <bundlePath> <targetBinaryVersion> [options]Examples:
# Release a folder
finan-code-push release MyApp ./build "1.0.0" -d Staging
# Release with wildcard version (targets all versions)
finan-code-push release MyApp ./bundle "*"
# Release with semver range
finan-code-push release MyApp ./bundle "~1.2.0"Promoting & Rolling Back
Promote Release
Promote latest release from one deployment to another:
finan-code-push promote <appName> <sourceDeployment> <destDeployment>
# Example: Promote from Staging to Production
finan-code-push promote MyApp Staging ProductionRollback Release
Rollback to the previous release:
finan-code-push rollback <appName> <deploymentName>
# Example
finan-code-push rollback MyApp ProductionPatch Release Metadata
Update metadata of an existing release:
finan-code-push patch <appName> <deploymentName> [options]
# Example: Make latest release mandatory
finan-code-push patch MyApp Production -m
# Example: Disable a release
finan-code-push patch MyApp Staging -xCollaborators
Add Collaborator
finan-code-push collaborator add <appName> <email>List Collaborators
finan-code-push collaborator ls <appName>Remove Collaborator
finan-code-push collaborator rm <appName> <email>Access Keys
List Access Keys
finan-code-push access-key lsAdd Access Key
finan-code-push access-key add --name "CI Server"Remove Access Key
finan-code-push access-key rm <accessKeyName>Debugging
View CodePush debug logs from a running app:
finan-code-push debug <platform>
# Example
finan-code-push debug iosConfiguration
Access key is stored at ~/.code-push.config
Server Configuration
CLI mặc định kết nối tới server Finan CodePush:
- Dashboard: https://cp.sobanhang.com (web UI để quản lý apps, lấy access key)
- API Server: https://cp-api.sobanhang.com (CLI kết nối tới đây)
Nếu muốn dùng server khác, truyền URL khi login:
finan-code-push login https://your-server.com --accessKey YOUR_KEYRequirements
- Node.js >= 18.0.0
- React Native project (for
release-reactcommand) - Xcode (for iOS releases)
- Android SDK (for Android releases)
Common Workflows
CI/CD Release
# In your CI pipeline
finan-code-push login --accessKey $CODEPUSH_ACCESS_KEY
finan-code-push release-react MyApp ios -d Production -m --des "v1.2.3"
finan-code-push release-react MyApp android -d Production -m --des "v1.2.3"Staged Rollout
# Release to 10% of users
finan-code-push release-react MyApp ios -d Production -r 10%
# After monitoring, increase to 50%
finan-code-push patch MyApp Production -r 50%
# Finally, release to all users
finan-code-push patch MyApp Production -r 100%Links
- CodePush Dashboard: https://cp.sobanhang.com
- API Server: https://cp-api.sobanhang.com
- Source Repository: https://code.finan.one/finan-fe/code-push-server
License
MIT
