https://github.com/jaspero/fb-extra
Additional CLI commands for interacting with firebase.
https://github.com/jaspero/fb-extra
cli firebase
Last synced: 5 months ago
JSON representation
Additional CLI commands for interacting with firebase.
- Host: GitHub
- URL: https://github.com/jaspero/fb-extra
- Owner: Jaspero
- License: mit
- Created: 2021-08-10T06:22:12.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-22T13:51:20.000Z (over 2 years ago)
- Last Synced: 2024-12-01T23:38:09.868Z (over 1 year ago)
- Topics: cli, firebase
- Language: JavaScript
- Homepage:
- Size: 155 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Firebase Extra
This is a CLI tool with useful commands for interacting with firebase. It contains things like managing users and managing firestore data.
## Installation
To install the library run:
```
npm i -g @jaspero/fb-extra
```
Initially you'll need to define a project, do that by running:
```
fbs use [your-project-id]
```
## Commands
Command
Description
Auth
fbs auth (create-user|cu) {email} {password} [custom claims]
Adds a new email/password user
fbs auth (update-claims|uc) {id|email} [custom claims]
Update users custom claims
fbs auth (change-password|cp) {id|email} {new-password}
Changes the users password
fbs auth (remove-user|ru) {id|email}
Removes a user by email or id
fbs auth (remove-users|rus) [excluded]
Removes all users except for users on the exclusion list
fbs auth (list-users|lu) [regex search] [page-size]
Lists users in descending order. Page size defaults to 20
Firestore
fbs firestore (add-document|ad) {collection} {json|path}
Creates a document in the desired collection
## Notes on passing Custom Claims JSON
- The argument should be a JSON object. Example: {"role":"admin"}
- On Windows PowerShell, single quotes can be used to avoid escaping double quotes, but PowerShell may pass them differently. This tool now accepts simple single-quoted JSON like '{'role':'admin'}'.
- If you still see "Provided invalid Custom Claims JSON!", try one of the following depending on your shell:
- PowerShell:
- fbs auth uc user@example.com '{"role":"admin"}'
- fbs auth uc user@example.com '{'role':'admin'}'
- CMD:
- fbs auth uc user@example.com {"role":"admin"}
- Bash:
- fbs auth uc user@example.com '{"role":"admin"}'