Firestore Manager
A Visual Studio Code extension to easily explore and manage your Firebase Firestore database documents right inside your editor.
Features
- Activity Bar Integration: Navigate your Firestore collections and documents through a dedicated view in the VS Code Activity bar.
- Direct Editing: Open Firestore documents as JSON files. Edit them directly in VS Code and save to push updates back to Firestore.
- Add & Delete: Create/Delete documents and collections directly from the tree view.
- 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.
- Save Confirmation: Opt-in confirmation dialog before saving changes to prevent accidental updates.
- Overwrite Protection: Warns you before overwriting an existing document when adding or duplicating.
Configuration
To use the extension, you need to provide a Firebase service account key from your Firebase project.
There are two ways to do this:
- 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"
- VS Code Settings: Configure it via the VS Code settings (UI or
settings.json) set firestoreManager.serviceAccountKeyPath to the path of your JSON key.
Settings
firestoreManager.serviceAccountKeyPath: Absolute path to the service account JSON key (Only if not using GOOGLE_APPLICATION_CREDENTIALS).
firestoreManager.projectId: The project ID for your Firebase app (usually auto-detected from the key).
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.
Usage
- Initialize: Run the
Firestore Manager: Initialize command from the Command Palette (Ctrl+Shift+P).
- Setup: Provide the path to your Service Account JSON if not already set via environment variables.
- Explore: Open the Firestore panel in the Activity Bar to see your collections.
- 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.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.