cli is a free, open source ai development platforms project written in Rust and released under Apache-2.0. It has 31,034 GitHub stars, 1,840 forks and 131 open issues, and was last pushed 3 days ago. On this registry it ranks #27 of 61 tracked projects in AI Development Platforms, with 5 head-to-head comparisons available. It gained 22 stars over the last 3 tracked days.

What is cli?

What it is

gws is a command-line tool for Google Workspace, written in Rust and released under the Apache-2.0 license. It provides a single interface for Drive, Gmail, Calendar, Sheets, Docs, Chat, Admin, and the wider set of Workspace APIs. Rather than shipping a fixed list of commands, it reads Google's own Discovery Service at runtime and builds its entire command surface dynamically, so new API endpoints and methods appear without a CLI release. The project lives in the Google Workspace ecosystem and is explicitly not an officially supported Google product.

The concrete problem it solves is boilerplate. Calling Workspace REST APIs by hand means writing curl invocations against documentation, handling pagination manually, and parsing responses for whatever consumes them. gws replaces that with --help on every resource, --dry-run to preview a request before it is sent, automatic pagination, and structured JSON output on every response. That last property is what makes it usable by AI agents as well as people: the included agent skills let a language model manage Workspace without custom tooling.

Key capabilities

  • Dynamic command surface generated from Google's Discovery Service at runtime, so new Workspace API methods are picked up automatically.
  • Structured JSON output for every response, suitable for piping into jq or feeding to an agent.
  • --dry-run to preview a request without executing it.
  • Automatic pagination, plus --page-all to stream paginated results as NDJSON.
  • gws schema to introspect the request and response schema of any method, such as drive.files.list.
  • 40+ bundled agent skills, including a Gemini CLI extension.
  • Multiple authentication workflows covering local desktop, CI, and server-to-server use.

Who uses it and how

  • Developers scripting Drive operations, such as listing recent files with gws drive files list --params '{"pageSize": 10}'.
  • Teams creating resources programmatically, for example gws sheets spreadsheets create --json '{"properties": {"title": "Q1 Budget"}}'.
  • Chat automation, such as posting a message to a space with gws chat spaces messages create.
  • AI agents driving Workspace through the bundled skills and JSON responses.
  • CI and server deployments using a pre-obtained access token via GOOGLE_WORKSPACE_CLI_TOKEN, or an existing credentials file via GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE for service-account server-to-server auth.

Getting started

Download a pre-built binary for your OS from GitHub Releases and place it in $PATH, or install with npm install -g @googleworkspace/cli, cargo install --git https://github.com/googleworkspace/cli --locked, brew install googleworkspace-cli, or nix run github:googleworkspace/cli. Then run gws auth setup followed by gws auth login.

When to use it — and when not to

It is a strong fit when the goal is scripted or agent-driven access to Workspace APIs without writing REST boilerplate. A self-hoster must supply a Google Cloud project and OAuth credentials, and on desktop the stored credentials are encrypted at rest with AES-256-GCM using a key held in the OS keyring. The main caveat is maturity: the project is under

project readme (upstream, from github) — read inline

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=
    • Credentials: https://console.cloud.google.com/apis/credentials?project=
  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://gi

readme truncated — read the full docs on github

Frequently asked questions

Is cli free to use?

cli is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does cli do?

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

What is cli written in?

cli is primarily written in Rust. Its source is publicly available at https://github.com/googleworkspace/cli, and it has 31,034 GitHub stars.