googleworkspace/cliPublic

Google Workspace CLI — one command-line tool for Drive, Gmail, Calendar, Sheets, Docs, Chat, Admin, and more. Dynamically built from Google Discovery Service. Includes AI agent skills.

AI summary: The official command-line interface for managing Google Workspace environments.

Stars
30.2K
+31 today
Forks
1.8K
Watchers
94
Open issues
115
Open PRs
12
Contributors
~43
Commits
283
Branches
12

RustApache-2.0Created Mar 2, 2026Last push 6d agoLatest release v0.22.5+170 stars this week+195 this month

Star history

since Mar 1, 2026
010K20K30KMar 2026Apr 2026Jun 2026Aug 2026
30.2K stars as of Aug 7, 2026, tracked back to Mar 1, 2026. Historical curve reconstructed from public GitHub event archives, calibrated to the current total.

Contribution activity

commits per day, last 52 weeks
AugSepOctNovDecJanFebMarAprMayJunJulMonWedFri2025-08-02: 0 commits2025-08-03: 0 commits2025-08-04: 0 commits2025-08-05: 0 commits2025-08-06: 0 commits2025-08-07: 0 commits2025-08-08: 0 commits2025-08-09: 0 commits2025-08-10: 0 commits2025-08-11: 0 commits2025-08-12: 0 commits2025-08-13: 0 commits2025-08-14: 0 commits2025-08-15: 0 commits2025-08-16: 0 commits2025-08-17: 0 commits2025-08-18: 0 commits2025-08-19: 0 commits2025-08-20: 0 commits2025-08-21: 0 commits2025-08-22: 0 commits2025-08-23: 0 commits2025-08-24: 0 commits2025-08-25: 0 commits2025-08-26: 0 commits2025-08-27: 0 commits2025-08-28: 0 commits2025-08-29: 0 commits2025-08-30: 0 commits2025-08-31: 0 commits2025-09-01: 0 commits2025-09-02: 0 commits2025-09-03: 0 commits2025-09-04: 0 commits2025-09-05: 0 commits2025-09-06: 0 commits2025-09-07: 0 commits2025-09-08: 0 commits2025-09-09: 0 commits2025-09-10: 0 commits2025-09-11: 0 commits2025-09-12: 0 commits2025-09-13: 0 commits2025-09-14: 0 commits2025-09-15: 0 commits2025-09-16: 0 commits2025-09-17: 0 commits2025-09-18: 0 commits2025-09-19: 0 commits2025-09-20: 0 commits2025-09-21: 0 commits2025-09-22: 0 commits2025-09-23: 0 commits2025-09-24: 0 commits2025-09-25: 0 commits2025-09-26: 0 commits2025-09-27: 0 commits2025-09-28: 0 commits2025-09-29: 0 commits2025-09-30: 0 commits2025-10-01: 0 commits2025-10-02: 0 commits2025-10-03: 0 commits2025-10-04: 0 commits2025-10-05: 0 commits2025-10-06: 0 commits2025-10-07: 0 commits2025-10-08: 0 commits2025-10-09: 0 commits2025-10-10: 0 commits2025-10-11: 0 commits2025-10-12: 0 commits2025-10-13: 0 commits2025-10-14: 0 commits2025-10-15: 0 commits2025-10-16: 0 commits2025-10-17: 0 commits2025-10-18: 0 commits2025-10-19: 0 commits2025-10-20: 0 commits2025-10-21: 0 commits2025-10-22: 0 commits2025-10-23: 0 commits2025-10-24: 0 commits2025-10-25: 0 commits2025-10-26: 0 commits2025-10-27: 0 commits2025-10-28: 0 commits2025-10-29: 0 commits2025-10-30: 0 commits2025-10-31: 0 commits2025-11-01: 0 commits2025-11-02: 0 commits2025-11-03: 0 commits2025-11-04: 0 commits2025-11-05: 0 commits2025-11-06: 0 commits2025-11-07: 0 commits2025-11-09: 0 commits2025-11-10: 0 commits2025-11-11: 0 commits2025-11-12: 0 commits2025-11-13: 0 commits2025-11-14: 0 commits2025-11-15: 0 commits2025-11-16: 0 commits2025-11-17: 0 commits2025-11-18: 0 commits2025-11-19: 0 commits2025-11-20: 0 commits2025-11-21: 0 commits2025-11-22: 0 commits2025-11-23: 0 commits2025-11-24: 0 commits2025-11-25: 0 commits2025-11-26: 0 commits2025-11-27: 0 commits2025-11-28: 0 commits2025-11-29: 0 commits2025-11-30: 0 commits2025-12-01: 0 commits2025-12-02: 0 commits2025-12-03: 0 commits2025-12-04: 0 commits2025-12-05: 0 commits2025-12-06: 0 commits2025-12-07: 0 commits2025-12-08: 0 commits2025-12-09: 0 commits2025-12-10: 0 commits2025-12-11: 0 commits2025-12-12: 0 commits2025-12-13: 0 commits2025-12-14: 0 commits2025-12-15: 0 commits2025-12-16: 0 commits2025-12-17: 0 commits2025-12-18: 0 commits2025-12-19: 0 commits2025-12-20: 0 commits2025-12-21: 0 commits2025-12-22: 0 commits2025-12-23: 0 commits2025-12-24: 0 commits2025-12-25: 0 commits2025-12-26: 0 commits2025-12-27: 0 commits2025-12-28: 0 commits2025-12-29: 0 commits2025-12-30: 0 commits2025-12-31: 0 commits2026-01-01: 0 commits2026-01-02: 0 commits2026-01-03: 0 commits2026-01-04: 0 commits2026-01-05: 0 commits2026-01-06: 0 commits2026-01-07: 0 commits2026-01-08: 0 commits2026-01-09: 0 commits2026-01-10: 0 commits2026-01-11: 0 commits2026-01-12: 0 commits2026-01-13: 0 commits2026-01-14: 0 commits2026-01-15: 0 commits2026-01-16: 0 commits2026-01-17: 0 commits2026-01-18: 0 commits2026-01-19: 0 commits2026-01-20: 0 commits2026-01-21: 0 commits2026-01-22: 0 commits2026-01-23: 0 commits2026-01-24: 0 commits2026-01-25: 0 commits2026-01-26: 0 commits2026-01-27: 0 commits2026-01-28: 0 commits2026-01-29: 0 commits2026-01-30: 0 commits2026-01-31: 0 commits2026-02-01: 0 commits2026-02-02: 0 commits2026-02-03: 0 commits2026-02-04: 0 commits2026-02-05: 0 commits2026-02-06: 0 commits2026-02-07: 0 commits2026-02-08: 0 commits2026-02-09: 0 commits2026-02-10: 0 commits2026-02-11: 0 commits2026-02-12: 0 commits2026-02-13: 0 commits2026-02-14: 0 commits2026-02-15: 0 commits2026-02-16: 0 commits2026-02-17: 0 commits2026-02-18: 0 commits2026-02-19: 0 commits2026-02-20: 0 commits2026-02-21: 0 commits2026-02-22: 0 commits2026-02-23: 0 commits2026-02-24: 0 commits2026-02-25: 0 commits2026-02-26: 0 commits2026-02-27: 0 commits2026-02-28: 0 commits2026-03-01: 0 commits2026-03-02: 5 commits2026-03-03: 25 commits2026-03-04: 48 commits2026-03-05: 56 commits2026-03-06: 7 commits2026-03-07: 0 commits2026-03-08: 1 commit2026-03-09: 19 commits2026-03-10: 12 commits2026-03-11: 0 commits2026-03-12: 14 commits2026-03-13: 16 commits2026-03-14: 7 commits2026-03-15: 0 commits2026-03-16: 0 commits2026-03-17: 11 commits2026-03-18: 7 commits2026-03-19: 0 commits2026-03-20: 0 commits2026-03-21: 0 commits2026-03-22: 0 commits2026-03-23: 10 commits2026-03-24: 18 commits2026-03-25: 4 commits2026-03-26: 5 commits2026-03-27: 0 commits2026-03-28: 0 commits2026-03-29: 0 commits2026-03-30: 0 commits2026-03-31: 10 commits2026-04-01: 1 commit2026-04-02: 0 commits2026-04-03: 0 commits2026-04-04: 0 commits2026-04-05: 0 commits2026-04-06: 0 commits2026-04-07: 0 commits2026-04-08: 0 commits2026-04-09: 0 commits2026-04-10: 0 commits2026-04-11: 0 commits2026-04-12: 0 commits2026-04-13: 0 commits2026-04-14: 0 commits2026-04-15: 0 commits2026-04-16: 0 commits2026-04-17: 0 commits2026-04-18: 0 commits2026-04-19: 0 commits2026-04-20: 0 commits2026-04-21: 0 commits2026-04-22: 0 commits2026-04-23: 0 commits2026-04-24: 0 commits2026-04-25: 0 commits2026-04-26: 0 commits2026-04-27: 0 commits2026-04-28: 0 commits2026-04-29: 0 commits2026-04-30: 0 commits2026-05-01: 0 commits2026-05-02: 0 commits2026-05-03: 0 commits2026-05-04: 0 commits2026-05-05: 0 commits2026-05-06: 0 commits2026-05-07: 0 commits2026-05-08: 0 commits2026-05-09: 0 commits2026-05-10: 0 commits2026-05-11: 0 commits2026-05-12: 0 commits2026-05-13: 0 commits2026-05-14: 0 commits2026-05-15: 0 commits2026-05-16: 0 commits2026-05-17: 0 commits2026-05-18: 0 commits2026-05-19: 0 commits2026-05-20: 0 commits2026-05-21: 0 commits2026-05-22: 0 commits2026-05-23: 0 commits2026-05-24: 0 commits2026-05-25: 0 commits2026-05-26: 0 commits2026-05-27: 0 commits2026-05-28: 0 commits2026-05-29: 0 commits2026-05-30: 0 commits2026-05-31: 0 commits2026-06-01: 0 commits2026-06-02: 0 commits2026-06-03: 0 commits2026-06-04: 0 commits2026-06-05: 0 commits2026-06-06: 0 commits2026-06-07: 0 commits2026-06-08: 0 commits2026-06-09: 0 commits2026-06-10: 0 commits2026-06-11: 0 commits2026-06-12: 0 commits2026-06-13: 0 commits2026-06-14: 0 commits2026-06-15: 0 commits2026-06-16: 0 commits2026-06-17: 0 commits2026-06-18: 0 commits2026-06-19: 0 commits2026-06-20: 0 commits2026-06-21: 0 commits2026-06-22: 0 commits2026-06-23: 0 commits2026-06-24: 0 commits2026-06-25: 0 commits2026-06-26: 0 commits2026-06-27: 0 commits2026-06-28: 0 commits2026-06-29: 0 commits2026-06-30: 0 commits2026-07-01: 0 commits2026-07-02: 0 commits2026-07-03: 0 commits2026-07-04: 0 commits2026-07-05: 0 commits2026-07-06: 0 commits2026-07-07: 0 commits2026-07-08: 0 commits2026-07-09: 0 commits2026-07-10: 0 commits2026-07-11: 0 commits2026-07-12: 0 commits2026-07-13: 0 commits2026-07-14: 0 commits2026-07-15: 0 commits2026-07-16: 0 commits2026-07-17: 0 commits2026-07-18: 0 commits2026-07-19: 0 commits2026-07-20: 0 commits2026-07-21: 0 commits2026-07-22: 0 commits2026-07-23: 0 commits2026-07-24: 0 commits2026-07-25: 0 commits2026-07-26: 0 commits2026-07-27: 0 commits2026-07-28: 0 commits2026-07-29: 0 commits2026-07-30: 0 commits2026-07-31: 0 commits2026-08-01: 0 commits
276 commits in the last yearLessMore

