How Google’s New Workspace CLI Turns Cloud APIs into AI‑Ready Commands
Google recently open‑sourced a Workspace CLI that unifies Drive, Gmail, Calendar and other APIs into a single command‑line tool, offers structured JSON output for AI agents, provides built‑in Agent Skills, and includes detailed installation instructions, while warning that it lacks official Google support.
Overview
Google has released an open‑source command‑line interface (CLI) for Google Workspace, hosted at https://github.com/googleworkspace/cli. The CLI wraps Drive, Gmail, Calendar and other Workspace APIs into a single command‑line tool and emits all responses as structured JSON, which can be consumed directly by AI agents.
Key Features
Human developers can explore commands with --help and preview requests with --dry-run without writing raw curl calls.
All output—including successful results, error messages and download metadata—is JSON‑encoded.
More than 100 built‑in Agent Skills are provided (see SKILL.md), covering Gmail, Drive, Docs, Calendar, Sheets and higher‑level workflow helpers.
Architecture – Two‑Phase Parsing
The CLI parses arguments in two stages:
Read the first argument ( argv[1]) to identify the target service (e.g., drive).
Fetch and cache the service’s Discovery Document for 24 hours.
Generate a clap::Command tree from the resources and methods defined in the document.
Re‑parse the remaining command‑line arguments against the generated tree.
Perform authentication, build the HTTP request, and execute it.
Agent Skills Integration
The CLI ships with a skills.md file that lists over 100 skills. Each supported API endpoint maps to a skill, and additional high‑level skills simplify common workflows. Example skill usage is provided for Gmail, Drive, Docs, Calendar and Sheets.
Installation
Requirements
Node.js 18 or newer (the npm package includes pre‑compiled binaries for all major OS/architectures, so no Rust toolchain is needed).
A Google Cloud project to obtain OAuth credentials (create via Cloud Console, gcloud, or gws auth setup).
A Google account with Workspace access.
Installation via npm npm install -g @googleworkspace/cli Alternatively, download a compiled binary from the GitHub Releases page, or build from source. A Nix flake is available at github:googleworkspace/cli.
OpenClaw Integration
OpenClaw can automatically install the CLI via npm if it is not found in PATH. The integration uses the built‑in Agent Skills to allow an LLM to manage Google Workspace without writing additional tooling.
Disclaimer
Although the project originates from Google and its main contributors work at Google, the CLI is not an official Google product and receives no official support. Users assume all risk, and any copyright or patent concerns should be reported for removal.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
