skip to Main Content

I’ve been using the Firebase CLI tools for a while, and I’ve always authenticated by generating a token with firebase login:ci and then logging in with firebase login --token <token>.

However, I recently discovered that firebase login --token <token> is now deprecated.

What is the current recommended method for logging in to the Firebase CLI? Are there new commands or processes I need to follow to authenticate?

I need this specifically for use in GitLab pipelines. Any guidance would be appreciated. Thanks!

2

Answers


  1. I had this issue too! Use firebase login --no-localhost. Follow the instructions, and it’ll spit out a token. Then, paste your authentication token into the terminal.

    Login or Signup to reply.
  2. See the documentation for Use the CLI with CI systems:

    The Firebase CLI requires a browser to complete authentication, but
    the CLI is fully compatible with CI and other headless environments.

    1. On a machine with a browser, install the Firebase CLI.

    2. Start the signin process by running the following command:

    firebase login:ci

    1. Visit the URL provided, then log in using a Google account.

    2. Print a new refresh token. The current CLI session will not be
      affected.

    3. Store the output token in a secure but accessible way in your CI
      system.

    4. Use this token when running firebase commands. You can use either of
      the following two options:

      • Option 1: Store the token as the environment variable FIREBASE_TOKEN. Your system will automatically use the token.

    Basically, you’re being told to use the FIREBASE_TOKEN environment variable instead of --token.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search