Firebase tools login from command line

atardadi picture atardadi · Nov 26, 2015 · Viewed 12k times · Source

I'm using Codeship to deploy a firebase app. In order to do so, I first need to login using the firebase login command. Problem is, I need to login in the browser and then return to the command line and perform the deployment. Is there an automated way to supply credentials to Firebase?

Cheers

Answer

wvm2008 picture wvm2008 · Jun 6, 2016

The accepted answer is correct for the old version of firebase-tools, however this has been deprecated as of version 3. The new command to get the token is:

firebase login:ci

You should save this in some kind of environment variable, ideally, FIREBASE_TOKEN.

Then, with any command you intend to run via ci (i.e. deploy), you can run:

firebase [command] --token [FIREBASE_TOKEN]