A cli tool for firestore
brew install maruware/tap/fsclior download binary from Releases
or
go install github.com/maruware/fscli/cmd/fscli@latest
$ gcloud auth application-default login$ fscli --project-id my-project| Flag | Description |
|---|---|
--project-id |
Firebase project ID (required) |
--out-mode |
Output format: table (default) or json |
QUERY users
QUERY users WHERE age = 20
QUERY users SELECT name WHERE age >= 20 ORDER BY name ASC LIMIT 10
GET users/ewpSGf5URC1L1vPENbxh
COUNT users WHERE name = "takashi"- Operations —
QUERY,GET,COUNT, collection paths - WHERE Filters — Operators (
=,!=,>,<,IN,ARRAY_CONTAINS, ...), value types,TIMESTAMP(),__id__ - Clauses —
SELECT,ORDER BY,LIMIT - Meta Commands —
\d,\pager - Output — Table / JSON output modes, non-interactive mode
The --out-mode json flag produces a single, valid JSON object (for GET) or an array of objects (for QUERY), making it easy to parse with tools like jq.
GET command output:
{
"id": "documentId",
"data": { "field": "value" }
}QUERY command output:
[
{ "id": "doc1", "data": { "field": "value" } },
{ "id": "doc2", "data": { "field": "value" } }
]