Signals and awards

derived from tracked data
  • Widely adopted

    30,246 stars

  • Well documented

    High community health score

  • Permissive license

    Apache-2.0

  • Continuous integration

    Automated checks passing

  • Repeat trending

    7 trending appearances

What cli does

The Google Workspace CLI (gws) is a unified command-line tool that enables administrators and developers to manage their Google Workspace environments directly from the terminal. Dynamically built from the Google Discovery Service, it provides comprehensive commands for interacting with core Workspace services, including Drive, Gmail, Calendar, Sheets, Docs, and Admin functionalities. The tool produces structured JSON output and importantly includes over 40+ built-in AI agent skills, allowing autonomous agents to easily interface with Google Workspace without writing custom API integrations.

This CLI is designed for IT administrators, DevOps engineers, and developers managing Google Workspace environments, as well as AI engineers building agents that interact with Workspace apps.

  • Comprehensive Service Coverage: Manage Drive, Gmail, Calendar, Sheets, Chat, and Admin APIs from a single interface.
  • Agent Skills Included: Comes with 40+ built-in agent skills for seamless AI integration.
  • Structured Output: Generates structured JSON output for easy parsing and automation.
  • Dynamic Generation: Commands are dynamically built directly from the Google Discovery Service.
  • Zero Boilerplate: Connects to Workspace APIs immediately without extensive configuration.

