π₯ Simplify Firebase setup in native development environments
NativeFire is a CLI tool that automatically detects your native development environment and sets up Firebase configuration for Android, iOS, macOS, Windows, and Linux platforms. Similar to how flutterfire works for Flutter, but for native applications.
- π― Auto-detection: Automatically detects your platform (Android, iOS, macOS, Windows, Linux)
- π§ Firebase Integration: Uses Firebase CLI to register apps and download configurations
- π Smart Placement: Places configuration files in the correct directories for each platform
- π Code Injection: Automatically adds Firebase initialization code to your app's entry point
- π Verbose Logging: Clear error messages and detailed output when enabled
- π Multiple Installation Methods: Install via Homebrew or npm/npx
# Install directly (automatically adds tap)
brew install clix-so/homebrew-nativefire/nativefire
# Or add tap first, then install
brew tap clix-so/homebrew-nativefire
brew install nativefire# Install globally
npm install -g nativefire
# Or use with npx (no installation required)
npx nativefire@latest configure --help
# Use latest version with npx
npx nativefire@latest configure --auto-detect# Run directly with Docker
docker run --rm -v $(pwd):/workspace ghcr.io/clix-so/nativefire:latest --help
# Use as alias
alias nativefire='docker run --rm -v $(pwd):/workspace ghcr.io/clix-so/nativefire:latest'
nativefire configure --auto-detectDownload the latest binary from the releases page.
- Firebase CLI must be installed and authenticated
npm install -g firebase-tools firebase login
- A Firebase project created in the Firebase Console
# Easiest: Auto-select project and auto-detect platform
nativefire configure --auto-detect
# Select project interactively, auto-detect platform
nativefire configure --auto-detect
# Use specific project, auto-detect platform
nativefire configure --project your-firebase-project-id --auto-detect
# Specify both project and platform explicitly
nativefire configure --project your-firebase-project-id --platform android
# Use verbose output for detailed logging
nativefire configure --auto-detect --verbose# List all available Firebase projects
nativefire projects list
# Interactively select a Firebase project
nativefire projects select
# Select project and set as default for Firebase CLI
nativefire projects select --use--project, -p: Firebase project ID (will prompt if not provided)--platform: Target platform (android, ios, macos, windows, linux)--auto-detect: Automatically detect the platform--app-id: Firebase app ID (optional, will create new app if not provided)--bundle-id: iOS Bundle ID (will auto-detect or generate if not provided)--package-name: Android Package Name (will auto-detect or generate if not provided)--verbose, -v: Enable verbose output--config: Config file path (default is $HOME/.nativefire.yaml)
nativefire projects list: List all available Firebase projectsnativefire projects select: Interactively select a projectnativefire projects select --use: Select project and set as Firebase CLI default
cd /path/to/android/project
nativefire configure --auto-detect # Will prompt for project selectioncd /path/to/ios/project
nativefire configure --project my-firebase-project --auto-detectcd /path/to/your/project
nativefire configure --auto-detect --verbose # Interactive project selection + platform detection# See all your Firebase projects
nativefire projects list
# Pick a project interactively
nativefire projects select
# Use with existing project ID
nativefire configure --project my-existing-project --auto-detectNativeFire automatically detects platforms based on project structure:
- Looks for
build.gradle,settings.gradle - Searches for
app/build.gradle,android/build.gradle
- Looks for
*.xcodeproj,*.xcworkspace - Searches for
Podfile,ios/directory
- Looks for
macos/directory - Searches for Xcode projects with Podfile
- Looks for
windows/directory - Searches for
*.vcxproj,*.sln,CMakeLists.txt
- Looks for
linux/directory - Searches for
CMakeLists.txt,Makefile
- π± Registers Android app with Firebase
- π₯ Downloads
google-services.json - π Places config file in
app/orandroid/app/directory - π§ Adds Google Services plugin to
build.gradle - π Adds Firebase initialization to MainActivity
- π± Registers iOS app with Firebase
- π₯ Downloads
GoogleService-Info.plist - π Places config file in appropriate iOS directory
- π§ Adds Firebase pods to
Podfile - π Adds Firebase initialization to AppDelegate
- π± Registers app with Firebase
- π₯ Downloads appropriate configuration file
- π Places config file in platform directory
β οΈ Provides manual setup instructions
You can create a .nativefire.yaml file in your home directory for default settings:
project: your-default-firebase-project
verbose: trueNativeFire automatically detects and handles platform-specific app identifiers:
- Auto-detect package name from
applicationIdinbuild.gradle - Auto-detect from
packageattribute inAndroidManifest.xml - Generate a default package name if none found (e.g.,
com.firebase.your-project) - Accept explicit
--package-nameflag
- Auto-detect Bundle ID from
CFBundleIdentifierinInfo.plist - Auto-detect from
PRODUCT_BUNDLE_IDENTIFIERin Xcode project - Generate a default Bundle ID if none found (e.g.,
com.firebase.your-project) - Accept explicit
--bundle-idflag
# Android with specific package name
nativefire configure --platform android --package-name com.mycompany.myapp
# iOS with specific bundle ID
nativefire configure --platform ios --bundle-id com.mycompany.myappnpm install -g firebase-toolsfirebase loginUse the --platform flag to specify explicitly:
nativefire configure --project your-project --platform androidIf you get this error, nativefire couldn't auto-detect your app identifier. You can:
-
Specify explicitly:
# For iOS nativefire configure --bundle-id com.yourcompany.yourapp --auto-detect # For Android nativefire configure --package-name com.yourcompany.yourapp --auto-detect
-
Add to your project files:
- Android: Add
applicationId "com.yourcompany.yourapp"to yourbuild.gradle - iOS: Set
CFBundleIdentifierin yourInfo.plist
- Android: Add
nativefire configure --project your-project --auto-detect --verbose- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Clone the repository
git clone https://github.com/clix-so/nativefire.git
cd nativefire
# Build the binary
make build
# Install locally
make install
# Build for all platforms
make build-allmake testNativeFire uses comprehensive linting and formatting to maintain code quality:
# Format code
make format
# Run all quality checks (formatting, vet, build, tests)
make check
# Run linting (requires golangci-lint)
make lint
# Run linting with auto-fix
make lint-fix# macOS
brew install golangci-lint
# Linux/Windows
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.0The GitHub Actions CI automatically runs linting checks. You can run the same checks locally with make check.
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by FlutterFire CLI
- Built with Cobra for CLI framework
- Uses Viper for configuration management
- π Report a bug
- π‘ Request a feature
- π Documentation
Made with β€οΈ by the NativeFire team