Google Workspace CLI: Google Built a Terminal for AI Agents
Google quietly released a CLI that gives your terminal — and your AI agent — direct access to Gmail, Drive, Calendar, Docs, Sheets, and more. Here is why that matters.
Google quietly released a CLI that gives your terminal — and your AI agent — direct access to Gmail, Drive, Calendar, Docs, Sheets, and more. Here is why that matters.
Google released a CLI that gives terminal-based AI agents like Claude Code direct, structured access to Gmail, Calendar, Drive, Docs, Sheets, and more — no browser required. This is the kind of primitive that closes the gap between the tools you think in and the tools you communicate through.
There is a category of software release that doesn't make headlines on launch day but quietly rewires how serious developers work. The Google Workspace CLI — gws — is one of those.
At its core, it is a single command-line tool that wraps the entire Google Workspace API surface: Gmail, Drive, Calendar, Docs, Sheets, Slides, Chat. One binary. One authentication flow. Every resource reachable with a structured command and a JSON response.
That might sound like a developer convenience. It is more than that.
If you have been using a terminal-first AI agent like Claude Code, you have probably noticed a mismatch. The agent can read your codebase, run your tests, and modify files with precision. But your actual working life — your inbox, your calendar, your shared Docs — lives behind a browser. The agent can't touch any of it without you acting as the middleman.
gws closes that gap without any custom tooling in the middle. You authenticate once, and every Workspace resource becomes a terminal command. Your AI agent runs those commands the same way it runs git or npm. No browser in the loop.
The README is explicit about the intent: "built with agents in mind." Every response is structured JSON. There are pre-built agent skills for Gmail, Drive, Docs, Calendar, and Sheets — SKILL.md files you can drop into your Claude Code setup with a single npx skills add command.
It is worth being precise here, because there is a real difference.
A browser extension or a chatbot plugin tries to simulate human behavior in a graphical interface. It clicks buttons, waits for page loads, and scrapes rendered HTML. It is brittle by design.
A CLI talks directly to the underlying API. No rendering, no simulation. gws gmail messages list calls Google's Gmail API and returns structured data. It is the same data the Gmail web app uses, delivered in a format a program can actually consume.
AI agents can't reliably navigate a browser. They can reliably execute a terminal command and parse the output. This is the surface they were designed to operate on — and gws meets them there.
The quick-start is honest about the surface area:
# List recent Drive files
gws drive files list --params '{"pageSize": 10}'
# Create a spreadsheet
gws sheets spreadsheets create --json '{"properties": {"title": "Q1 Budget"}}'
# Preview a Gmail action before running it
gws gmail users messages send --dry-run
The --dry-run flag is worth noting. Before any write operation actually executes, you can preview exactly what gets sent. For an AI agent that might be touching your inbox or calendar, that safety primitive matters.
Authentication supports multiple flows — OAuth for local desktop use, service accounts for CI, and a browser-assisted option that works in headless environments. The gws auth setup command walks through the Google Cloud project configuration. It requires a Cloud project and a Google account with Workspace access, but the setup is documented clearly and the --help flag is present on every resource and subcommand.
The agent skills ship as part of the repo. Install all of them at once or pull only what you need:
# All skills
npx skills add https://github.com/googleworkspace/cli
# Just Drive and Gmail
npx skills add https://github.com/googleworkspace/cli/tree/main/skills/gws-drive
npx skills add https://github.com/googleworkspace/cli/tree/main/skills/gws-gmail
The timing of this release lands at an interesting moment. Terminal-based AI agents have matured enough that the bottleneck is no longer raw capability — it is access. The agent can reason, plan, and execute. What it hasn't been able to do is reach the data that actually drives day-to-day work.
Email threads, calendar context, shared documents — these are where decisions get made and work gets communicated. Giving an AI agent terminal-level access to that layer is a meaningful shift in what is possible to automate, not just assist.
The companies building useful AI integrations right now are making the same move: build a surface the agent can operate on natively, not one that requires simulating a human. gws is Google making that move for its own product suite.
There is nothing exotic about what gws requires. If you already use Claude Code, you already work in a terminal, you already have Node.js installed, and you are already familiar with how CLI tools compose with the rest of a shell environment.
The gap between "this is interesting" and "this is running in my workflow" is genuinely small.
npm install -g @googleworkspace/cli
gws auth setup
gws auth login
Three commands and you have a Workspace-aware terminal. From there, every follow-up question about what to do with it is just a matter of which workflows are worth building.
That is the kind of low-friction primitive worth paying attention to.