How to Connect Google Workspace CLI to Claude Code

206.0K views
•
March 10, 2026
by
Nate Herk | AI Automation
YouTube video player
How to Connect Google Workspace CLI to Claude Code

TL;DR

Install Google Workspace CLI, authenticate it through a Google Cloud project, and enable the Workspace APIs you need to let Claude Code work with Gmail, Drive, Docs, Sheets, Slides, and Calendar. The open-source CLI returns structured JSON, automatically discovers new Workspace API methods, and includes more than 100 workflow recipes, but it remains under active development and may introduce breaking changes before version 1.0.

Transcript

Google just dropped what some are already calling the most powerful workspace CLI on the internet. So if you've got a ton of stuff that lives in the Google environment just like I do, then you're going to love this because now any of my cloud code projects can access everything. And all I had to do was install one simple thing. So here you can see ... Read More

Key Insights

  • Google Workspace CLI is a single command-line interface for Gmail, Drive, Docs, Sheets, Slides, Calendar, Admin, and other Workspace services. Giving Claude Code access to this one tool avoids configuring numerous separate API endpoints or MCP tools that could consume additional context.
  • The CLI is JSON-first, producing structured responses that an AI agent can process effectively. Its automatic discovery feature also picks up Google Workspace API endpoints or methods as they are added, which reduces the maintenance required to keep its available commands current.
  • More than 100 built-in workflow recipes provide pre-made patterns for multi-step tasks. Examples include creating documents from templates, reading spreadsheet data to generate reports, finding free time and scheduling meetings, creating events from sheets, creating presentations, and labeling or archiving emails.
  • Claude Code can create formatted Google Docs through GWS terminal commands instead of relying on a direct API call or MCP connection. In the demonstration, it converts a YouTube link and transcript into a resource guide containing an image, links, organized sections, horizontal lines, and a call to action.
  • A command-line interface lets users and computers operate software through typed text commands instead of graphical buttons and form fields. Claude Code can run those commands in its terminal, allowing it to communicate with Google Workspace services while remaining inside the coding environment.
  • Google Workspace CLI is an open-source and free Google Workspace project, but it is not an officially supported Google product. The repository describes it as being under active development and warns users to expect breaking changes as the project progresses toward version 1.0.
  • Manual authentication requires a Google Cloud project, an OAuth consent screen, and a desktop-app OAuth client ID. The downloaded JSON credentials must be placed in the global GWS configuration directory before the login command can open the Google authorization flow.
  • Workspace APIs must be enabled individually in the selected Google Cloud project before their corresponding services will work. After authentication and API activation, Claude Code can search for files, retrieve document links, inspect unread email, and take actions across the connected Workspace services.

Install to Summarize YouTube Videos and Get Transcripts

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: What can Google Workspace CLI do with Claude Code?

Google Workspace CLI lets Claude Code search, list, upload, download, move, copy, and share files in Google Drive. It can also work with Gmail, Calendar, Docs, Sheets, Slides, Admin, and other Workspace services. Because Claude Code invokes it through terminal commands, users can perform these actions without leaving the coding environment or configuring a separate tool for every service.

Q: How do you install Google Workspace CLI for Claude Code?

Give Claude Code the Google Workspace CLI GitHub repository link and ask it to read the documentation, inspect the existing prerequisites, and guide the installation. Claude Code can install the CLI and identify anything else required. The setup then offers two paths: install Google Cloud CLI for automatic setup and authentication, or manually create and configure a Google Cloud project.

Q: How do you configure OAuth for Google Workspace CLI?

Create or select a project in Google Cloud Console, open APIs and Services, and configure the OAuth consent screen. Provide an application name, contact information, and an audience. An internal audience can serve an organization, while an external testing configuration requires adding the relevant email as a test user. After accepting the terms, create the consent configuration.

Q: How do you create credentials for Google Workspace CLI?

Open APIs and Services in the selected Google Cloud project, go to Credentials, and create an OAuth client ID. Choose desktop app as the application type, give the client a name, and create it. Download the resulting client credentials as a JSON file, then place that file in the global GWS configuration directory so Claude Code and the CLI can locate it.

Q: How do you authenticate Google Workspace CLI with a Google account?

After placing the credential JSON file in the GWS configuration directory, run the GWS OAuth login command. It should open a browser tab, or Claude Code can provide the authorization URL if it does not. Choose the intended Google account, review the requested access, and allow it. The CLI can then test whether authentication works and report any remaining setup problems.

Q: Why must Google Workspace APIs be enabled separately?

Authentication establishes access to the selected Google account, but the required service APIs must also be enabled in the associated Google Cloud project. Open each needed API in the Cloud Console and select enable. Only activate the services you plan to use. A project with those APIs already enabled can be reused by creating the necessary OAuth client ID within it.

Q: How can Claude Code create a formatted Google Doc from a YouTube video?

Provide Claude Code with the YouTube video link and request a resource guide. It can download the transcript, use Google Workspace CLI commands to create a Google Doc, and populate it with formatted content. The demonstration produced a guide with a header image, a channel link, organized topic sections, horizontal separators, and a call to action at the bottom.

Q: Is Google Workspace CLI officially supported and stable?

Google Workspace CLI is described as an open-source and free Google Workspace product, but the repository states that it is not an officially supported Google product. It is under active development and is presented as a developer playground or open-source beta rather than enterprise-backed software. Users should expect breaking changes while development proceeds toward version 1.0.

Summary & Key Takeaways

  • Google Workspace CLI gives Claude Code one command-line interface for working across Gmail, Drive, Docs, Sheets, Slides, Calendar, Admin, and other Workspace services. Its structured JSON responses suit AI agents, while more than 100 built-in workflow recipes support tasks such as generating reports, scheduling meetings, creating presentations, and organizing email.

  • The demonstrated workflow turns a YouTube link into a formatted Google Docs resource guide. Claude Code downloads the transcript, creates and populates the document through terminal commands, inserts a header image and links, organizes the source material into sections, and adds a call to action at the end of the finished guide.

  • Manual setup requires installing the CLI, creating or selecting a Google Cloud project, configuring the OAuth consent screen, creating desktop-app credentials, and saving the downloaded JSON credential file in the GWS configuration directory. After running the login command, users must enable each Google Workspace API they plan to access.


Read in Other Languages (beta)

Share This Summary 📚

Explore More Summaries from Nate Herk | AI Automation 📚