CLI for Finan CodePush - Self-hosted OTA update service for React Native
CLI tool for managing OTA (Over-The-Air) updates for React Native apps via Finan CodePush server.
``bash`
npm install -g finan-code-push
`bash1. Login to server
finan-code-push login --accessKey YOUR_ACCESS_KEY
Authentication
$3
`bash
finan-code-push login --accessKey YOUR_ACCESS_KEY
`Get your access key from the CodePush dashboard at https://cp.sobanhang.com
$3
`bash
finan-code-push whoami
`$3
`bash
finan-code-push logout
`App Management
$3
`bash
finan-code-push app add Example
finan-code-push app add MyApp
`$3
`bash
finan-code-push app ls
`$3
`bash
finan-code-push app rm
`$3
`bash
finan-code-push app rename
`$3
`bash
finan-code-push app transfer
`Deployment Management
Each app has deployments (e.g., Staging, Production). By default,
Staging and Production are created.$3
`bash
finan-code-push deployment ls Example
finan-code-push deployment ls MyApp
`$3
`bash
finan-code-push deployment add Example
finan-code-push deployment add MyApp Beta
`$3
`bash
finan-code-push deployment history Example
finan-code-push deployment h MyApp Staging
`$3
`bash
finan-code-push deployment clear
`$3
`bash
finan-code-push deployment rm
`Releasing Updates
$3
Automatically bundles and releases your React Native app:
`bash
finan-code-push release-react [options]
`Platforms:
ios, android, windowsExamples:
`bash
Release iOS to Staging
finan-code-push release-react MyApp iosRelease Android to Production
finan-code-push release-react MyApp android -d ProductionRelease 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 -mRelease 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 --useHermesRelease 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 |$3
If you have a pre-built bundle:
`bash
finan-code-push release [options]
`Examples:
`bash
Release a folder
finan-code-push release MyApp ./build "1.0.0" -d StagingRelease 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
$3
Promote latest release from one deployment to another:
`bash
finan-code-push promote Example: Promote from Staging to Production
finan-code-push promote MyApp Staging Production
`$3
Rollback to the previous release:
`bash
finan-code-push rollback Example
finan-code-push rollback MyApp Production
`$3
Update metadata of an existing release:
`bash
finan-code-push patch [options]Example: Make latest release mandatory
finan-code-push patch MyApp Production -mExample: Disable a release
finan-code-push patch MyApp Staging -x
`Collaborators
$3
`bash
finan-code-push collaborator add
`$3
`bash
finan-code-push collaborator ls
`$3
`bash
finan-code-push collaborator rm
`Access Keys
$3
`bash
finan-code-push access-key ls
`$3
`bash
finan-code-push access-key add --name "CI Server"
`$3
`bash
finan-code-push access-key rm
`Debugging
View CodePush debug logs from a running app:
`bash
finan-code-push debug Example
finan-code-push debug ios
`Configuration
Access key is stored at
~/.code-push.configServer 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:
`bash
finan-code-push login https://your-server.com --accessKey YOUR_KEY
`Requirements
- Node.js >= 18.0.0
- React Native project (for
release-react command)
- Xcode (for iOS releases)
- Android SDK (for Android releases)Common Workflows
$3
`bash
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"
`$3
`bash
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%
``- CodePush Dashboard: https://cp.sobanhang.com
- API Server: https://cp-api.sobanhang.com
- Source Repository: https://code.finan.one/finan-fe/code-push-server
MIT