Where teams use it

Agentic Workspace Automation

Equipping AI agents with skills to automatically draft emails, schedule calendar events, or organize Drive files.

User Provisioning

Automating the creation, suspension, and deletion of user accounts during employee onboarding and offboarding.

Bulk Resource Management

Scripting the creation and configuration of Google Groups and Calendar resources across a large organization.

Security Auditing

Exporting user permissions, Drive sharing settings, and audit logs to JSON for security compliance checks.

Getting started: npm install -g @googleworkspace/cli

README

main branch

gws

One CLI for all of Google Workspace — built for humans and AI agents.
Drive, Gmail, Calendar, and every Workspace API. Zero boilerplate. Structured JSON output. 40+ agent skills included.

Note

This is not an officially supported Google product.

npm version license CI status install size


⬇️ Download the latest release for your OS

gws doesn't ship a static list of commands. It reads Google's own Discovery Service at runtime and builds its entire command surface dynamically. When Google Workspace adds an API endpoint or method, gws picks it up automatically.

Important

This project is under active development. Expect breaking changes as we march toward v1.0.

Contents

Prerequisites

  • Node.js 18+ — for npm install (or download a pre-built binary from GitHub Releases)
  • A Google Cloud project — required for OAuth credentials. You can create one via the Google Cloud Console or with the gcloud CLI or with the gws auth setup command.
  • A Google account with access to Google Workspace

Installation

The recommended way to install gws is to download the pre-built binary for your OS and architecture from the GitHub Releases page. Extract the archive and place the gws binary in your $PATH.

For convenience, you can also use npm to automate downloading the appropriate binary from GitHub Releases:

npm install -g @googleworkspace/cli

Or build from source:

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

A Nix flake is also available at github:googleworkspace/cli

nix run github:googleworkspace/cli

On macOS and Linux, you can also install via Homebrew:

brew install googleworkspace-cli

Quick Start

gws auth setup     # walks you through Google Cloud project config
gws auth login     # subsequent OAuth login
gws drive files list --params '{"pageSize": 5}'

Why gws?

For humans — stop writing curl calls against REST docs. gws gives you --help on every resource, --dry-run to preview requests, and auto‑pagination.

For AI agents — every response is structured JSON. Pair it with the included agent skills and your LLM can manage Workspace without custom tooling.

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

# 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."}' \
  --dry-run

# Introspect any method's request/response schema
gws schema drive.files.list

# Stream paginated results as NDJSON
gws drive files list --params '{"pageSize": 100}' --page-all | jq -r '.files[].name'

Authentication

The CLI supports multiple auth workflows so it works on your laptop, in CI, and on a server.

Which setup should I use?

I have… Use
gcloud installed and authenticated gws auth setup (fastest)
A GCP project but no gcloud Manual OAuth setup
An existing OAuth access token GOOGLE_WORKSPACE_CLI_TOKEN
Existing Credentials GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE

Interactive (local desktop)

Credentials are encrypted at rest (AES-256-GCM) with the key stored in your OS keyring (or ~/.config/gws/.encryption_key when GOOGLE_WORKSPACE_CLI_KEYRING_BACKEND=file).

gws auth setup       # one-time: creates a Cloud project, enables APIs, logs you in
gws auth login       # subsequent scope selection and login

gws auth setup requires the gcloud CLI. If you don't have gcloud, use the manual setup below instead.

Warning

Scope limits in testing mode: If your OAuth app is unverified (testing mode), Google limits consent to ~25 scopes. The recommended scope preset includes 85+ scopes and will fail for unverified apps (especially for @gmail.com accounts). Choose individual services instead to filter the scope picker:

gws auth login -s drive,gmail,sheets

Manual OAuth setup (Google Cloud Console)

Use this when gws auth setup cannot automate project/client creation, or when you want explicit control.

  1. Open Google Cloud Console in the target project:
    • OAuth consent screen: https://console.cloud.google.com/apis/credentials/consent?project=<PROJECT_ID>
    • Credentials: https://console.cloud.google.com/apis/credentials?project=<PROJECT_ID>
  2. Configure OAuth branding/audience if prompted:
    • App type: External (testing mode is fine)
  3. Add your account under Test users
  4. Create an OAuth client:
    • Type: Desktop app
  5. Download the client JSON and save it to:
    • ~/.config/gws/client_secret.json

Important

You must add yourself as a test user. In the OAuth consent screen, click Test users → Add users and enter your Google account email. Without this, login will fail with a generic "Access blocked" error.

Then run:

gws auth login

Browser-assisted auth (human or agent)

You can complete OAuth either manually or with browser automation.

  • Human flow: run gws auth login, open the printed URL, approve scopes.
  • Agent-assisted flow: the agent opens the URL, selects account, handles consent prompts, and returns control once the localhost callback succeeds.

If consent shows "Google hasn't verified this app" (testing mode), click Continue. If scope checkboxes appear, select required scopes (or Select all) before continuing.

Headless / CI (export flow)

  1. Complete interactive auth on a machine with a browser.
  2. Export credentials:
    gws auth export --unmasked > credentials.json
  3. On the headless machine:
    export GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE=/path/to/credentials.json
    gws drive files list   # just works

Service Account (server-to-server)

Point to your key file; no login needed.

export GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE=/path/to/service-account.json
gws drive files list

Pre-obtained Access Token

Useful when another tool (e.g. gcloud) already mints tokens for your environment.

export GOOGLE_WORKSPACE_CLI_TOKEN=$(gcloud auth print-access-token)

Precedence

Priority Source Set via
1 Access token GOOGLE_WORKSPACE_CLI_TOKEN
2 Credentials file GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE
3 Encrypted credentials gws auth login
4 Plaintext credentials ~/.config/gws/credentials.json

Environment variables can also live in a .env file.

AI Agent Skills

The repo ships 100+ Agent Skills (SKILL.md files) — one for every supported API, plus higher-level helpers for common workflows and 50 curated recipes for Gmail, Drive, Docs, Calendar, and Sheets. See the full Skills Index for the complete list.

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

# Or pick only what you need
npx skills add https://github.com/googleworkspace/cli/tree/main/skills/gws-drive
npx skills add https://github.com/googleworkspace/cli/tree/main/skills/gws-gmail
OpenClaw setup
# Symlink all skills (stays in sync with repo)
ln -s $(pwd)/skills/gws-* ~/.openclaw/skills/

# Or copy specific skills
cp -r skills/gws-drive skills/gws-gmail ~/.openclaw/skills/

The gws-shared skill includes an install block so OpenClaw auto-installs the CLI via npm if gws isn't on PATH.

Gemini CLI Extension

  1. Authenticate the CLI first:

    gws auth setup
  2. Install the extension into the Gemini CLI:

    gemini extensions install https://github.com/googleworkspace/cli

Installing this extension gives your Gemini CLI agent direct access to all gws commands and Google Workspace agent skills. Because gws handles its own authentication securely, you simply need to authenticate your terminal once prior to using the agent, and the extension will automatically inherit your credentials.

Advanced Usage

Multipart Uploads

gws drive files create --json '{"name": "report.pdf"}' --upload ./report.pdf

Pagination

Flag Description Default
--page-all Auto-paginate, one JSON line per page (NDJSON) off
--page-limit <N> Max pages to fetch 10
--page-delay <MS> Delay between pages 100 ms

Google Sheets — Shell Escaping

Sheets ranges use ! which bash interprets as history expansion. Always wrap values in single quotes:

# Read cells A1:C10 from "Sheet1"
gws sheets spreadsheets values get \
  --params '{"spreadsheetId": "SPREADSHEET_ID", "range": "Sheet1!A1:C10"}'

# Append rows
gws sheets spreadsheets values append \
  --params '{"spreadsheetId": "ID", "range": "Sheet1!A1", "valueInputOption": "USER_ENTERED"}' \
  --json '{"values": [["Name", "Score"], ["Alice", 95]]}'

Helper Commands

Some services ship hand-crafted helper commands alongside the auto-generated Discovery surface. Helper commands are prefixed with + so they are visually distinct and never collide with Discovery-generated method names.

Time-aware helpers (+agenda, +standup-report, +weekly-digest, +meeting-prep) automatically use your Google account timezone (fetched from Calendar Settings API and cached for 24 hours). Override with --timezone/--tz on +agenda, or set the --timezone flag for explicit control.

Run gws <service> --help to see both Discovery methods and helper commands together.

gws gmail --help      # shows +send, +reply, +reply-all, +forward, +triage, +watch …
gws calendar --help   # shows +insert, +agenda …
gws drive --help      # shows +upload …

Full helper reference:

Service Command Description
gmail +send Send an email
gmail +reply Reply to a message (handles threading automatically)
gmail +reply-all Reply-all to a message
gmail +forward Forward a message to new recipients
gmail +triage Show unread inbox summary (sender, subject, date)
gmail +watch Watch for new emails and stream them as NDJSON
sheets +append Append a row to a spreadsheet
sheets +read Read values from a spreadsheet
docs +write Append text to a document
chat +send Send a message to a space
drive +upload Upload a file with automatic metadata
calendar +insert Create a new event
calendar +agenda Show upcoming events (uses Google account timezone; override with --timezone)
script +push Replace all files in an Apps Script project with local files
workflow +standup-report Today's meetings + open tasks as a standup summary
workflow +meeting-prep Prepare for your next meeting: agenda, attendees, and linked docs
workflow +email-to-task Convert a Gmail message into a Google Tasks entry
workflow +weekly-digest Weekly summary: this week's meetings + unread email count
workflow +file-announce Announce a Drive file in a Chat space
events +subscribe Subscribe to Workspace events and stream them as NDJSON
events +renew Renew/reactivate Workspace Events subscriptions
modelarmor +sanitize-prompt Sanitize a user prompt through a Model Armor template
modelarmor +sanitize-response Sanitize a model response through a Model Armor template
modelarmor +create-template Create a new Model Armor template

