Skip to content

Guide · Agent skill

How to use the Google Workspace CLI Admin agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

This guide explains how to install and use the google-workspace-cli agent skill, a playbook that lets an AI agent help you run Google Workspace administration through the open-source gws command-line tool. It is aimed at admins, developers and operations staff who repeat the same Gmail, Drive or Calendar tasks. By the end you will know what the skill does, how to install it, how to phrase requests so the agent uses it, and what to check before running any command it produces.

Google Workspace CLI Adminalirezarezvani/claude-skills · MIT

Quick start

  1. 1Download and unzip the skill. Download the ZIP from this page and unzip it so SKILL.md sits in ~/.claude/skills/google-workspace-cli/ or a project's .claude/skills/ folder.
  2. 2Install the gws CLI. Run npm install -g @googleworkspace/cli (Node.js 18+ required), or use Homebrew or Cargo as described in the skill.
  3. 3Create OAuth credentials. Run python3 scripts/auth_setup_guide.py --guide oauth to see how to set up a Google Cloud project with an OAuth client ID and secret.
  4. 4Sign in with limited scopes. Run gws auth setup, then gws auth login -s with only the services you need, such as drive,gmail,sheets.
  5. 5Run the doctor check. Run python3 scripts/gws_doctor.py to confirm the PATH, version, authentication and connectivity.
  6. 6Ask the agent for a task. Describe the task in plain language and review the command it proposes, including any marked for verification, before running it.

What is an agent skill and what does this one do?

An agent skill is a folder with a SKILL.md file and supporting files that an AI agent loads when your request matches the skill's description. This skill gives the agent guidance for Google Workspace administration using the gws CLI (github.com/googleworkspace/cli, Apache-2.0 licensed).

Once installed, the agent can guide you through installing and signing in to gws, run helper scripts that check your setup, and draft or run commands to send email, search Gmail, manage Drive files and sharing, read or write Sheets, and schedule Calendar events. It also includes a local catalog of recipe templates, persona bundles and a script that audits Workspace settings.

  • Gmail: send, reply, forward, search and label messages
  • Drive and Sheets: list, upload, create and share files; read and append sheet data
  • Calendar: create events, list upcoming events, check free/busy time
  • Security: run a Workspace audit and get remediation commands

Install the skill from the ZIP

Download the ZIP for this skill from the page where you found this guide. Unzip it so that the folder containing SKILL.md sits in one of these locations:

For personal use across projects, put it in ~/.claude/skills/. For a single project, put it in that project's .claude/skills/ folder. Alternatively, in the Claude apps, open Settings, go to Capabilities, and upload the skill under Skills.

  • Personal: ~/.claude/skills/google-workspace-cli/
  • Project: .claude/skills/google-workspace-cli/ inside your project
  • Claude apps: Settings → Capabilities → Skills, then upload

Install the gws CLI and sign in

The skill does not replace the gws tool, so install it separately. The source lists three options. The npm route is recommended and needs Node.js 18+. Homebrew works on macOS and Linux, and Cargo builds from source. Pre-built binaries are also available on the releases page.

Sign-in needs a Google Cloud project with OAuth credentials (a client ID and secret) or a service account. Run the bundled guide to walk through creating them, then run the interactive setup and request only the scopes you need.

  • Install with npm: npm install -g @googleworkspace/cli
  • Check the install: gws --version
  • Get OAuth setup instructions: python3 scripts/auth_setup_guide.py --guide oauth
  • Run interactive setup: gws auth setup
  • Log in with limited scopes: gws auth login -s drive,gmail,sheets
npm install -g @googleworkspace/cli gws --version python3 scripts/auth_setup_guide.py --guide oauth gws auth setup gws auth login -s drive,gmail,sheets

Check your setup with the doctor script

Ask the agent to check your installation, or run the doctor script yourself. It checks the PATH, the gws version, authentication status and service connectivity. Python 3 is needed to run the bundled scripts.

For headless or CI machines, the source describes exporting credentials from an interactive machine and pointing the CLI at the file with an environment variable. Validate authentication with the auth guide script, which tests each service endpoint.

python3 scripts/gws_doctor.py python3 scripts/auth_setup_guide.py --validate --json

