Google Workspace CLI: Ultimate gws Tool

Google Workspace CLI: The Ultimate gws Command-Line Tool

Google has unleashed a game-changer for Workspace power users and AI developers: gws - a single CLI that unlocks every Google Workspace API with zero boilerplate. From Drive files to Gmail automation, Calendar events to Sheets manipulation, this Rust-powered beast handles it all.

πŸš€ Why gws Changes Everything

Unlike traditional API clients with static command lists, gws reads Google's Discovery Service at runtime and dynamically builds its entire command surface. When Google adds new API endpoints, gws picks them up automatically. No more digging through REST docs or writing curl nightmares.

Key Features: - Drive, Gmail, Calendar, Sheets, Chat, Admin - all Workspace APIs - Structured JSON output perfect for AI agents and scripting - 40+ built-in agent skills for common workflows - Auto-pagination, dry-run, schema introspection - Cross-platform binaries via npm (no Rust toolchain needed)

🎯 Quick Start (2 minutes)

# Install globally
npm install -g @googleworkspace/cli

# Setup authentication
gws auth setup

gws auth login

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

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

πŸ€– Built for AI Agents

gws ships with 100+ Agent Skills (SKILL.md files) covering every API plus Gmail recipes, Drive automation, and more. Pair it with your LLM for autonomous Workspace management:

# Install all skills
npx skills add https://github.com/googleworkspace/cli

# Gemini CLI extension
gemini extensions install https://github.com/googleworkspace/cli

πŸ” Multiple Auth Workflows

  • Interactive: gws auth login (encrypted credentials)
  • Headless/CI: Export credentials from interactive session
  • Service Accounts: Point to JSON key file
  • gcloud: GOOGLE_WORKSPACE_CLI_TOKEN=$(gcloud auth print-access-token)

πŸ’Ž Pro Tips

# Stream all files as NDJSON
gws drive files list --page-all | jq -r '.files[].name'

# Dry-run Chat message
gws chat spaces messages create --dry-run

# Introspect any method schema
gws schema drive.files.list

# Model Armor integration for secure agents
gws gmail users messages get --sanitize "projects/P/locations/L/templates/T"

πŸ“¦ Installation Options

# npm (recommended - includes binaries)
npm install -g @googleworkspace/cli

# Cargo
cargo install --git https://github.com/googleworkspace/cli --locked

# Nix
nix run github:googleworkspace/cli

⚠️ Important Notes

  • Actively developed - expect breaking changes toward v1.0
  • Not officially supported by Google (but from googleworkspace org)
  • 17.9k stars, 32 contributors, Apache-2.0 licensed

gws isn't just a CLI - it's the future of Google Workspace automation for humans AND AI agents. Install it today and say goodbye to API documentation hunting forever.

⭐ Star on GitHub | πŸ“¦ npm

Original Article: View Original

Share this article