# Google Workspace CLI — One Command-Line Tool for Drive, Gmail, Sheets, and More > An official Rust CLI from Google that provides unified access to Google Workspace APIs including Drive, Gmail, Calendar, Sheets, Docs, Chat, and Admin. ## Install Save in your project root: # Google Workspace CLI — One Command-Line Tool for Drive, Gmail, Sheets, and More ## Quick Use ```bash cargo install gw-cli gw auth login gw drive ls gw gmail send --to user@example.com --subject "Hello" --body "Test" ``` ## Introduction Google Workspace CLI is an official command-line tool from Google, written in Rust, that provides unified terminal access to the full suite of Google Workspace APIs. Instead of juggling multiple tools or writing custom scripts for each service, you get one binary that handles Drive, Gmail, Calendar, Sheets, Docs, Chat, and Admin. ## What Google Workspace CLI Does - Manages Google Drive files: list, upload, download, share, and organize - Sends and reads Gmail messages from the terminal - Interacts with Google Calendar events, Sheets data, and Docs content - Provides Admin SDK access for Workspace domain administration - Dynamically generates commands from the Google Discovery Service ## Architecture Overview The CLI is built in Rust and dynamically constructs its command tree from the Google Discovery Service at build time, ensuring complete API coverage without manual endpoint mapping. Authentication uses OAuth 2.0 with a local credential cache. Each subcommand maps to a Workspace API call, and responses are formatted as JSON or human-readable tables. The tool includes AI agent skills so it can be used programmatically by coding agents. ## Self-Hosting & Configuration - Install via cargo or download a prebuilt binary from GitHub Releases - Authenticate with `gw auth login` which opens a browser OAuth flow - Credentials are stored locally in `~/.config/gw-cli/` - Configure default output format (JSON or table) in settings - Supports service account authentication for automated workflows ## Key Features - Single binary covering all major Google Workspace APIs - Dynamic command generation from Google Discovery Service ensures completeness - Built in Rust for fast startup and low resource usage - AI agent skill integration for use with coding assistants - Service account support for CI/CD and automation pipelines ## Comparison with Similar Tools - **gcloud CLI** — covers Google Cloud Platform, not Workspace apps; this tool focuses on Workspace - **GAM** — popular Python tool for Google Workspace admin; GW CLI covers admin plus user-facing apps - **Google APIs Explorer** — web-based API testing; GW CLI is a terminal-native tool - **gsutil** — Google Cloud Storage tool; GW CLI handles Drive, Gmail, Calendar, and more ## FAQ **Q: Is this an official Google project?** A: Yes. The repository is under the googleworkspace GitHub organization. **Q: Does it work with personal Google accounts?** A: It is designed for Google Workspace accounts, but some APIs also work with personal accounts. **Q: Can AI coding agents use this tool?** A: Yes. It includes agent skill definitions and outputs structured JSON for programmatic use. **Q: How does it handle rate limits?** A: The CLI respects Google API quotas and implements automatic retry with exponential backoff. ## Sources - https://github.com/googleworkspace/cli --- Source: https://tokrepo.com/en/workflows/asset-d61973e8 Author: AI Open Source