1.2.21 • Published 2 years ago
@devtea2027/sint-quos-nihil-expedita v1.2.21
@devtea2027/sint-quos-nihil-expedita
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!
Install
npm i @devtea2027/sint-quos-nihil-expedita -gRun
> export GOOGLE_APPLICATION_CREDENTIALS=/FULL_PATH_TO_YOUR_SERVICE_ACCOUNT.json
> firebase-cliHow to use
Just use JavaScript to manage the database.
- You can use one-line commands
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()));- You can insert multi-line scripts
// 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
// command 1
const users = await db.collection("users").get();// command 2
const arr = users.docs.map((e) => e.data());// 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)
console.log(await db.collection("users").get());- You can even execute your script from a file using require();
require("../my_migration_script.js").run();my_migration_script.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
siarhei@MacBook-Pro @devtea2027/sint-quos-nihil-expedita % export GOOGLE_APPLICATION_CREDENTIALS=/Users/siarhei/Projects/@devtea2027/sint-quos-nihil-expedita/serviceAccount.json
siarhei@MacBook-Pro @devtea2027/sint-quos-nihil-expedita % firebase cli
> @devtea2027/sint-quos-nihil-expedita@1.1.0 start
> node ./bin/firebase-cli.js
The following settings are loaded:
Service Account from file: /Users/siarhei/Projects/@devtea2027/sint-quos-nihil-expedita/serviceAccount.json
Project id: fir-engine-f1dcd
┌─────────┬──────────┬───────────────────────────────────────────┬─────────────────────────────┐
│ (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 │ 'bucket' │ 'Сall firebase storage/bucket interface' │ 'admin.storage().bucket()' │
│ 5 │ 'types' │ 'Сall firebase firestore types interface' │ 'admin.firestore' │
│ 6 │ 'exit()' │ 'Exit console' │ 'terminalInterface.close()' │
└─────────┴──────────┴───────────────────────────────────────────┴─────────────────────────────┘
Firebase Admin CLI (fir-engine-f1dcd)>const users = await db
.collection('users')
.get();
console.log('users', users.docs);
Firebase Admin CLI (fir-engine-f1dcd)>
users []
Firebase Admin CLI (fir-engine-f1dcd)>1.2.20
2 years ago
1.2.21
2 years ago
1.2.19
2 years ago
1.2.18
2 years ago
1.2.16
2 years ago
1.2.17
2 years ago
1.2.15
2 years ago
1.2.14
2 years ago
1.2.13
2 years ago
1.2.12
2 years ago
1.2.11
2 years ago
1.2.10
2 years ago
1.2.9
2 years ago
1.2.8
2 years ago
1.2.7
2 years ago
1.2.6
2 years ago
1.1.6
2 years ago
1.1.5
2 years ago
1.1.4
2 years ago
1.1.3
2 years ago
1.1.2
2 years ago
1.1.1
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago