AI Board

AI BOARD

AI Board

AI tools, policy moves, and public decisions are tracked in plain language.

All posts AI Briefs Tools Policy Education Industry

Connecting All of Google to Claude Code with GWS CLI

Author
김 경진
Date
2026-03-30 10:57
Views
96

Connecting All of Google to Claude Code with GWS CLI

A Complete Guide Even Elementary School Students Can Follow

Gmail · Calendar · Drive · Docs · Sheets · Slides, all with one command

In March 2026, Google opened its entire service stack to AI. With one installation, Gmail, Calendar, Spreadsheets, Slides, and Google Docs all became usable from Claude Code. The key is GWS CLI(Google Workspace Command Line Interface).

This article includes every step without omission so even people who do not know much about computers can follow along as if someone were moving their fingers for them.


Part 1. What GWS CLI Is and Why It Is Needed

1. Terminal Window

Just as you send a message to a friend through KakaoTalk, you can send commands to a computer in text. That window is the terminal. AI can easily enter text commands. Google wrapped its core Workspace services, Gmail, Drive, Docs, Sheets, and Calendar, in Bash commands that can run from the terminal. Authentication needs to be done only once, and the output comes back as structured JSON suitable for scripting.


2. Difference from the Existing Approach

If you used APIs or MCP separately, you had to connect, authenticate, and configure Gmail, Drive, and Calendar one by one. You might write Python scripts wrestling with OAuth2, set up service accounts with complex permissions, or connect Zapier automation that breaks whenever Google changes an API response format. Installing GWS CLI alone solves all of this. It is like a universal USB port.


3. Four Reasons GWS CLI Is Special

Automatic updates - GWS does not carry a fixed list of commands. It reads Google's Discovery Service at runtime and dynamically builds the full command system. When Google Workspace adds API endpoints or methods, GWS reflects them automatically.

Built-in MCP servergws mcp -s drive,gmail,calendar command, the CLI starts an MCP server and exposes Workspace APIs as structured tools that MCP-compatible clients, such as Claude Code and VS Code, can call.

More than 100 agent skills - Practical workflows are already built in, including email summaries, reply drafting, file search, automatic spreadsheet updates, and document writing, and it includes 50 curated recipes for Gmail, Drive, Docs, Calendar, and Sheets.

Security - Credentials are stored encrypted with AES-256-GCM, and keys are kept in the OS keyring, such as macOS Keychain or Windows Credential Manager.


4. The Fact That It Is Not an Official Product

This project is not an official Google product. Because it is actively being developed toward v1.0, you should expect possible breaking changes. Still, Google Cloud figures introduced it directly, and it was widely reported as a Google AI and Workspace release. Since its March 2026 release, it has been available as an open-source tool written in Rust under the Apache 2.0 license.


Part 2. Preparation: Checking What You Need

1. Check Whether Node.js Is Installed

GWS CLI is installed with npm. Node.js must be installed first.

How to check on Mac (macOS)

(1) Click the magnifying glass (Spotlight) at the top right of the screen and type "Terminal."

(2) When Terminal opens, enter the command below and press Enter.


node --version

(3) v18.0.0If a version number appears, it is installed.

(4) If it says "command not found," you need to install Node.js.

Installing Node.js if you do not have it

(1) In your browser, go to https://nodejs.org.

(2) Click the green button for the LTS (Long-Term Support) version to download it.

(3) Double-click the downloaded file and keep pressing the "Continue" button to complete installation.

(4) Close Terminal, open it again, and enter node --versionto check.

How to check on Windows

(1) Press the Windows key on the keyboard, search for "PowerShell," and run it.

(2) node --versionEnter it.

(3) If it is not installed, install it from https://nodejs.org using the same method.


2. Install VS Code

(1) https://code.visualstudio.com in your browser.

(2) Download and install the version for your operating system.

(3) If you want Korean mode, click the square block icon, Extensions, in the left sidebar, search for "Korean Language Pack," and install it.