Examples:

# Send an email
gws gmail +send --to alice@example.com --subject "Hello" --body "Hi there"

# Reply to a message
gws gmail +reply --message-id MESSAGE_ID --body "Thanks!"

# Append a row to a spreadsheet
gws sheets +append --spreadsheet SPREADSHEET_ID --values "Alice,95"

# Show today's calendar agenda
gws calendar +agenda

# Upload a file to Drive
gws drive +upload ./report.pdf --name "Q1 Report"

# Morning standup summary
gws workflow +standup-report

# Show today's agenda in a specific timezone
gws calendar +agenda --today --timezone America/New_York

Model Armor (Response Sanitization)

Integrate Google Cloud Model Armor to scan API responses for prompt injection before they reach your agent.

gws gmail users messages get --params '...' \
  --sanitize "projects/P/locations/L/templates/T"
Variable Description
GOOGLE_WORKSPACE_CLI_SANITIZE_TEMPLATE Default Model Armor template
GOOGLE_WORKSPACE_CLI_SANITIZE_MODE warn (default) or block

Environment Variables

All variables are optional. See .env.example for a copy-paste template.

Variable Description
GOOGLE_WORKSPACE_CLI_TOKEN Pre-obtained OAuth2 access token (highest priority)
GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE Path to OAuth credentials JSON (user or service account)
GOOGLE_WORKSPACE_CLI_CLIENT_ID OAuth client ID (alternative to client_secret.json)
GOOGLE_WORKSPACE_CLI_CLIENT_SECRET OAuth client secret (paired with CLIENT_ID)
GOOGLE_WORKSPACE_CLI_CONFIG_DIR Override config directory (default: ~/.config/gws)
GOOGLE_WORKSPACE_CLI_SANITIZE_TEMPLATE Default Model Armor template
GOOGLE_WORKSPACE_CLI_SANITIZE_MODE warn (default) or block
GOOGLE_WORKSPACE_CLI_LOG Log level for stderr (e.g., gws=debug). Off by default.
GOOGLE_WORKSPACE_CLI_LOG_FILE Directory for JSON log files with daily rotation. Off by default.
GOOGLE_WORKSPACE_PROJECT_ID GCP project ID override for quota/billing and fallback for helper commands

Environment variables can also be set in a .env file (loaded via dotenvy).

Exit Codes

gws uses structured exit codes so scripts can branch on the failure type without parsing error output.

Code Meaning Example cause
0 Success Command completed normally
1 API error Google returned a 4xx/5xx response
2 Auth error Credentials missing, expired, or invalid
3 Validation error Bad arguments, unknown service, invalid flag
4 Discovery error Could not fetch the API schema document
5 Internal error Unexpected failure
gws drive files list --params '{"fileId": "bad"}'
echo $?   # 1 — API error

gws unknown-service files list
echo $?   # 3 — validation error (unknown service)

Architecture

gws uses a two-phase parsing strategy:

  1. Read argv[1] to identify the service (e.g. drive)
  2. Fetch the service's Discovery Document (cached 24 h)
  3. Build a clap::Command tree from the document's resources and methods
  4. Re-parse the remaining arguments
  5. Authenticate, build the HTTP request, execute

All output — success, errors, download metadata — is structured JSON.

Troubleshooting

"Access blocked" or 403 during login

Your OAuth app is in testing mode and your account is not listed as a test user.

Fix: Open the OAuth consent screen in your GCP project → Test usersAdd users → enter your Google account email. Then retry gws auth login.

"Google hasn't verified this app"

Expected when your app is in testing mode. Click AdvancedGo to <app name> (unsafe) to proceed. This is safe for personal use; verification is only required to publish the app to other users.

Too many scopes / consent screen error

Unverified (testing mode) apps are limited to ~25 OAuth scopes. The recommended scope preset includes many scopes and will exceed this limit.

Fix: Select only the scopes you need:

gws auth login --scopes drive,gmail,calendar

gcloud CLI not found

gws auth setup requires the gcloud CLI to automate project creation. You have three options:

  1. Install gcloud and use gcloud directly.
  2. Re-run gws auth setup which wraps gcloud calls.
  3. Skip gcloud entirely — set up OAuth credentials manually in the Cloud Console

redirect_uri_mismatch

The OAuth client was not created as a Desktop app type. In the Credentials page, delete the existing client, create a new one with type Desktop app, and download the new JSON.

API not enabled — accessNotConfigured

If a required Google API is not enabled for your GCP project, you will see a 403 error with reason accessNotConfigured:

{
  "error": {
    "code": 403,
    "message": "Gmail API has not been used in project 549352339482 ...",
    "reason": "accessNotConfigured",
    "enable_url": "https://console.developers.google.com/apis/api/gmail.googleapis.com/overview?project=549352339482"
  }
}

gws also prints an actionable hint to stderr:

💡 API not enabled for your GCP project.
   Enable it at: https://console.developers.google.com/apis/api/gmail.googleapis.com/overview?project=549352339482
   After enabling, wait a few seconds and retry your command.

Steps to fix:

  1. Click the enable_url link (or copy it from the enable_url JSON field).
  2. In the GCP Console, click Enable.
  3. Wait ~10 seconds, then retry your gws command.

Tip

You can also run gws auth setup which walks you through enabling all required APIs for your project automatically.

Development

cargo build                       # dev build
cargo clippy -- -D warnings       # lint
cargo test                        # unit tests
./scripts/coverage.sh             # HTML coverage report → target/llvm-cov/html/

License

Apache-2.0

Disclaimer

Caution

This is not an officially supported Google product.

View on GitHub

Recent activity

commits and pull requests

Releases and announcements

