fastlane_cli 0.1.8
fastlane_cli: ^0.1.8 copied to clipboard
CLI plugin that bootstraps Fastlane, Firebase App Distribution, and GitHub Actions for Flutter projects.
fastlane_cli #
fastlane_cli is a Dart CLI package that bootstraps Fastlane + Firebase + GitHub Actions for Flutter projects.
It can:
- generate Fastlane files (
Fastfile,Appfile,.env.default) and helper scripts - generate GitHub Actions workflow for Android/iOS
- fetch project/git/GitHub metadata JSON
- sync Firebase app/project data into your project files
- run Firebase login and FlutterFire configuration automatically
- auto-setup Firebase App Distribution groups (create if missing)
Install #
dart pub global activate fastlane_cli
If needed:
export PATH="$PATH:$HOME/.pub-cache/bin"
Use As Executable #
fastlane_cli --help
flc --help
dart run fastlane_cli:fastlane_cli --help
Quick Start #
Use this single command from your Flutter project root:
flc init --project-root . --overwrite
init runs:
setupfirebase-syncfetch-data
Command Reference #
init #
One command setup for everything.
flc init --project-root . --overwrite
Common flags:
--project-root <path>: override target project directory--overwrite: replace generated files if changed--firebase-project <project-id>: use explicit Firebase project id--firebase-output-path <path>: firebase JSON output path--output-path <path>: build metadata JSON output path--appdist-groups <aliases>: comma-separated tester groups (example:qa,beta)--appdist-skip-group-setup: skip App Distribution group create/check step--no-include-github: skip GitHub API metadata--firebase-optional: do not fail hard if Firebase is not available
setup #
Generate Fastlane and workflow files only.
flc setup --project-root . --overwrite
Common flags:
--no-ci--no-env--workflow-filename mobile_delivery.yml--ci-branch main--ios-bundle-id <bundle-id>--android-package-name <package-name>--apple-id <email>--team-id <team-id>--itc-team-id <itc-team-id>
firebase-sync #
Fetch Firebase metadata, update env, and configure Firebase integration.
flc firebase-sync --project-root . --overwrite
Common flags:
--firebase-project <project-id>--output-path fastlane/firebase_data.json--env-path fastlane/.env.default--no-update-env--overwrite--optional--appdist-groups <aliases>--skip-group-setup
fetch-data #
Write project/git/GitHub metadata to JSON.
flc fetch-data --project-root . --output-path fastlane/build_data.json --include-github
Common flags:
--project-root <path>--output-path <path>--include-github/--no-include-github--github-repository owner/repo--github-token <token>
build_data.json app section reads directly from pubspec.yaml:
app.version(raw value, e.g.1.2.3+45)app.version_nameapp.version_codeapp.version_source(pubspec.yaml)
Firebase Interactive Flow #
When running init or firebase-sync:
- Checks Firebase login (
firebase login:list), then runsfirebase loginif needed. - Resolves project id from:
--firebase-project- environment (
FIREBASE_PROJECT_ID/GCLOUD_PROJECT) - active Firebase target (
firebase use --json)
- If no project is linked, it lists your Firebase projects and prompts:
- select existing project
- or choose
0) Create new Firebase project
- If selected project id is invalid/not found, it can create a new one.
- Links project locally (
.firebaserc+firebase use <projectId>). - Checks
pubspec.yamlforfirebase_core:- if exists, continues
- if missing, adds it automatically (
flutter pub add firebase_core), with fallback file update
- Runs
flutterfire configure --project <projectId> --yes. - Resolves App Distribution groups from
--appdist-groups, env, or defaults (qa), then creates missing groups automatically. - Writes:
fastlane/firebase_data.json- updates
fastlane/.env.default
Direct Build + Upload To Firebase App Distribution #
After flc init, run from your app project:
fastlane android release_android_to_firebase
fastlane ios release_ios_to_firebase
These lanes:
- refresh data (
fetch_data) - build release artifact
- upload direct to Firebase App Distribution
It also generates utility lanes/scripts:
fastlane bootstrap_cli_env: pullsGITHUB_REPOSITORY,GITHUB_TOKEN, andFIREBASE_TOKENfrom local CLI sessions intofastlane/.envfastlane apple_account_info: shows Apple provider/team data usingaltool
Generated/Updated Files #
fastlane/Fastfilefastlane/Appfilefastlane/.env.defaultfastlane/scripts/sync_cli_env.shfastlane/scripts/apple_account_info.sh.github/workflows/mobile_delivery.ymlfastlane/firebase_data.jsonfastlane/build_data.json.firebaserc(when Firebase project is linked)pubspec.yaml(addsfirebase_coreif missing)
Required Env Vars For CI Lanes #
FIREBASE_TOKENFIREBASE_PROJECT_IDFIREBASE_APP_ID_ANDROIDFIREBASE_APP_ID_IOSFIREBASE_TESTER_GROUPSGITHUB_REPOSITORYGITHUB_TOKENFASTLANE_APP_IDENTIFIERFASTLANE_ANDROID_PACKAGE_NAME