Skip to content

maruware/fscli

Repository files navigation

fscli

A cli tool for firestore

Demo

fscli-demo

Installation

brew install maruware/tap/fscli

or download binary from Releases

or

go install github.com/maruware/fscli/cmd/fscli@latest

Prepare

$ gcloud auth application-default login

Usage

$ fscli --project-id my-project
Flag Description
--project-id Firebase project ID (required)
--out-mode Output format: table (default) or json

Quick Examples

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"

Documentation

  • OperationsQUERY, GET, COUNT, collection paths
  • WHERE Filters — Operators (=, !=, >, <, IN, ARRAY_CONTAINS, ...), value types, TIMESTAMP(), __id__
  • ClausesSELECT, ORDER BY, LIMIT
  • Meta Commands\d, \pager
  • Output — Table / JSON output modes, non-interactive mode

JSON 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" } }
]

About

A cli tool for firestore

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages