Google Workspace CLI

Google Workspace CLI

One CLI for all of Google Workspace

Description

Getting Claude Code to skim your own Gmail or append a row to a spreadsheet used to mean stitching curl calls together from REST docs, then handling OAuth, pagination and error parsing yourself before any real work happened. Google Workspace CLI (the gws command) folds all of that into a single terminal tool: Drive, Gmail, Calendar, Sheets, Docs, Chat and Admin share one command style, and every response comes back as structured JSON that a person can read and an AI agent can pick up directly.

The clever part is that no command is hard-coded. At runtime gws reads Google's own Discovery Service and builds its whole command tree from the API description, so when Workspace gains a new endpoint you can call it without waiting for a release. The repo also ships more than a hundred Agent Skills you can drop into Claude Code, Gemini CLI and similar agents so they know how to work your inbox and Drive properly.

Worth knowing: gws itself is a community project. Google has since released the officially supported gwscli, built for agents, with a personal mode that creates an OAuth client tied only to your own account and skips consent screen setup and app verification, and sensitive actions such as sending mail, sharing externally or deleting pause for your approval. The README includes a command map for moving from gws, so you can pick whichever fits.

Features



Commands built on the fly: reads Discovery documents (cached for 24 hours) to cover every Workspace API method, and new endpoints work automatically.

Structured JSON output: results, errors and download metadata are all JSON, ready to pipe into jq, so neither scripts nor agents have to scrape text.

Helper shortcuts: hand-written commands prefixed with + cover the frequent jobs, like gmail +send, +triage for an unread summary, calendar +agenda for today's schedule and workflow +standup-report for a ready-made standup.

Agent Skills included: one SKILL.md per API plus 50 ready recipes for Gmail, Drive, Calendar and Sheets, installed with a single npx skills add, or as a Gemini CLI extension.

Auto-pagination and dry runs: --page-all walks every page and streams NDJSON, --dry-run shows the request before it is sent, and every resource has --help.

Flexible sign-in: interactive login on your laptop, exported credentials for headless servers and CI, service account keys, or a pre-minted access token; stored credentials are encrypted with AES-256-GCM and the key lives in your OS keyring.

Prompt injection screening: plug in Google Cloud Model Armor to scan API responses before they reach your agent, in warn or block mode.

Meaningful exit codes: API errors, auth failures, bad arguments and Discovery fetch failures each get their own code, so scripts can branch without parsing messages.

Easy install: a single Rust binary from Releases, or via npm, Homebrew, cargo or Nix, on Windows, macOS and Linux.