googGitHub

Create your OAuth app

goog signs in through an OAuth app in your own Google Cloud project. Set it up once, then log in to as many accounts as you like.

1

Create a Google Cloud project

Your OAuth app lives in a Google Cloud project that you own.

Create a project
  1. a

    Give the project any name and click Create.

  2. b

    Already have a project you want to use? Select it in the project picker at the top of the console and go to the next step.

2

Enable the six APIs

Turn on the Google APIs that goog calls.

  1. a

    Open each API below and click Enable.

  2. b

    If the page shows Manage and API Enabled, that API is already on.

Google Drive API page showing the Manage button and the API Enabled badge
4

Add your accounts as test users

The app stays in Testing mode, so only accounts on the test user list can log in.

Open Audience
  1. a

    Under Test users, click Add users.

  2. b

    Add every Google account you plan to use with goog.

You can add more accounts later. Add each one here before you log in to it with goog.

Audience page with the External user type and the Add users button
5

Create an OAuth client

The client gives goog the ID and secret it signs in with.

Open Credentials
  1. a

    Click Create credentials.

  2. b

    Choose OAuth client ID.

Credentials page with the Create credentials buttonCreate credentials menu with OAuth client ID highlighted
6

Choose Desktop app

goog runs on your computer, so it uses the Desktop app type.

  1. a

    Set Application type to Desktop app.

  2. b

    Enter any name, then click Create.

Application type list with Desktop app highlightedCreate OAuth client ID form with Desktop app selected and a name filled in
7

Copy the client ID and secret

Google shows both values in a dialog right after it creates the client.

  1. a

    Copy the Client ID. It ends in .apps.googleusercontent.com.

  2. b

    Copy the Client secret. It usually starts with GOCSPX-.

  3. c

    Or click Download JSON to save both in one file.

Google shows the client secret only once. Copy it or download the JSON before you close the dialog.

OAuth client created dialog showing the client ID, client secret and Download JSON link
8

Connect goog

Give goog the client, then log in to each account once.

  1. a

    Paste the client ID and secret when goog asks for them.

    $goog auth setup
  2. b

    Or point goog at the downloaded JSON file.

    $goog auth setup --client-secret-file ~/Downloads/client_secret_*.json
  3. c

    Log in to an account. Your browser opens the consent screen. Run it again for each account.

    $goog auth login
  4. d

    Check that every account is listed.

    $goog auth list