Trigger the skill with natural requests

You do not need to type script names. Describe the task in plain language and mention Google Workspace or gws. The skill's description matches requests about Workspace admin, gws CLI setup, Gmail automation, Drive management and Calendar scheduling.

Good requests name the service, the action and the scope. For example, ask the agent to check whether gws is installed and signed in, or to draft a command that lists Drive files and formats the output as a table. Expect the agent to show commands for your review and to flag ones it has not verified.

  • Set up gws on this machine and check that authentication works
  • Draft a command to find Gmail messages from a client sent after 1 January 2025
  • Schedule a team sync on Calendar next Tuesday; show me the command first
  • Audit my Workspace security settings and list the findings

Review commands before you run them

The source is explicit that gws builds its commands at runtime from Google's API discovery documents and that the CLI is pre-v1.0. Many commands in the skill are marked (verify). Before putting a command into automation, confirm its exact surface with gws --help, gws <service> --help or gws schema <service>.<resource>.<method>.

Bulk actions deserve extra care. The source recommends --dry-run before bulk operations and --page-all to paginate. Sharing and archive commands can change real data, so review who or what they affect first.

  • Check syntax: gws gmail users messages list --help or gws schema gmail.users.messages.modify
  • Use --dry-run first for bulk Gmail or Drive changes
  • Test on a non-critical account or a small set of items before scaling
gws schema gmail.users.messages.modify gws --help

Safety notes: scripts and network access

This skill runs scripts and uses the network. The bundled Python scripts (gws_doctor.py, auth_setup_guide.py, gws_recipe_runner.py, output_analyzer.py and workspace_audit.py) run on your machine, and the gws commands call Google's APIs using the OAuth credentials you set up. Read the scripts and the commands before running them, particularly on accounts that hold sensitive mail or organisation-wide sharing.

Credentials are sensitive. The export command writes a credentials file in plain form when used with --unmasked, so store it securely and avoid committing it to version control.

  • Scripts run locally with Python 3
  • Network calls go to Google services through your own OAuth client or service account
  • Keep credentials.json out of shared folders and repositories

What people use it for

  • Set up gws and OAuth credentials on a new admin workstation
  • Draft Gmail commands to search for messages from a client and check labels
  • Share a Drive file with a colleague and list who has access, after checking the permissions schema
  • Read or append rows in a Google Sheet as part of a reporting routine
  • Create Calendar events or check free/busy times before scheduling a meeting
  • Run a Workspace security audit and review the remediation commands it suggests

Frequently asked questions

Is the Google Workspace CLI agent skill free?

The skill is published under the MIT licence. The gws CLI it uses is open source under Apache-2.0, according to the source. Google Workspace accounts and Google Cloud projects are separate and may have their own costs, which this source does not cover.

What do I need to use this skill?

You need Node.js 18+, Homebrew or Cargo to install gws, and Python 3 to run the bundled scripts. You also need a Google Cloud project with an OAuth client ID and secret, or a service account, and a Google Workspace or Google account with access to the APIs you plan to use.

How do I install the google-workspace-cli skill?

Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use or a project's .claude/skills/ folder. You can also upload it in the Claude apps under Settings, then Capabilities, then Skills.

Why do some commands say verify?

The gws CLI is pre-v1.0 and builds its commands at runtime from Google's API discovery documents. The skill marks commands that must be checked against your installed version with gws --help or gws schema before use.

Is this safe to run on a live Workspace account?

Use caution. The skill runs local scripts and makes network calls, and bulk archive or permission commands can change real data. Use --dry-run first, test on a small set of items, and review who a sharing command affects.

How does this compare to using gws directly?

The skill adds guidance, local helper scripts, a recipe catalog and an audit script on top of the gws CLI. You still need the gws tool and its credentials. Without an agent, you would run the gws commands and scripts yourself.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits admins and developers who manage Google Workspace and want an agent to help set up gws and draft routine Gmail, Drive and Calendar commands. It is a poor fit for anyone who wants a hands-off tool, works on sensitive mailboxes or organisation-wide sharing without review, or cannot use a terminal and Google Cloud project for OAuth setup.

Download the skill