Flux is a lightweight, open-source local CI/CD CLI tool for mobile developers. It focuses on a smooth developer experience for Flutter projects (Phase 1), providing build, deploy, and helper commands to streamline local Android development and Google Play deployment without mandatory cloud CI or a Mac.
- Why Flux
- Current Status
- Features
- Requirements
- Installation
- Quick Start
- Commands
- flux.yml β configuration reference
- Play Console setup (required for deploy)
- Security & Best Practices
- Troubleshooting & FAQ
- Development & Contributing
- Roadmap
- License
- Local-first: run builds on your machine for maximal speed and privacy.
- Developer UX: simple CLI commands, sensible defaults, and helpful diagnostics.
- Open & self-hostable: configuration and secrets stay under your control.
- Flutter-first: Phase 1 targets Flutter where the toolchain is unified and predictable.
Phase 1 (Flutter-focused) β Implemented:
flux init(createsflux.yml, updatespubspec.yamlfor Flutter)flux doctor,flux clean,flux infoflux build(APK / AAB viaflutter build)flux deploy(uploads.aab/.apkto Google Play via service account)
Partial / Planned for later phases:
- React Native build/deploy support (Gradle-based)
- Expo/EAS integration
- iOS build & App Store Connect support
- GUI dashboard and hosted runners
- Initialize project config with
flux init - Validate environment with
flux doctor - Clean build artifacts with
flux clean - Build Android artifacts (
apk/aab) withflux build - Deploy to Google Play (internal/alpha/beta/production) with
flux deploy - Logs deployments in
.flux/deployments.jsonfor auditing
- Node.js (v14+ recommended)
- npm (or yarn)
- Flutter (for Flutter projects) and Android SDK (for Android builds)
- Java & Gradle (installed via Android Studio or standalone)
- A Google Play service account JSON for publishing (for
flux deploy)
For development use (recommended):
git clone <your-repo-url>
cd flux-cli
npm install
npm link # makes 'flux' available globally for dev/testingFor distribution (when published to npm):
npm install -g flux-cli- From your Flutter project root run:
flux init- Edit
flux.ymland add Play Store service account path + package name:
playstore:
service_account_json: ./playstore-service.json
package_name: com.example.myapp- Build an app bundle (AAB):
flux build --release-type aab --output-dir ./dist- Deploy to internal track:
flux deploy --track internal --notes "Internal test build"Scaffolds flux.yml and, for Flutter, registers the YAML under flutter.assets in pubspec.yaml.
Options:
-f, --forceβ overwrite existingflux.yml(backups created automatically)
Example behavior:
- Detects project type (Flutter / React Native / Expo)
- Writes
flux.ymlwith sensible defaults - For Flutter, backs up and updates
pubspec.yamlto include the generatedflux.ymlunderassets
Checks installed tools required for the detected framework:
- Node, npm, Java, Flutter, Gradle, etc. Example:
flux doctorRemoves build artifacts in a framework-aware way:
- Flutter:
build/,android/app/build/,ios/build/ - React Native:
android/app/build/, caches, etc. Example:
flux cleanDisplays project and system information, including data from flux.yml:
flux infoBuilds your project and copies artifacts to an output directory. Options:
--release-type <apk|aab>(default:apk)--output-dir <path>(default:./dist)
Examples:
# Build AAB (recommended for Play Store)
flux build --release-type aab --output-dir ./dist
# Build APK (for local testing)
flux build --release-type apk --output-dir ./distTechnical notes:
- Flutter: runs
flutter build apkorflutter build appbundle - React Native: (planned) will run Gradle tasks like
./gradlew assembleReleaseor./gradlew bundleRelease
Uploads the most recent .aab or .apk to Google Play using the Android Publisher API.
Options:
--artifact <path>β specify exact artifact path (defaults todist/ build output detection)--track <internal|alpha|beta|production>β which track to release to (default:internal)--notes <string|json>β release notes (string or JSON map of language->text)--key <path>β override service account key path influx.yml--dry-runβ validate without committing the edit
Example:
flux deploy --track internal --notes "Bug fixes and improvements"What it does:
- Reads
flux.ymlforplaystore.service_account_jsonandplaystore.package_name - Locates artifact (supports Flutter & RN typical output paths)
- Authenticates with Google Play via service account
- Creates an edit, uploads artifact, updates track, commits edit
- Logs activity to
.flux/deployments.json
Below is a suggested schema and explanation. flux init creates a starter file β update it to match your project.
app_name: MyApp
platform: flutter # or react-native
android:
keystore_path: "./android/keystore.jks"
key_alias: "mykey"
key_password: ""
store_password: ""
package_name: "" # optional override
ios:
enabled: false
export_method: "app-store"
playstore:
enabled: true
service_account_json: "./playstore-service.json" # required for deploy
package_name: "com.example.myapp" # recommended
default_track: "internal"
default_notes: "Automated deploy via Flux CLI"
versioning:
strategy: auto # auto | manual
build:
output_dir: "./dist"
release_type: "aab" # aab | apkNotes:
service_account_jsonmust point to a valid Google Cloud service account JSON with Play Console access.- Donβt commit that JSON to source control β add it to
.gitignore.
- In Google Play Console β Settings β Developer account β API access, link a Google Cloud project.
- Create a Service Account in Google Cloud IAM & Admin and generate a JSON key.
- In Play Console API access page, Grant access to the service account with at least Release Manager permissions (or the minimal scopes required to upload and edit tracks).
- Save the JSON key locally and set
playstore.service_account_jsoninflux.ymlto its path.
Security tip: store keys outside your repo (e.g. ~/.config/flux/ or ./secure_keys/) and add to .gitignore.
- Never commit service account JSON or keystore files to your git repository.
- Add obviously sensitive paths to
.gitignore(e.g.playstore-service.json,keys/). - Use
flux deploy --dry-runfirst to validate authentication and edit creation without committing. - If you share machine access, prefer storing keys in a local protected directory and reference the path from
flux.yml.
Q: Deploy fails with a 403 or permission error
A: Verify you granted the service account access in Play Console and assigned appropriate roles. Ensure the Play Android Publisher API is enabled for the linked Google Cloud project.
Q: Artifact not found
A: Ensure you ran flux build first. Check the output folder or pass --artifact ./dist/app-release.aab to flux deploy.
Q: Iβm using Expo / EAS
A: Expo projects are handled differently. For Phase 1, Flux targets Flutter. Expo/EAS support is on the roadmap.
Q: How do I log deployments?
A: Flux writes .flux/deployments.json with a basic audit trail. Use it to inspect past deploys.
We welcome contributions! Basic workflow:
- Fork the repo
- Create a feature branch
- Run
npm install && npm linkto test locally - Add tests and documentation for your changes
- Open a Pull Request
Coding standards & notes:
- Split command logic inside
commands/and utilities inutils/. - Keep CLI minimal and delegate heavy work to modules for testability.
- React Native AAB build & deploy support
- Expo/EAS integration
- iOS App Store Connect support (Transporter/Fastlane)
- CI runner agents (optional self-hosted)
- GUI dashboard for local deployments
MIT License Β© 2025 Flux CLI Project