3. Connect Claude Code to VS Code

(1) In the left sidebar of VS Code, click the square block icon, Extensions.

(2) Type "Claude" in the search box.

(3) Find the "Claude" extension and press the "Install" button.

(4) When installation finishes, a Claude icon appears on the left. Click it.

(5) A login screen appears in the AI panel on the right. Click the orange button and connect with your Claude account.

(6) If a message says "Install Git," https://git-scm.cominstall Git from there, then restart VS Code.


4. Create a working folder

(1) From the top menu of VS Code, select File -> Open Folder.

(2) Create a new folder in the location you want, for example, "google-gws."

(3) Select that folder and open it. Now you will see three areas in VS Code. The left side is the file area, the center is the working area, and the right side is the AI panel.


Part 3. Installing GWS CLI

There are two paths.Automatic setup, gws auth setupandmanual setup.


Path A, automatic setup with gws auth setup, recommended

This method requires gcloud CLI to be installed first.

A. Install gcloud CLI

(1) https://cloud.google.com/sdk/docs/install in your browser.

(2) Download the installer for your operating system.

(3) Complete installation by following the installer instructions.

(4) In Terminal, run gcloud --version to confirm the installation.

B. Install GWS CLI

(1) Open Terminal and enter the command below.


npm install -g @googleworkspace/cli

(2) When installation finishes, confirm with gws --version. The npm package automatically includes the native binary for your operating system, so no separate build tools are needed.

C. Run automatic setup

(1) In Terminal, enter the command below.


gws auth setup

(2) A five-step wizard starts. Step 1 checks gcloud CLI, Step 2 authenticates your Google account, Step 3 selects or creates a GCP project, Step 4 selects the Workspace APIs to enable, and Step 5 creates OAuth credentials.

(3) Select checkmarks with the spacebar, and when moving to the next step, press Enter.

(4) On the API selection screen, select Gmail, Google Drive, Google Calendar, Google Docs, Google Sheets, and Google Slides.

(5) When all steps finish, a browser opens and asks you to log in to your Google account. Log in, and authentication is complete.


Path B, manual setup, if you do not have gcloud

A. Install GWS CLI same as Path A


npm install -g @googleworkspace/cli

B. Create a project in Google Cloud Console

(1) In a browser, open https://console.cloud.google.com.

(2) Log in with your Google account.

(3) Click the project selection dropdown at the top of the screen.

(4) Click "New Project."

(5) Enter "gws-cli" as the project name.

(6) Click "Create."

C. Enable APIs

(1) From the left menu, click "APIs & Services" -> "Library."

(2) Type "Gmail API" in the search box, click it, and press the "Enable" button.

(3) Enable the following APIs in the same way: Google Drive API, Google Calendar API, Google Docs API, Google Sheets API, Google Slides API

D. Configure the OAuth consent screen

(1) From the left menu, click "APIs & Services" -> "OAuth consent screen."

(2) Click "Get started" or "Configure consent screen."

(3) Enter "gws-cli" as the app name.

(4) Enter your own email as the user support email.

(5) For user type, select "External".

(6) Enter your own email again as the developer contact email.

(7) Click "Create" or "Save and continue."

(8) Important: You must press the "Publish app" button in the "Audience" tab. If you do not, the token expires every seven days.

E. Create an OAuth client ID

(1) From the left menu, click "APIs & Services" -> "Credentials."

(2) At the top, click "+ Create Credentials" -> "OAuth client ID."

(3) For application type, you must select "Desktop app" because GWS uses a localhost redirect.

(4) Enter "gws-cli" as the name.

(5) Click "Create."

(6) The client ID and client secret are displayed. Copy them into Notepad.

(7) "Download JSON" Click the button and save the JSON file.

F. Move the JSON file to the GWS settings folder

For Mac, enter the commands below in Terminal in order.


