
Connect Multiple Google Accounts to Claude Code (Google Workspace CLI)
Jonathan Lewell
Overview
This video demonstrates how to overcome the limitations of standard Google connectors in Claude by using the Google Workspace Command Line Interface (CLI). The standard connectors only allow one Google account and have restricted functionality, such as only drafting emails. The Google Workspace CLI, however, enables users to connect multiple Google accounts (Gmail, Drive, Calendar, etc.) and perform a much wider range of actions, including sending emails, creating calendar events, and managing documents and spreadsheets. The tutorial provides a step-by-step guide on installing and configuring the CLI for one or more Google accounts, involving setting up Google Cloud projects, enabling APIs, configuring OAuth consent screens, and authenticating the CLI with your accounts.
Save this permanently with flashcards, quizzes, and AI chat
Chapters
- Standard Google connectors in Claude are limited to a single Google account.
- Functionality is restricted, e.g., only drafting emails, not sending or replying.
- These limitations hinder users with multiple email addresses or Google Drive accounts.
- The Google Workspace CLI offers expanded functionality beyond standard connectors.
- It allows connecting multiple Google accounts (Gmail, Drive, Calendar, etc.) simultaneously.
- Users can perform a wider range of actions, such as sending emails and creating calendar events.
- Installation can be initiated by instructing Claude to install the Google Workspace CLI, referencing its GitHub documentation.
- Claude will ask clarifying questions about desired Google accounts and services.
- Users need to create a Google Cloud project and enable specific APIs (e.g., Gmail, Drive, Calendar).
- A new Google Cloud project must be created via the Google Cloud console.
- Required APIs (Gmail, Drive, Calendar, Docs, Sheets, Slides) need to be enabled within the project.
- This grants the CLI permission to interact with these Google services.
- An OAuth consent screen must be configured to authorize access to user data.
- Test users (your own email addresses) need to be added to the consent screen.
- A desktop application client is created, and its JSON credentials file is downloaded.
- The downloaded client secret JSON file is placed in a specific hidden configuration folder.
- The `gws-cli login` command is run, which prompts for browser-based authentication.
- Successful authentication confirms the connection to Google services like Drive, Gmail, and Calendar.
- To add another account, repeat the process of creating a new Google Cloud project and enabling APIs for that specific account.
- Each new account requires its own set of OAuth credentials and a dedicated configuration folder within the CLI's config directory.
- The CLI automatically creates new subfolders (e.g., 'GWS_Insider_One') for each additional account's credentials.
- Once configured, the CLI can be used via Claude to perform various tasks across connected accounts.
- Examples include drafting documents in Google Drive, creating slide decks, and querying calendar events.
- Users can switch between accounts to manage different services independently.
Key takeaways
- The Google Workspace CLI significantly enhances Claude's integration with Google services by overcoming the single-account and limited-functionality restrictions of native connectors.
- Connecting multiple Google accounts requires setting up separate Google Cloud projects and OAuth credentials for each account.
- The installation process involves instructing Claude, creating Google Cloud projects, enabling necessary APIs, configuring OAuth consent screens, and authenticating via browser login.
- Properly organizing downloaded JSON credentials into dedicated folders within the CLI's config directory is essential for managing multiple accounts.
- The CLI enables advanced actions like sending emails, creating calendar events, and managing documents/spreadsheets directly through Claude.
- Documenting your connected services (e.g., in a Markdown file) helps Claude understand which CLI to use for specific requests.
- The Google Workspace CLI offers a more powerful and flexible alternative to the standard Google connectors for users managing multiple Google accounts.
Key terms
Test your understanding
- What are the primary limitations of the standard Google connectors within Claude that the Google Workspace CLI addresses?
- How does the Google Workspace CLI enable the connection and management of multiple Google accounts?
- What are the essential steps involved in setting up a Google Cloud project for use with the Google Workspace CLI?
- Why is configuring the OAuth consent screen and adding test users a critical part of the CLI setup process?
- How can a user verify that the Google Workspace CLI has been successfully installed and authenticated for a specific Google account?