firestore-cli
A TypeScript CLI for Firestore with stream-based migrations, complex querying, and Unix-style piping.
Overview
firestore-cli is a TypeScript command-line tool for working with Google Firestore from the terminal. It covers the operations you would normally write a one-off script for: querying, document CRUD, bulk updates, streaming large collections, and migrations.
The CLI is designed to compose. Query results can be piped into other commands, output can be JSON or JSONL for tools like jq, and bulk operations support controlled concurrency and rate limiting.
What I built
- Built stream-based migrations and complex AND/OR filtering so Firestore operations can run directly from the terminal.
- Supports Unix-style piping, JSON/JSONL output, pagination, bulk operations with rate limiting, and multiple databases.
- Published on npm as firestore-cli with 3,475 downloads all time, including 1,765 in the past year and 138 in the last 30 days.
Migration at scale
Used as the Firestore migration layer for a senior-care EHR platform, loading facility and resident data before a BigQuery backfill.
- resident documents
- 910,335
- facility documents
- 273
- migration time
- 31 min
Authenticated with KMS-backed service account credentials, then backfilled the existing Firestore data into BigQuery for reporting.