mkdir -p ~/.config/gws
mv ~/Downloads/client_secret*.json ~/.config/gws/client_secret.json
chmod 600 ~/.config/gws/client_secret.json

For Windows, move the JSON file in Downloads whose name starts with client_secret to the %USERPROFILE%\.config\gws\ folder.

G. Log in

(1) In Terminal, enter the command below.


gws auth login

(2) When the browser opens, log in with your Google account.

(3) You may see a warning saying "Google has not verified this app." "Continue" Click it.

(4) When permission checkboxes appear, select the needed scopes or click "Select all."

(5) If the message "You may now close this window" appears, authentication is complete.


Confirm installation

Try entering the command below in Terminal.


gws auth status

If the authentication status appears, it worked. Test actual API operation as well.


gws drive files list --params '{"pageSize": 5}'

If five files from Google Drive are printed in JSON format, all setup is complete.


Part 4. Connecting Claude Code and GWS CLI

When using GWS CLI with Claude Code, you do not need to set up a separate MCP server. Claude Code uses GWS CLI as an ordinary terminal tool. There are two ways.


Method A, install agent skills, recommended

The GWS repository provides 92 official skills designed for Claude Code. Enter the command below in Terminal.


npx skills add https://github.com/googleworkspace/cli

Each installed skill teaches Claude Code to use the corresponding gws helper command. It is a single-call shortcut that automatically handles multi-step work.

Major commands available after installation:


gws gmail +triage                # Inbox summary
gws gmail +send --to address --subject "Title" --body "Content"
gws calendar +agenda # Check upcoming schedule
gws drive +upload --file ./filename # Upload file
gws docs +write --document-id ID --text "Content"
gws sheets +read --spreadsheet-id ID --range "Sheet1!A1:D10"

Method B, connect as an MCP server

You can also run GWS CLI as an MCP server and use it as a tool in Claude Desktop or VS Code.


gws mcp -s drive,gmail,calendar,sheets,docs

To register MCP in Claude Code, the terminal version:


claude mcp add --transport stdio gws -- gws mcp -s drive,gmail,calendar,sheets,docs

Part 5. Setting VS Code bypass permission mode

It can be annoying when Claude Code asks every time, "Do you want to allow this action?" If you want to leave it fully to AI, enable bypass permission mode.

(1) At the top of the AI panel, press Shift+Tab to switch modes.

(2) If bypass permission mode does not appear, go to VS Code settings, the gear icon.

(3) Type "bypass" in the search box.

(4) Enable the "Claude Code: Allow Dangerously Risky Permission" checkbox.

(5) Now Claude Code runs immediately without asking for permission.


Caution: In this mode, AI can delete files or make system changes without asking, so backing up before important work is recommended.

Part 6. Practical Use, automatically classifying 249 emails

Enter the following in the AI panel.


"Score the emails that arrived over the last 30 days in order of importance. Mark unimportant ones as read, and report high-importance ones to me. Summarize newsletters and save them in Google Docs. Proceed using GWS."

Claude Code receives this command and combines related gws gmail commands to run it. As a result, 249 emails are classified by importance. Lecture proposals become immediate-check items, and 189 newsletters are summarized and saved in Google Docs. If Claude Code seems not to recognize GWS, tell it once more, "GWS CLI is installed and authenticated."


Part 7. Practical Use, creating a YouTube-to-Google Docs guide

Enter the following in the AI panel.


"Organize the content of this YouTube link, paste URL, into a guide format and save it in Google Docs."

Claude Code extracts YouTube subtitles, organizes the key content, and uses the Google Docs API to create a formatted document with bold text, dividers, and emoticons. If you want prettier formatting, ask, "Isn't there a GWS skill for changing Google Docs formatting or bold text?"


Part 8. Practical Use, automatically creating Google Slides

(1) In the left file area of VS Code, create a folder named "brand" and put the brand logo and guideline files inside it.

(2) Enter this in the AI panel.


