These scripts provide a set of utilities to manage different Firebase CLI user accounts (from now on called profiles) in the same computer.
As a summary, these scripts switch between different firebase-tools.json
files which contain the login information for a given Google account.
This solution comes after reading suggestion from this open issue in firebase-tools
: firebase/firebase-tools#181
The different scripts do a different set of actions:
firebase-profile-copy
copies the currently set profile to a named profile, and sets said profile as the active one.firebase-profile-set
changes the active profile to another one previously registered withfirebase-copy-profile
.firebase-profile-list
lists the active profile and the list of available profiles registered by the user.
- Add the scripts to your
PATH
for easier usage with the method of your choice - First, do
firebase login
and log in with one of your accounts. If you're already logged in with the account, there's no need to redo the login process. - Execute
firebase-profile-copy <your_profile_name>
to copy your profile with a given name. The profile will be registered and saved as the active one. - If you want to add more accounts, do
firebase logout
and re-do steps 2. and 3. (and 4. if you need more accounts) - When you have all your profiles copied, you can switch between them with
firebase-profile-set <your_profile_name>
. Note: you may have to log in again with the account that the profile has since you might have logged out of the account in earlier steps. As soon as you do the login again, you shouldn't have any more log in problems. - To see which profile is active, and a list of profiles, just do
firebase-profile-list
Copyright (C) 2020 Adrián García
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.