Skip to content

thiagodsantos/firestore-manager

Repository files navigation

Firestore Manager

Extension to easily explore and manage your Firebase Firestore database documents right inside your editor.

Using

Features

  • Activity Bar Integration: Navigate your Firestore collections and documents through a dedicated view in the Activity bar.
  • Direct Editing: Open Firestore documents as JSON files. Edit them directly in the editor and save to push updates back to Firestore.
  • Add & Delete: Create/Delete documents and collections directly from the tree view. Includes strict double-confirmations for deletions to prevent accidental data loss.
  • Duplicate Document: Quickly clone an existing document into a new one (with custom or auto-generated ID).
  • Subcollections Support: Easily navigate and manage subcollections within documents. Add new subcollections on the fly.
  • Pagination: Browse large collections with ease. Customizable page size and "Load More" functionality.
  • Advanced Querying: Filter documents within a collection using field-based queries (e.g., name == "John").
  • Refresh Support: Quickly refresh the Firestore tree to see the latest changes.
  • Secure Configuration: Configurable via service account key path or environment variables.
  • Custom Databases: Support for named Firestore database instances.
  • Safety First: Overwrite protection warnings, explicit save confirmations, and options to completely block document updates or deletions for view-only modes.

Configuration

To use the extension, you need to provide a Firebase service account key from your Firebase project.

There are three ways to do this:

  1. Google Cloud Application Default Credentials (ADC): The recommended way if using the gcloud CLI. Ensure you are logged in via gcloud auth application-default login and enable the firestoreManager.useGcloudAuth setting.
  2. Environment Variable: Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of your JSON key. The extension will automatically use this.
    export GOOGLE_APPLICATION_CREDENTIALS="/path/to/key.json"
  3. VS Code Settings/Antigravity Settings: Configure it via settings (UI or settings.json) set firestoreManager.serviceAccountKeyPath to the path of your JSON key.

Settings

  • firestoreManager.useGcloudAuth: Set to true to use gcloud auth application-default login instead of a service account key.
  • firestoreManager.serviceAccountKeyPath: Absolute path to the service account JSON key (Only if not using useGcloudAuth or GOOGLE_APPLICATION_CREDENTIALS).
  • firestoreManager.projectId: The project ID for your Firebase app (usually auto-detected from the key or ADC).
  • firestoreManager.databaseId: The ID of the Firestore database. Defaults to (default).
  • firestoreManager.pageSize: Number of documents to show per page. Defaults to 10.
  • firestoreManager.disableSaveConfirmation: Set to true to disable the confirmation dialog when saving documents. Defaults to false.
  • firestoreManager.disableSecondDeletePrompt: Set to true to skip the secondary confirmation step when deleting documents or collections. Defaults to false.
  • firestoreManager.blockDocumentUpdate: Set to true to completely block the ability to update existing documents. Defaults to false.
  • firestoreManager.blockDocumentDelete: Set to true to completely block the ability to delete documents or collections. Defaults to false.

Usage

  1. Initialize: Run the Firestore Manager: Initialize command from the Command Palette (Ctrl+Shift+P).
  2. Setup: Provide the path to your Service Account JSON if not already set via environment variables.
  3. Explore: Open the Firestore panel in the Activity Bar to see your collections.
  4. Manage Documents:
    • Click a document to open it as JSON.
    • Edit and Save (Ctrl+S) to update the document in Firestore.
    • Right-click a collection to Add Document, Delete Collection, or Query Documents.
    • Right-click a document to Delete Document, Duplicate Document, or Add Collection (subcollection).
    • Use the Refresh icon in the view title to reload the tree.
    • Use Load More... at the bottom of a collection list to fetch more documents.

Querying Syntax

When using the Query Documents command, use the following format: field operator value

Example:

  • isActive == true
  • age >= 21
  • name == "John"
  • score > 100

Supported operators: ==, !=, <, <=, >, >=, array-contains, in, not-in, array-contains-any.

Compatibility

  • VS Code 1.107.0 or higher
  • Antigravity Version: 1.20.6 or higher

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Releases

No releases published

Packages

 
 
 

Contributors