ConfigsJun 1, 2026·3 min read

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.

Agent ready

Safe staging for this asset

This asset is staged first. The copied prompt tells the agent to inspect the staged files and ask before activating scripts, MCP config, or global config.

Stage only · 29/100Policy: stage
Agent surface
Any MCP/CLI agent
Kind
CLI Tool
Install
Single
Trust
Trust: Established
Entrypoint
Google Workspace CLI Overview
Safe staging command
npx -y tokrepo@latest install d61973e8-5df6-11f1-9bc6-00163e2b0d79 --target codex

Stages files first; activation requires review of the staged README and plan.

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

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets