Google Workspace CLI

Active
GitHub Rust Apache-2.0

Description

A unified CLI for Google Workspace covering Drive, Gmail, Calendar, Sheets, Docs and more, with built-in AI agent skills for automation.

Key Features

  • Dynamic command discovery — Reads Google Discovery Service at runtime to auto-build all API commands; new Google endpoints auto-supported
  • 40+ agent skills — Built-in AI agent skills with structured JSON output for LLMs to manage Workspace directly
  • Multiple auth methods — Supports interactive OAuth, Service Account, pre-obtained tokens, CI/headless credential export
  • Unified CLI entry — Single CLI tool manages Drive, Gmail, Calendar, Sheets, Docs, Chat and all Workspace services
  • Schema introspection — View request/response schemas for any API method via gws schema command
  • Auto-pagination — Stream paginated results as NDJSON with --page-all parameter

Use Cases

💡 Automated office workflows — Batch-manage Drive files, send Gmail, update Sheets via CLI scripts
💡 AI Agent Workspace integration — Let LLM agents operate Google Workspace services through gws CLI commands
💡 CI/CD pipeline integration — Automate Workspace operations in GitHub Actions and CI environments using Service Accounts
💡 Data export & analysis — Extract data from Sheets/Docs to JSON/NDJSON for further analysis
💡 Team collaboration automation — Auto-create Calendar events, send Chat messages, manage Drive sharing permissions

Categories

Quick Start

npm install -g @googleworkspace/cli

# First-time auth setup
gws auth setup
gws auth login

# List Drive files
gws drive files list --params '{"pageSize": 5}'

# Create a spreadsheet
gws sheets spreadsheets create --json '{"properties": {"title": "Q1 Budget"}}'

# Send a Chat message
gws chat spaces messages create \
  --params '{"parent": "spaces/xyz"}' \
  --json '{"text": "Deploy complete."}'

Related Projects