A simple, developer-friendly CLI for interacting with Firebase Firestore databases.
- Automatic Project Detection - Reads
.firebasercandfirebase.jsonfrom your working directory - Emulator Support - Easily switch between local emulator and remote Firestore
- Pipeline-Friendly - Suppresses informational output when piping to files or other commands
- Shell Autocompletion - Built-in bash completion support
npm install -g github:rk234/flame-cli# Clone the repository
git clone https://github.com/your-username/flame-cli.git
cd flame-cli
# Install dependencies and build
npm install
npm run build
# Link globally
npm linkRequirements: Node.js >= 22
# Navigate to your Firebase project directory
cd my-firebase-project
# Initialize flame (creates .flame.json)
flame init
# Check configuration status
flame status
# Upload a document
flame up users/user1 --data '{"name": "John", "email": "john@example.com"}'
# Download a document
flame down users/user1
# Download all documents from a collection
flame down users
# Copy a document
flame copy users/user1 users/user2
# Move a document (transactional, source is deleted only if destination is successful)
flame move users/user1 archive/userX
# Delete a document
flame delete users/user1
# Delete all documents in a collection
flame rm users --force
# Switch to local emulator for development
flame use emulator
# Switch back to remote Firestore
flame use remoteSee Commands Documentation for detailed usage of all commands.
| Command | Description |
|---|---|
flame init |
Initialize flame for current Firebase project |
flame status |
Display flame configuration status |
flame use <target> |
Switch between remote Firestore and local emulator |
flame down <path> |
Download/display documents from Firestore |
flame up <path> |
Upload documents to Firestore |
flame delete <path> |
Delete documents or collections (alias: rm) |
flame copy <src> <dest> |
Copy a document to a new path (alias: cp) |
flame move <src> <dest> |
Move a document to a new path (alias: mv) |
flame collections |
List all collections |
Flame uses three configuration sources:
| File | Purpose |
|---|---|
.firebaserc |
Firebase project aliases (read-only) |
firebase.json |
Firebase configuration including emulator ports (read-only) |
.flame.json |
Flame-specific settings (created by flame init) |
{
"project": "my-firebase-project",
"useEmulator": true,
"emulatorHost": "127.0.0.1",
"emulatorPort": 8080
}Flame uses Application Default Credentials (ADC) for authentication. Set up ADC using:
gcloud auth application-default loginNo authentication required. Ensure your Firebase emulator is running:
firebase emulators:start --only firestoreThen switch flame to emulator mode:
flame use emulatorFlame automatically detects when output is being piped and suppresses informational messages, outputting only raw JSON data:
# Pipe to jq for processing
flame down users | jq '.[].email'
# Save to file
flame down users > backup.json
# Pipe to other commands
flame down users | grep "active"
# Upload from file
cat backup.json | flame up users --idField="id"
# Chain download and upload (e.g., copy between collections)
flame down users | flame up users-backup --idField="_id"
# Fetch from API and upload
curl -s https://api.example.com/data | flame up imports --idField="id"After installation, you can optionally enable bash completion:
flame installThis adds autocompletion for commands, flags, and arguments. To uninstall:
flame uninstall# Clone the repository
git clone https://github.com/your-username/flame-cli.git
cd flame-cli
# Install dependencies
npm install
# Build
npm run build
# Run locally
node dist/cli.js --help
# Or link globally for development
npm link
flame --help# Run tests once
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverage- Stricli - Type-safe CLI framework
- Firebase Admin SDK - Firestore client
- Consola - Elegant console logging
- Chalk - Terminal styling