Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
98faa1e
Get basic commands in place
samtstern Mar 5, 2021
75dcfdf
Functions emulator args
samtstern Mar 8, 2021
4f7aa73
Logout
samtstern Mar 8, 2021
1b203e3
Fix compile
samtstern Mar 8, 2021
a83bf46
Handle token refreshing
samtstern Mar 8, 2021
575fb0c
Lint
samtstern Mar 8, 2021
25d4347
Fix tests
samtstern Mar 8, 2021
8a06b92
Fix inherited option bug
samtstern Mar 9, 2021
e3d2e78
Make firebase init work
samtstern Mar 9, 2021
8c9493a
Add some docstrings, clean up some global state
samtstern Mar 9, 2021
a8aef0a
Unit tests
samtstern Mar 9, 2021
209e209
Merge branch 'master' into ss-multi-auth
samtstern Mar 9, 2021
65a9bf3
Changelog
samtstern Mar 9, 2021
b9f5379
Fix unit tests
samtstern Mar 9, 2021
0397763
Fix inherited option issue with account
samtstern Mar 9, 2021
c01acf5
Review comments
samtstern Mar 16, 2021
22c9cdd
Merge remote-tracking branch 'github/master' into ss-multi-auth
samtstern Mar 16, 2021
851323f
Fix imports
samtstern Mar 16, 2021
17e3dde
Apply suggestions from code review
samtstern Mar 17, 2021
0d409f8
Merge branch 'master' into ss-multi-auth
samtstern Mar 17, 2021
d8754a4
Merge remote-tracking branch 'github/master' into ss-multi-auth
samtstern Mar 23, 2021
12fa104
Review comments
samtstern Mar 23, 2021
bfd9211
Merge branch 'ss-multi-auth' of github.com:firebase/firebase-tools in…
samtstern Mar 23, 2021
a6a5cd7
Prompt for new account if logging out of global default
samtstern Apr 6, 2021
b2bf7ca
Fix duplicate accounts
samtstern Apr 6, 2021
faea732
Fix requirePermissions issue
samtstern Apr 6, 2021
f3ec559
Merge branch 'master' into ss-multi-auth
samtstern Apr 6, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
- Update to Cloud Firestore emulator v1.11.13 which includes a bug fix for documents which are created and deleted in a single transaction.
- Fixes an edge case with nextPageToken in batchGet in Auth Emulator (#3231).
- Removes unused dependencies (#3252).
- Adds support for multiple accounts via new commands `login:use`, `login:add` and `login:list`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like a feature that could do with (a) documentation in the README and (b) documentation in FireSite

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @rachelsaunders I added a README section, can you take a look?

40 changes: 31 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,18 @@ Below is a brief list of the available commands and their function:

### Configuration Commands

| Command | Description |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| **login** | Authenticate to your Firebase account. Requires access to a web browser. |
| **logout** | Sign out of the Firebase CLI. |
| **login:ci** | Generate an authentication token for use in non-interactive environments. |
| **use** | Set active Firebase project, manage project aliases. |
| **open** | Quickly open a browser to relevant project resources. |
| **init** | Setup a new Firebase project in the current directory. This command will create a `firebase.json` configuration file in your current directory. |
| **help** | Display help information about the CLI or specific commands. |
| Command | Description |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| **login** | Authenticate to your Firebase account. Requires access to a web browser. |
| **logout** | Sign out of the Firebase CLI. |
| **login:ci** | Generate an authentication token for use in non-interactive environments. |
| **login:add** | Authorize the CLI for an additional account. |
| **login:list** | List authorized CLI accounts. |
| **login:use** | Set the default account to use for this project |
| **use** | Set active Firebase project, manage project aliases. |
| **open** | Quickly open a browser to relevant project resources. |
| **init** | Setup a new Firebase project in the current directory. This command will create a `firebase.json` configuration file in your current directory. |
| **help** | Display help information about the CLI or specific commands. |

Append `--no-localhost` to login (i.e., `firebase login --no-localhost`) to copy and paste code instead of starting a local server for authentication. A use case might be if you SSH into an instance somewhere and you need to authenticate to Firebase on that machine.

Expand Down Expand Up @@ -172,6 +175,25 @@ The Firebase CLI can use one of four authentication methods listed in descending
- **Service Account** - set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to point to the path of a JSON service account key file.
- **Application Default Credentials** - if you use the `gcloud` CLI and log in with `gcloud auth application-default login`, the Firebase CLI will use them if none of the above credentials are present.

### Multiple Accounts

By default `firebase login` sets a single global account for use on all projects.
If you have multiple Google accounts which you use for Firebase projects you can
authorize multople accounts and use them on a per-project or per-command basis.

To authorize an additonal account for use with the CLI, run `firebase login:add`.
You can view the list of authorized accounts with `firebase login:list`.

To set the default account for a specific Firebase project directory, run
`firebase login:use` from within the directory and select the desired account.
To check the default account for a directory, run `firebase login:list` and the
default account for the current context will be listed first.

To set the account for a specific command invocation, use the `--account` flag
with any command. For example `firebase --account=user@domain.com deploy`. The
specified account must have already been added to the Firebase CLI using
`firebase login:add`.

### Cloud Functions Emulator

The Cloud Functions emulator is exposed through commands like `emulators:start`,
Expand Down
Loading