Questions tagged [firebase-cli]

The Firebase CLI provide a variety of tools for managing, viewing, and deploying to Firebase projects, as well as a set of emulators for Firebase products. It's available via the npm module firebase-tools.

These are the Firebase Command Line (CLI) Tools. They can be used to:

  • Administer your Firebase account

  • Interact with Firebase Hosting, our product to host your static HTML, JS, CSS, images, etc.

  • Interact with the Firebase Database, to read and write JSON data and deploy security rules

  • Interact with Firebase Storage, to read and write files and deploy security rules

  • Deploy Cloud Functions for Firebase code

  • Emulate Cloud Functions and Cloud Firestore locally for use in development and testing.

See also:

Related tags

814 questions
5
votes
7 answers

Firebase CLI always shows Error: Invalid project id: \

Every time I use a firebase command this error occurs: ...\WEBRTCTest\FirebaseRTC> firebase use --add Error: Invalid project id: \. \WEBRTCTest\FirebaseRTC> firebase use --clear Error: Invalid project id: \. The error occured after I accidently…
Pbopbo
  • 61
  • 1
  • 4
5
votes
1 answer

Google Firebase Cloud Functions generates error when using Firestore and implemented per the docs

With the following code: const functions = require('firebase-functions') const admin = require('firebase-admin') admin.initializeApp() exports.onTest = functions.https.onRequest(async (req, res) => { res.json({ msg: 'done' }) }) which comes…
Tremendus Apps
  • 1,497
  • 12
  • 20
5
votes
2 answers

import env variables from file in firebase

I know we can set env variables in command line like this: firebase functions:config:set slack.id="XXXX" slack.secret="XXXX" But if we have too many env variables to set, can we put it in a file and import like this: firebase functions:config:set…
derek
  • 9,358
  • 11
  • 53
  • 94
5
votes
0 answers

Getting Cloud Functions url for unit testing with emulator

I have a couple of Cloud Functions that interact with Cloud Firestore. I've managed to start emulator for both (firebase emulators:start --only functions,firestore) and I run the request and it works. However, the URL for emulated functions is…
5
votes
1 answer

Firebase serve in docker container works for functions but not hosting

I've set up the following container Dockerfile: FROM devillex/docker-firebase ENV USER=app RUN apt-get update && apt-get install -y openssl \ libssl-dev \ bash \ less \ vim \ gnupg \ curl \ …
Noah Goodrich
  • 24,875
  • 14
  • 66
  • 96
5
votes
1 answer

Is it possible to add custom claims through CLI?

Our Application will have a limited amount of admin users that I would like to manually add an admin custom claims to their account. As such I would like to be able to just manually add a custom claims directly through the firebase console or CLI…
F22lightning
  • 620
  • 6
  • 16
5
votes
1 answer

Firebase functions - admin.firestore() get() throws auth error on local serving

I have a firebase cloud function, which gets the data from the cloud firestore. const userSnapshot = await admin.firestore().collection('users').doc(user).get() when this api is deployed locally using firebase emulators:start. I get the following…
Indhu
  • 9,806
  • 3
  • 18
  • 17
5
votes
1 answer

Cloud Functions Error: function is not a valid feature. Must be one of database,firestore,functions,hosting,storage

I am being practiced to make TelegramBot using firebase cloud function. installed firebase-tools, registered the firebase account and created a new sample project, but then I got an error when I selected the project. This is the error…
Nanda Z
  • 1,604
  • 4
  • 15
  • 37
5
votes
6 answers

Firebase CLI how to change project scope?firebase init(error:403, The caller does not have permission) uses project url of another account

My error when using firebase init --debug [2019-01-28T05:32:18.956Z] Error Context: { "body": { "error": { "code": 403, "message": "The caller does not have permission", "status": "PERMISSION_DENIED" } }, "response": { "statusCode":…
5
votes
1 answer

Firebase cli throws Error: Server Error. connect ETIMEDOUT on every command

I checked all the answers to this question on stack overflow. But all of them occurred due to some other reasons. Well, I was trying to deploy some database rules and started getting this error. And later on when i tried to do anything i realized…
Harkal
  • 1,770
  • 12
  • 28
5
votes
2 answers

How to deploy Firebase Storage rules to specific buckets?

I'd like to know how storage rules deployment works in Firebase. In Firebase Storage I have 2 buckets app.appspot.com and app-mybucket. On my local machine I have a storage.rules file which looks something like this: service firebase.storage { …
galki
  • 8,149
  • 7
  • 50
  • 62
5
votes
1 answer

Deploying a Firebase app breaks before refresh

Whenever I deploy my Firebase app for hosting that is a packaged Create-React-App then the first time the browser loads it the console shows: main.27e9b1c2.js:1 Uncaught SyntaxError: Unexpected token < F5 refresh fixes it. Then the site is working…
arisalexis
  • 2,079
  • 2
  • 21
  • 42
5
votes
1 answer

Firebase RTDB: updating/merging new with old data from CLI

I have multiple (big) JSON files that I want to add to Firebase Real-time Database (RTBD). I'm using Geofire, so all the children nodes need to be under the same parent. I'm storing static geo-data but I want to periodically refresh it in pieces. If…
philshem
  • 24,761
  • 8
  • 61
  • 127
5
votes
3 answers

Firebase Cloud Function deploy tslint error

I started a new Firebase project with the CLI. I'm using only Cloud functions and wanted to deploy some functions but Im getting this error functions@ lint: `tslint --project tsconfig.json` I already changed following lines: "npm --prefix…
Johann Feser
  • 445
  • 1
  • 7
  • 17
5
votes
2 answers

Removing all documents and collections from the Firestore

I am trying to clear a Firestore database which was filled with a lot of documents and subcollections for testing purposes. The Firebase CLI (firebase-tools@3.18.4) suggests the following possibility to delete data from Cloud Firestore: Usage:…
jmeinke
  • 530
  • 6
  • 27