firestore_index_automator 0.1.0 copy "firestore_index_automator: ^0.1.0" to clipboard
firestore_index_automator: ^0.1.0 copied to clipboard

A CLI tool that wraps flutter run and automatically detects, parses, and deploys missing Firestore composite indexes — no more manual index creation.

example/README.md

FIA Example Usage #

This directory provides an example of how to use the fia tool in a real-world Flutter and Firebase project.

1. Installation #

First, install the tool globally:

dart pub global activate firestore_index_automator

Ensure your system's PATH includes the global pub executable directory so you can run fia from anywhere.

2. Project Setup #

Navigate to your existing Flutter project that uses cloud_firestore. Make sure Firebase is initialized.

cd my_flutter_project
firebase init firestore

3. Running Your App #

Instead of running your app with the standard flutter run command, simply prefix it with fia. You can pass any arguments you normally would:

fia run -d chrome

What Happens Next? #

  1. Your app starts exactly as it normally would.
  2. You navigate through your app to a screen that triggers a complex Firestore query (e.g., filtering by category and sorting by price).
  3. Firestore throws a FAILED_PRECONDITION error because the composite index doesn't exist yet.

The Terminal Experience #

Normally, you would see the error and have to manually click the URL. With fia run, the tool intercepts the error and pins a live status bar (HUD) to the bottom of your terminal:

I/flutter: [cloud_firestore/failed-precondition] The query requires an index...
[FIA] 📦 1 indexes pending | deploying in 8s | D:now S:skip V:view U:undo

Once the countdown finishes, FIA automatically triggers the Firebase CLI in the background:

[FIA] 🚀 Deploying 1 indexes... (firebase CLI running)

4. Checking Status #

If you want to see if your indexes have finished building on Google's servers, you don't need to open the Firebase Console. Just open a new terminal tab and run:

fia status

You will see output like this:

[FIA] ⏳ 1 index(es) still building...
[FIA] ✅ All indexes are ready!

5. Advanced Configuration #

You can customize FIA's behavior by creating a .fia.yaml file in the root of your project:

# .fia.yaml
auto_deploy: true       # Automatically trigger firebase deploy
debounce_seconds: 15    # Wait 15 seconds for more errors before deploying
interactive: true       # Allow D, S, V, U keyboard shortcuts in the terminal
1
likes
0
points
33
downloads

Documentation

Documentation

Publisher

unverified uploader

Weekly Downloads

A CLI tool that wraps flutter run and automatically detects, parses, and deploys missing Firestore composite indexes — no more manual index creation.

Repository (GitHub)
View/report issues

Topics

#firebase #firestore #flutter #cli #developer-tools

License

unknown (license)

Dependencies

ansi_styles, args, http, path, yaml

More

Packages that depend on firestore_index_automator