· via dev.to (home feed)
Google Workspace CLI puts every Workspace API behind one open-source command
Google's open-source gws tool exposes Drive, Gmail, Calendar, Sheets, Docs and Chat through a single Rust-based command line, generating commands dynamically and outputting JSON for scripts and AI agents.

One CLI for the whole Workspace API surface
Google has released an open-source command-line tool, gws, that gives developers a single entry point to the entire Google Workspace API surface, including Drive, Gmail, Calendar, Sheets, Docs, Chat and the Admin APIs. According to a dev.to walkthrough, the tool was released in early 2026 by the Google team and announced by Addy Osmani.
The motivation is familiar to anyone who has scripted against Workspace before. Automating these services normally means configuring OAuth scopes and credentials per service, learning each API's quirks, handling pagination by hand, maintaining several SDKs, and rewriting scripts whenever API methods change. gws collapses that work into one interface, written in Rust, that discovers Workspace API methods at runtime instead of shipping a fixed command catalogue.
Commands generated from Google's Discovery Service
The CLI builds its commands dynamically from Google's Discovery Service, so any method exposed by a Workspace API becomes callable from the shell. The dev.to guide highlights a handful of capabilities that come with this design: JSON output that pipes cleanly into tools such as jq, dry-run support for previewing calls, and pagination helpers.
Alongside the generated commands, gws ships more than forty convenience commands for common tasks. Examples from the walkthrough include sending an email with attachments (gws gmail +send), replying to a message, triaging an inbox, uploading a file to Drive, creating a Calendar event with attendees, printing the day's agenda, appending a row to a Sheet, inserting text into a Doc, and posting to a Chat space.
Pagination is handled with a --page-all flag that fetches every page and emits newline-delimited JSON, which the guide notes suits streaming and processing large result sets.
Installation and authentication
gws requires Node.js 18 or later. The guide describes several installation paths: running it ad hoc with npx (@googleworkspace/cli), installing globally with npm, or pulling prebuilt binaries from GitHub Releases, Homebrew or Nix. Because the npm package bundles prebuilt binaries, there is no need to compile the Rust project locally.
Authentication runs through a guided command, gws auth setup, which opens a browser and handles creating a Google Cloud project if one is needed, enabling the required Workspace APIs, completing the initial OAuth flow and storing credentials in the operating system's keyring, encrypted with AES-256-GCM. Setup applies globally by default, with a --project flag for project-specific configuration. Companion commands cover login, logout and inspecting the current user and granted scopes.
For CI and other headless environments, credentials can be exported to a file and referenced via an environment variable, with the obvious warning to treat the exported file as a secret. The CLI can also reuse an access token printed by gcloud. Anonymous usage telemetry can be switched off with a single environment variable.
Built with AI agents in mind
A notable detail from the dev.to post is that gws ships agent skills for Claude Code, Cursor, OpenClaw and Gemini CLI. The dry-run flag is explicitly useful here: an agent-generated command can be previewed before it touches real Workspace data, and operators can review request payloads before automation runs in CI.
The JSON-first output reinforces this. Whether the consumer is a shell script, a CI pipeline or a coding agent, the tool returns structured data rather than human-formatted text, which removes a layer of brittle parsing from Workspace automation.
Why it matters
Google Workspace is one of the most automated software suites in enterprises, yet its breadth has always worked against scriptability: each service came with its own API shape, SDK and auth friction. gws removes much of that overhead by discovering commands at runtime, wrapping OAuth in a guided flow, and standardising on JSON output with dry-run safety nets.
The agent integrations are arguably the bigger signal. As coding agents take on more operational work, tools that expose large API surfaces through a uniform, machine-friendly command line become the connective tissue between those agents and the software they are asked to operate. If gws matures as described, it could become the default way developers and agents interact with Workspace programmatically, replacing collections of bespoke curl scripts and per-service SDK glue.
The single source for this story is a dev.to walkthrough, so details such as the release timing and feature list reflect that account.
- #google-workspace
- #cli
- #open-source
- #developer-tools
- #automation