Googleworkspace/CLI
Google has launched a unified command-line interface (CLI) for its Workspace services, designed to streamline interaction for both human developers and AI agents. This tool dynamically builds its command set from Google's Discovery Service, ensuring it's always up-to-date with the latest APIs. With integrated AI agent skills and structured JSON output, it offers a powerful way to automate and manage Google Workspace resources programmatically, making it particularly interesting for those exploring AI-driven task automation.
The Lowdown
The Google Workspace CLI, known as gws, is a new command-line tool designed to provide a unified interface for interacting with various Google Workspace services like Drive, Gmail, Calendar, Sheets, and Docs. This project, while noted as not being an officially supported Google product, aims to simplify automation and integration with Workspace APIs for both human users and AI agents.
- Unified Access: Provides a single CLI (
gws) to access all Google Workspace APIs, including Drive, Gmail, Calendar, and more. - Dynamic API Integration: Unlike static CLIs,
gwsdynamically builds its command surface by reading Google's Discovery Service at runtime, ensuring it automatically incorporates new API endpoints and methods. - Designed for Users & AI: Offers features beneficial for human developers, such as tab-completion,
--helpfunctionality,--dry-runpreviews, and auto-pagination. Crucially, it provides structured JSON output and includes over 40 pre-built AI agent skills, enabling Large Language Models (LLMs) to manage Workspace without custom tooling. - Flexible Authentication: Supports multiple authentication workflows, including interactive desktop login, manual OAuth setup, browser-assisted authentication, headless/CI export, service accounts, and pre-obtained access tokens.
- AI Integration: Facilitates direct integration with AI platforms like OpenClaw and Gemini CLI through its agent skills and an extension, allowing AI agents to execute
gwscommands directly. - MCP Server: Can run a Model Context Protocol (MCP) server to expose Workspace APIs as structured tools for MCP-compatible clients, aiding tool discovery for AI.
- Advanced Features: Includes functionalities like multipart uploads, configurable pagination, and integration with Google Cloud Model Armor for response sanitization.
- Architecture: Utilizes a two-phase parsing strategy that dynamically builds command trees from Discovery Documents, ensuring current API compatibility.
The gws CLI represents a powerful attempt to streamline interactions with the extensive Google Workspace ecosystem, particularly emphasizing automation and AI agent capabilities. Its dynamic nature and focus on both developer and AI utility make it a compelling tool for anyone looking to programmatically manage Google Workspace resources.