← Back to Discover

Google Workspace CLI

An open source command-line tool that reaches Google Workspace services such as Drive, Gmail, Calendar, Sheets, Docs and Chat, with JSON output and agent skills for AI agents.

Command-line toolsWorkflow automation

What it does

gws is a single command-line tool for Google Workspace, built for people and for AI agents. It does not ship a fixed command list. At runtime it reads Google's Discovery Service and builds its commands from it, so new API methods appear automatically. The project says it is not an officially supported Google product and is under active development, with breaking changes expected before v1.0. Every response is structured JSON, and options include --dry-run to preview requests, auto-pagination and schema introspection. Helper commands, marked with a plus sign, cover tasks such as sending or triaging Gmail, appending rows to a sheet, showing a calendar agenda, uploading to Drive and workflow summaries like a standup report. For agents, the repository includes Agent Skills as SKILL.md files for each supported API, helper workflows and curated recipes, and it can be installed as a Gemini CLI extension. An optional Model Armor integration can scan responses for prompt injection before they reach an agent. Authentication supports OAuth login, service accounts, existing tokens and credentials exported for headless machines, and stored credentials are encrypted at rest. Setup needs a Google Cloud project for OAuth credentials and a Google account with Workspace access. It installs from prebuilt binaries, npm, cargo, Nix or Homebrew, and is licensed Apache-2.0.

Capabilities

  • Commands generated at runtime from Google's Discovery Service
  • Structured JSON output with --dry-run and auto-pagination
  • Helper commands for Gmail, Sheets, Calendar, Drive, Docs and Chat
  • Agent Skills and recipes for AI agents
  • Gemini CLI extension
  • Optional Model Armor prompt-injection scanning of responses

When to use it

  • You want to script Google Workspace from the terminal or CI
  • You want an AI agent to manage Drive, Gmail, Calendar or Sheets through a single tool
  • You prefer not to hand-write REST calls against the Workspace APIs