gws is a community CLI that builds commands from Google API Discovery documents at runtime, returns JSON for scripts and agents, and ships agent skills for Gmail, Drive, Calendar, and more.
Overview
gws (Google Workspace CLI from the googleworkspace/cli project) is a command-line interface for humans and automation that covers Drive, Gmail, Calendar, Chat, Docs, Sheets, and other Workspace APIs without hand-maintaining every method. At startup it reads Google’s Discovery Service for a chosen service, constructs the command tree, authenticates, and emits structured JSON for successes and errors.
Installation options include pre-built binaries per OS, npm-assisted binary download, Homebrew, Nix, or building from source. Authentication supports interactive OAuth with encrypted credential storage, manual consent-screen setup, headless export/import, service accounts, and precedence for pre-supplied tokens or credential files. Helper commands prefixed with plus provide higher-level flows such as sending mail, appending spreadsheet rows, calendar agendas, and cross-app workflows.
Many Agent Skill documents and recipes accompany the project so LLM-based agents can manage Workspace from the same CLI surface. A separate official Google-supported CLI exists; gws remains a community project that continues to operate alongside it. Features include auto-pagination, dry-run previews, multipart uploads, Model Armor sanitization hooks, and documented exit codes for scripting.
For agents, skills map to APIs and curated recipes; Gemini CLI can install an extension that inherits terminal authentication after a one-time gws auth login.
Key features
- Runtime Discovery-driven command surface
- Structured JSON output and exit codes
- OAuth, service account, and token auth
- Plus-prefixed helper workflows
- Auto-pagination and dry-run flags
- Bundled agent skills per API
- Model Armor response sanitization
- OpenClaw auto-install skill block
Use cases
- Scripting Gmail and Calendar from CI
- Agent-driven Workspace administration
- Drive upload and Sheets append automation
- Standup and weekly digest workflows
- Replacing ad hoc REST curl calls