44 total
  1. v0.22.5v0.22.5Mar 31, 20261.4M downloads

    ## Installation Download the archive for your OS and architecture from the assets below. ### Linux / macOS Replace `<target>` with your platform (e.g., `aarch64-apple-darwin` or `x86_64-unknown-linux-gnu`). ```bash # 1. Download the archive and its checksum curl -sLO https://github.com/googleworkspace/cli/releases/download/v0.22.5/google-workspace-cli-<target>.tar.gz curl -sLO https://github.com/googleworkspace/cli/releases/download/v0.22.5/google-workspace-cli-<target>.tar.gz.sha256 # 2. Verify the checksum shasum -a 256 -c google-workspace-cli-<target>.tar.gz.sha256 # 3. Extract and install tar -xzf google-workspace-cli-<target>.tar.gz chmod +x gws sudo mv gws /usr/local/bin/ ``` ### Windows 1. Download `google-workspace-cli-x86_64-pc-windows-msvc.zip` and its `.sha256` file 2. Verify the checksum (e.g., using PowerShell `Get-FileHash`) 3. Extract the archive and move `gws.exe` to a directory included in your system `PATH`. --- ## What's Changed * ci: pin cross-rs to v0.2.5 in release workflow by @jpoehnelt in https://github.com/googleworkspace/cli/pull/651 * fix: verify SHA256 checksum in npm postinstall script by @jpoehnelt in https://github.com/googleworkspace/cli/p

  2. v0.22.4v0.22.4Mar 31, 20262.6K downloads

    ## What's Changed * chore: remove cargo-dist, use native fetch for npm installer by @jpoehnelt in https://github.com/googleworkspace/cli/pull/646 * chore: release versions by @googleworkspace-bot in https://github.com/googleworkspace/cli/pull/647 **Full Changelog**: https://github.com/googleworkspace/cli/compare/v0.22.3...v0.22.4

  3. 0.22.3v0.22.3Mar 26, 2026677.1K downloads

    ## Release Notes ### Patch Changes - 674d53a: Fix `Lint Skills` CI job by installing `uv` via `astral-sh/setup-uv` before running `uvx` - c7c42f6: fix: register script service and resolve test path validation errors - 80bd150: feat(auth): use strict OS keychain integration on macOS and Windows Closes #623. The CLI no longer writes a fallback `.encryption_key` text file on macOS and Windows when securely storing credentials. Instead, it strictly uses the native OS keychain (Keychain Access on macOS, Credential Manager on Windows). If an old `.encryption_key` file is found during a successful keychain login, it will be automatically deleted for security. Linux deployments continue to use a seamless file-based fallback by default to ensure maximum compatibility with headless continuous integration (CI) runners, Docker containers, and SSH environments without desktop DBUS services. - ec7f56b: Sync generated skills with latest Google Discovery API specs ## Install google-workspace-cli 0.22.3 ### Install prebuilt binaries via shell script ```sh curl --proto '=https' --tlsv1.2 -LsSf https://github.com/googleworkspace/cli/releases/download/v0.22.3/google-workspace-cli-installer.

  4. 0.22.1v0.22.1Mar 25, 202616K downloads

    ## Release Notes ### Patch Changes - 6a45832: Sync generated skills with latest Google Discovery API specs ## Install google-workspace-cli 0.22.1 ### Install prebuilt binaries via shell script ```sh curl --proto '=https' --tlsv1.2 -LsSf https://github.com/googleworkspace/cli/releases/download/v0.22.1/google-workspace-cli-installer.sh | sh ``` ### Install prebuilt binaries via powershell script ```sh powershell -ExecutionPolicy Bypass -c "irm https://github.com/googleworkspace/cli/releases/download/v0.22.1/google-workspace-cli-installer.ps1 | iex" ``` ### Install prebuilt binaries into your npm project ```sh npm install @googleworkspace/cli@0.22.1 ``` ## Download google-workspace-cli 0.22.1 | File | Platform | Checksum | |--------|----------|----------| | [google-workspace-cli-aarch64-apple-darwin.tar.gz](https://github.com/googleworkspace/cli/releases/download/v0.22.1/google-workspace-cli-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/googleworkspace/cli/releases/download/v0.22.1/google-workspace-cli-aarch64-apple-darwin.tar.gz.sha256) | | [google-workspace-cli-x86_64-apple-darwin.tar.gz](https://github.com/googleworkspace/cli/releas

  5. 0.22.0v0.22.0Mar 24, 20268.4K downloads

    ## Release Notes ### Minor Changes - 0850c48: Add `--draft` flag to Gmail `+send`, `+reply`, `+reply-all`, and `+forward` helpers to save messages as drafts instead of sending them immediately ## Install google-workspace-cli 0.22.0 ### Install prebuilt binaries via shell script ```sh curl --proto '=https' --tlsv1.2 -LsSf https://github.com/googleworkspace/cli/releases/download/v0.22.0/google-workspace-cli-installer.sh | sh ``` ### Install prebuilt binaries via powershell script ```sh powershell -ExecutionPolicy Bypass -c "irm https://github.com/googleworkspace/cli/releases/download/v0.22.0/google-workspace-cli-installer.ps1 | iex" ``` ### Install prebuilt binaries into your npm project ```sh npm install @googleworkspace/cli@0.22.0 ``` ## Download google-workspace-cli 0.22.0 | File | Platform | Checksum | |--------|----------|----------| | [google-workspace-cli-aarch64-apple-darwin.tar.gz](https://github.com/googleworkspace/cli/releases/download/v0.22.0/google-workspace-cli-aarch64-apple-darwin.tar.gz) | Apple Silicon macOS | [checksum](https://github.com/googleworkspace/cli/releases/download/v0.22.0/google-workspace-cli-aarch64-apple-darwin.tar.gz.sha256) | | [google-w

Code frequency