"Create Google Slides about this YouTube content, using the logo and guidelines in the brand folder as reference."

Claude Code has no eyes. Because it creates slides with code, the layout may not be perfect. At that point, ask, "Isn't there a GWS skill that takes screenshots and fixes the layout?" It will use the get thumbnail skill to capture each slide, detect layout problems on its own, and fix them. If the logo on the last page is cut off, give a specific instruction: "The logo on the last page is cut off. Fix it."


Part 9. What to do when errors occur

1. When the browser does not open

gws auth loginIf you run it and the browser does not open automatically, copy the URL printed in the terminal and paste it directly into the browser.


2. "client_secret.json not found" error

This means GWS cannot find client_secret.json. Check with the command below.


cat ~/.config/gws/client_secret.json | jq '.installed.client_id'

If the result is null, you need to download the file again from Google Cloud Console.


3. When the token expires after seven days

Projects configured with an external user type and a publishing status of "Testing" receive refresh tokens that expire after seven days. In the "Audience" tab of the OAuth consent screen, switch the app to "Published" status to solve this.


4. Fixing errors with screen captures

You can drag and drop an image into the VS Code AI panel or type at sign, @, to reference an image file. Capture the error screen and say, "Handle this error," and Claude Code will analyze it and suggest a solution. Try explaining it in words first. If that does not work, showing it as an image is the surest method.


Part 10. Collection of use ideas

Automatic morning briefing , if you say "Tell me what I need to do today," it analyzes emails from the last 24 hours, checks calendar events, and summarizes important content.

Automatic newsletter organization , it automatically classifies newsletters you subscribe to and creates a weekly summary document in Google Docs.

Spreadsheet -> document conversion , it extracts data from Google Sheets into a Google Docs report.

Automatic scheduling in empty calendar slots , it checks open time in Google Calendar and automatically schedules meetings.

Content pipeline automation , it detects a new draft in Google Docs, brings in the content, and pushes it to a CMS through a processing pipeline.

Meeting prep agent , it brings in today's calendar events, cross-references related emails, and automatically creates a briefing document.


Part 11. Major GWS CLI commands


Function Command
Inbox summary gws gmail +triage --max 10
Send email gws gmail +send --to address --subject "Title" --body "Content"
Check schedule gws calendar +agenda
List Drive files gws drive files list --params '{"pageSize": 10}'
Upload file gws drive +upload --file ./filename
Write to Docs gws docs +write --document-id ID --text "Content"
Read Sheets gws sheets +read --spreadsheet-id ID --range "A1:D10"
Check authentication status gws auth status

Part 12. Key points

GWS CLI is an all-purpose remote control that lets you operate all of Google Workspace with one terminal command. The installation process is as follows.



(1) Check Node.js installation

(2)npm install -g @googleworkspace/cli Install GWS CLI with

(3)gws auth setup Automatic setup with, or manual setup in Google Cloud Console

(4)gws auth login Authenticate your Google account with

(5)npx skills add https://github.com/googleworkspace/cli Install agent skills with

(6) Command in natural language from the Claude Code AI panel in VS Code



Automation does not begin with tools. First, identify which tasks in your work repeat, and design how to entrust them to AI. GWS CLI is the path that puts that design into action.



KIMKJ.COM

#KimKyungjin #AttorneyKimKyungjin #KimKyungjinAI #ArtificialIntelligence #AI #AIExpert #AILaw #AIPolicy #AIRegulation #AIEthics #GenerativeAI #ChatGPT #Claude #GPT #LLM #DigitalTransformation #SmartCity #AutonomousDriving #DataRegulation #GDPR #PrivacyProtection #AIGovernance #KimKyungjinFormerNationalAssemblyMember #LegalExpert #TechPolicy #AIEducation #AIAdministrativeRevolution #AIHegemonyWar #kimkj #kimkjcom



kimkj.com Home
Scroll to Top
kimkj.com Home