
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
firebase-admin-cli
Advanced tools
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 i firebase-admin-cli -g
> export GOOGLE_APPLICATION_CREDENTIALS=/FULL_PATH_TO_YOUR_SERVICE_ACCOUNT.json
> firebase-cli
Just use JavaScript to manage the database.
console.log(
await db
.collection("users")
.get()
.then(({ docs }) => docs.map((e) => e.data()))
);
const users = await db.collection("users").get();
console.log(users.docs.map((e) => e.data()));
// 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);
// command 1
const users = await db.collection("users").get();
// command 2
const arr = users.docs.map((e) => e.data());
// command 3
console.log(arr);
console.log(await db.collection("users").get());
require("../examples/my_migration_script_test.js").run();
my_migration_script_test.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);
};
siarhei@MacBook-Pro firebase-admin-cli % export GOOGLE_APPLICATION_CREDENTIALS=/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)>
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:
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:
ext.printFile("users/test_file.json")
Here is example of the JavaScript extension (also you can use TypeScript):
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 };
FAQs
Cli for firebase project
The npm package firebase-admin-cli receives a total of 45 weekly downloads. As such, firebase-admin-cli popularity was classified as not popular.
We found that firebase-admin-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.