additions and deletions
+39.1K-39.1KWeek of 2026-03-01: +39,109 linesWeek of 2026-03-01: -5,952 linesWeek of 2026-03-08: +9,277 linesWeek of 2026-03-08: -1,734 linesWeek of 2026-03-15: +5,489 linesWeek of 2026-03-15: -2,517 linesWeek of 2026-03-22: +37,153 linesWeek of 2026-03-22: -34,124 linesWeek of 2026-03-29: +1,805 linesWeek of 2026-03-29: -1,417 linesWeek of 2026-04-05: +0 linesWeek of 2026-04-05: -0 linesWeek of 2026-04-12: +0 linesWeek of 2026-04-12: -0 linesWeek of 2026-04-19: +0 linesWeek of 2026-04-19: -0 linesWeek of 2026-04-26: +0 linesWeek of 2026-04-26: -0 linesWeek of 2026-05-03: +0 linesWeek of 2026-05-03: -0 linesWeek of 2026-05-10: +0 linesWeek of 2026-05-10: -0 linesWeek of 2026-05-17: +0 linesWeek of 2026-05-17: -0 linesWeek of 2026-05-24: +0 linesWeek of 2026-05-24: -0 linesWeek of 2026-05-31: +0 linesWeek of 2026-05-31: -0 linesWeek of 2026-06-07: +0 linesWeek of 2026-06-07: -0 linesWeek of 2026-06-14: +0 linesWeek of 2026-06-14: -0 linesWeek of 2026-06-21: +0 linesWeek of 2026-06-21: -0 linesWeek of 2026-06-28: +0 linesWeek of 2026-06-28: -0 linesWeek of 2026-07-05: +0 linesWeek of 2026-07-05: -0 linesWeek of 2026-07-12: +0 linesWeek of 2026-07-12: -0 linesWeek of 2026-07-19: +0 linesWeek of 2026-07-19: -0 linesWeek of 2026-07-26: +0 linesWeek of 2026-07-26: -0 linesMar 1, 2026Jul 26, 2026
+92.8K lines added, -45.7K removed over the last year.

Commits per week

last 52 weeks
1410Week of 2025-08-02: 0 commitsWeek of 2025-08-09: 0 commitsWeek of 2025-08-16: 0 commitsWeek of 2025-08-23: 0 commitsWeek of 2025-08-30: 0 commitsWeek of 2025-09-06: 0 commitsWeek of 2025-09-13: 0 commitsWeek of 2025-09-20: 0 commitsWeek of 2025-09-27: 0 commitsWeek of 2025-10-04: 0 commitsWeek of 2025-10-11: 0 commitsWeek of 2025-10-18: 0 commitsWeek of 2025-10-25: 0 commitsWeek of 2025-11-01: 0 commitsWeek of 2025-11-09: 0 commitsWeek of 2025-11-16: 0 commitsWeek of 2025-11-23: 0 commitsWeek of 2025-11-30: 0 commitsWeek of 2025-12-07: 0 commitsWeek of 2025-12-14: 0 commitsWeek of 2025-12-21: 0 commitsWeek of 2025-12-28: 0 commitsWeek of 2026-01-04: 0 commitsWeek of 2026-01-11: 0 commitsWeek of 2026-01-18: 0 commitsWeek of 2026-01-25: 0 commitsWeek of 2026-02-01: 0 commitsWeek of 2026-02-08: 0 commitsWeek of 2026-02-15: 0 commitsWeek of 2026-02-22: 0 commitsWeek of 2026-03-01: 141 commitsWeek of 2026-03-08: 69 commitsWeek of 2026-03-15: 18 commitsWeek of 2026-03-22: 37 commitsWeek of 2026-03-29: 11 commitsWeek of 2026-04-05: 0 commitsWeek of 2026-04-12: 0 commitsWeek of 2026-04-19: 0 commitsWeek of 2026-04-26: 0 commitsWeek of 2026-05-03: 0 commitsWeek of 2026-05-10: 0 commitsWeek of 2026-05-17: 0 commitsWeek of 2026-05-24: 0 commitsWeek of 2026-05-31: 0 commitsWeek of 2026-06-07: 0 commitsWeek of 2026-06-14: 0 commitsWeek of 2026-06-21: 0 commitsWeek of 2026-06-28: 0 commitsWeek of 2026-07-05: 0 commitsWeek of 2026-07-12: 0 commitsWeek of 2026-07-19: 0 commitsWeek of 2026-07-26: 0 commitsAug 2, 2025Jul 26, 2026
276 commits in the last 52 weeks.

When work happens

