https://github.com/siarheidudko/firebase-admin-cli

Cli for firebase

https://github.com/siarheidudko/firebase-admin-cli

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.7%) to scientific vocabulary

Keywords

authentication cli data-manipulation data-migratation data-science firebase firebase-admin firebase-auth firebase-authentication firebase-database firebase-firestore firebase-firestore-database firebase-realtime-database firebase-storage firebase-tools firebase-ui firestore google-cloud-storage rtdb storage
Last synced: 5 months ago · JSON representation

Repository

Cli for firebase

Basic Info
Statistics
  • Stars: 6
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 45
Topics
authentication cli data-manipulation data-migratation data-science firebase firebase-admin firebase-auth firebase-authentication firebase-database firebase-firestore firebase-firestore-database firebase-realtime-database firebase-storage firebase-tools firebase-ui firestore google-cloud-storage rtdb storage
Created over 3 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Funding License

README.md

firebase-admin-cli

Empower Your Firebase Project with Ultimate Control: Unleash the Full Potential of Firebase's Auth, Realtime Database, Firestore, Storage, and More, All Through a Powerful Command Line Interface with Admin Privileges!

npm npm NpmLicense GitHub last commit GitHub release

Install

bash npm i firebase-admin-cli -g

Run

```bash

export GOOGLEAPPLICATIONCREDENTIALS=/FULLPATHTOYOURSERVICE_ACCOUNT.json firebase-cli ```

How to use

Just use JavaScript to manage the database.

  • You can use one-line commands

js console.log( await db .collection("users") .get() .then(({ docs }) => docs.map((e) => e.data())) );

js const users = await db.collection("users").get(); console.log(users.docs.map((e) => e.data()));

  • You can insert multi-line scripts

js // command 1 (use Ctrl + V to input multiline code) const users = await db.collection("users").get(); const arr = users.docs.map((e) => e.data()); console.log(arr);

  • You can assign the result of a command to variables and use them in another command

js // command 1 const users = await db.collection("users").get();

js // command 2 const arr = users.docs.map((e) => e.data());

js // command 3 console.log(arr);

  • You can output the result of the command to the console (you can study the structures and utility properties and methods of objects)

js console.log(await db.collection("users").get());

  • You can even execute your script from a file using require();

js require("../examples/my_migration_script_test.js").run();

mymigrationscript_test.js

```js const admin = require("firebase-admin");

module.exports.run = async () => { const users = await admin.firestore().collection("users").get(); const arr = users.docs.map((e) => e.data()); console.log(arr); }; ```

Example

```bash siarhei@MacBook-Pro firebase-admin-cli % export GOOGLEAPPLICATIONCREDENTIALS=/Users/siarhei/Projects/firebase-admin-cli/serviceAccount.json siarhei@MacBook-Pro firebase-admin-cli % firebase cli --with=../examples/my_extension.js

firebase-admin-cli@1.0.0 start node ./bin/firebase-cli.js

The following settings are loaded: Service Account from file: /Users/siarhei/Projects/ireceipt-pro/firebase/functions/accounts/production.json Project id: ireceipt-pro Extension is loaded: ../examples/my_extension.js The following methods are now available to you: ext.printFile ┌─────────┬───────────┬───────────────────────────────────────────┬─────────────────────────────┐ │ (index) │ command │ title │ alias │ ├─────────┼───────────┼───────────────────────────────────────────┼─────────────────────────────┤ │ 0 │ 'help()' │ 'Сall current help' │ 'help()' │ │ 1 │ 'auth' │ 'Сall firebase authorization interface' │ 'admin.auth()' │ │ 2 │ 'rtdb' │ 'Сall firebase database interface' │ 'admin.database()' │ │ 3 │ 'db' │ 'Сall firebase firestore interface' │ 'admin.firestore()' │ │ 4 │ 'storage' │ 'Сall firebase storage interface' │ 'admin.storage()' │ │ 5 │ 'bucket' │ 'Сall firebase storage/bucket interface' │ 'admin.storage().bucket()' │ │ 6 │ 'types' │ 'Сall firebase firestore types interface' │ 'admin.firestore' │ │ 7 │ 'exit()' │ 'Exit console' │ 'terminalInterface.close()' │ └─────────┴───────────┴───────────────────────────────────────────┴─────────────────────────────┘ Firebase Admin CLI (ireceipt-pro)> ```

Extensions

You can create your own extensions for the application and run them inside the console.

If you want to use extensions, just list them using the prefix --with=, for example:

bash siarhei@MacBook-Pro firebase-admin-cli % firebase cli --with=../examples/my_extension.js --with=../examples/my_extension_2.js --with=../examples/my_extension_3.js

After that, you can use the extension commands. For example:

js ext.printFile("users/test_file.json")

Here is example of the JavaScript extension (also you can use TypeScript):

```js const { tools } = require("firebase-admin-cli");

/** * Print a GCS file data * * Example ext.printFile("users/test_file.json"); * @param {String} path - file path */ const printFile = async (path) => { console.log( await tools.bucket .file(path) .download() .then(([buf]) => buf.toString()) ); };

module.exports = { printFile }; ```

Owner

  • Name: Siarhei Dudko
  • Login: siarheidudko
  • Kind: user
  • Company: @dudko-dev

GitHub Events

Total
  • Release event: 15
  • Delete event: 1
  • Push event: 16
  • Create event: 30
Last Year
  • Release event: 15
  • Delete event: 1
  • Push event: 16
  • Create event: 30

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 112
  • Total Committers: 1
  • Avg Commits per committer: 112.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 38
  • Committers: 1
  • Avg Commits per committer: 38.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Siarhei s****h@g****m 112

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • npm 148 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 0
  • Total versions: 44
  • Total maintainers: 1
npmjs.org: firebase-admin-cli

Cli for firebase project

  • Versions: 44
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 148 Last month
Rankings
Dependent packages count: 16.2%
Downloads: 17.9%
Average: 20.4%
Forks count: 20.5%
Stargazers count: 22.1%
Dependent repos count: 25.3%
Maintainers (1)
Funding
  • type: buymeacoffee: url: https://www.buymeacoffee.com/dudko.dev
  • type: paypal: url: https://paypal.me/dudkodev
  • type: patreon: url: https://patreon.com/dudko_dev
Last synced: 6 months ago

Dependencies

.github/workflows/autoupdate.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/create-release v1 composite
  • actions/setup-node v3 composite
  • siarheidudko/autoupdater v3 composite
.github/workflows/deploy.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/create-release v1 composite
  • actions/setup-node v3 composite
package-lock.json npm
  • 200 dependencies
package.json npm
  • firebase-admin ^11.5.0