weekday and hour
SunMonTueWedThuFriSat036912151821Sun 0:00 — 0 commitsSun 1:00 — 0 commitsSun 2:00 — 0 commitsSun 3:00 — 0 commitsSun 4:00 — 0 commitsSun 5:00 — 0 commitsSun 6:00 — 0 commitsSun 7:00 — 0 commitsSun 8:00 — 0 commitsSun 9:00 — 0 commitsSun 10:00 — 0 commitsSun 11:00 — 0 commitsSun 12:00 — 0 commitsSun 13:00 — 0 commitsSun 14:00 — 0 commitsSun 15:00 — 0 commitsSun 16:00 — 0 commitsSun 17:00 — 0 commitsSun 18:00 — 1 commitsSun 19:00 — 0 commitsSun 20:00 — 0 commitsSun 21:00 — 0 commitsSun 22:00 — 0 commitsSun 23:00 — 0 commitsMon 0:00 — 1 commitsMon 1:00 — 0 commitsMon 2:00 — 0 commitsMon 3:00 — 0 commitsMon 4:00 — 0 commitsMon 5:00 — 0 commitsMon 6:00 — 0 commitsMon 7:00 — 0 commitsMon 8:00 — 0 commitsMon 9:00 — 0 commitsMon 10:00 — 1 commitsMon 11:00 — 5 commitsMon 12:00 — 4 commitsMon 13:00 — 4 commitsMon 14:00 — 2 commitsMon 15:00 — 4 commitsMon 16:00 — 4 commitsMon 17:00 — 5 commitsMon 18:00 — 0 commitsMon 19:00 — 0 commitsMon 20:00 — 1 commitsMon 21:00 — 1 commitsMon 22:00 — 2 commitsMon 23:00 — 1 commitsTue 0:00 — 0 commitsTue 1:00 — 1 commitsTue 2:00 — 0 commitsTue 3:00 — 0 commitsTue 4:00 — 0 commitsTue 5:00 — 0 commitsTue 6:00 — 0 commitsTue 7:00 — 1 commitsTue 8:00 — 0 commitsTue 9:00 — 1 commitsTue 10:00 — 10 commitsTue 11:00 — 14 commitsTue 12:00 — 11 commitsTue 13:00 — 8 commitsTue 14:00 — 9 commitsTue 15:00 — 4 commitsTue 16:00 — 6 commitsTue 17:00 — 3 commitsTue 18:00 — 6 commitsTue 19:00 — 0 commitsTue 20:00 — 0 commitsTue 21:00 — 0 commitsTue 22:00 — 0 commitsTue 23:00 — 3 commitsWed 0:00 — 15 commitsWed 1:00 — 2 commitsWed 2:00 — 1 commitsWed 3:00 — 0 commitsWed 4:00 — 0 commitsWed 5:00 — 0 commitsWed 6:00 — 0 commitsWed 7:00 — 0 commitsWed 8:00 — 2 commitsWed 9:00 — 3 commitsWed 10:00 — 0 commitsWed 11:00 — 4 commitsWed 12:00 — 4 commitsWed 13:00 — 1 commitsWed 14:00 — 4 commitsWed 15:00 — 1 commitsWed 16:00 — 5 commitsWed 17:00 — 1 commitsWed 18:00 — 3 commitsWed 19:00 — 1 commitsWed 20:00 — 3 commitsWed 21:00 — 1 commitsWed 22:00 — 2 commitsWed 23:00 — 7 commitsThu 0:00 — 2 commitsThu 1:00 — 5 commitsThu 2:00 — 2 commitsThu 3:00 — 0 commitsThu 4:00 — 0 commitsThu 5:00 — 0 commitsThu 6:00 — 0 commitsThu 7:00 — 0 commitsThu 8:00 — 2 commitsThu 9:00 — 6 commitsThu 10:00 — 4 commitsThu 11:00 — 1 commitsThu 12:00 — 9 commitsThu 13:00 — 2 commitsThu 14:00 — 8 commitsThu 15:00 — 7 commitsThu 16:00 — 7 commitsThu 17:00 — 5 commitsThu 18:00 — 3 commitsThu 19:00 — 2 commitsThu 20:00 — 3 commitsThu 21:00 — 4 commitsThu 22:00 — 1 commitsThu 23:00 — 2 commitsFri 0:00 — 1 commitsFri 1:00 — 0 commitsFri 2:00 — 0 commitsFri 3:00 — 0 commitsFri 4:00 — 1 commitsFri 5:00 — 3 commitsFri 6:00 — 0 commitsFri 7:00 — 0 commitsFri 8:00 — 1 commitsFri 9:00 — 0 commitsFri 10:00 — 1 commitsFri 11:00 — 0 commitsFri 12:00 — 0 commitsFri 13:00 — 2 commitsFri 14:00 — 2 commitsFri 15:00 — 3 commitsFri 16:00 — 1 commitsFri 17:00 — 2 commitsFri 18:00 — 1 commitsFri 19:00 — 3 commitsFri 20:00 — 2 commitsFri 21:00 — 0 commitsFri 22:00 — 0 commitsFri 23:00 — 0 commitsSat 0:00 — 4 commitsSat 1:00 — 3 commitsSat 2:00 — 0 commitsSat 3:00 — 0 commitsSat 4:00 — 0 commitsSat 5:00 — 0 commitsSat 6:00 — 0 commitsSat 7:00 — 0 commitsSat 8:00 — 0 commitsSat 9:00 — 0 commitsSat 10:00 — 0 commitsSat 11:00 — 0 commitsSat 12:00 — 0 commitsSat 13:00 — 0 commitsSat 14:00 — 0 commitsSat 15:00 — 0 commitsSat 16:00 — 0 commitsSat 17:00 — 0 commitsSat 18:00 — 0 commitsSat 19:00 — 0 commitsSat 20:00 — 0 commitsSat 21:00 — 0 commitsSat 22:00 — 0 commitsSat 23:00 — 0 commits
Commit volume by weekday and hour (UTC). Larger dots mean more commits.
DateListRankStars gained
Mar 11, 2026daily#20+126
Mar 10, 2026daily#17+183
Mar 9, 2026daily#16+189
Mar 8, 2026daily#13+337
Mar 7, 2026daily#7+382
Mar 6, 2026daily#2+582
Mar 5, 2026daily#1+2,345
  • NousResearch/hermes-agent

    The agent that grows with you

    227K stars · Python

  • ultraworkers/claw-code

    An agent-managed museum exhibit, built in Rust with Gajae-Code / LazyCodex — developed and maintained with no human intervention.

    195K stars · Rust

  • ultraworkers/claw-code

    An agent-managed museum exhibit, built in Rust with Gajae-Code / LazyCodex — developed and maintained with no human intervention.

    194.9K stars · Rust

  • ultraworkers/claw-code

    An agent-managed museum exhibit, built in Rust with Gajae-Code / LazyCodex — developed and maintained with no human intervention.

    194.9K stars · Rust

  • yt-dlp/yt-dlp

    A feature-rich command-line audio/video downloader

    183K stars · Python

  • anthropics/skills

    Public repository for Agent Skills

    166.9K stars · Python