Skip to main content
skill CX Codex

google-workspace · swarmclawai — Claude Code skill: Drive, Docs, Sheets, Gmail

Teaches an agent to drive Google Workspace through the gws CLI: Drive files, docs, spreadsheets, mail, calendar and chat. Useful when a task touches a real Google account.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add swarmclawai/swarmclaw --skill google-workspace -a claude-code
Open on GitHub

What google-workspace does

The skill tells the agent to reach for gws instead of hand-rolled HTTP calls against Workspace APIs. The CLI already knows the API surface and hands back structured JSON, which is easier to parse. Inside are rules plus command examples: gws doctor to check the install, gws help for a resource, then docs get, drive files list, sheets spreadsheets get, gmail users messages list, calendar events list, chat spaces messages list.

The order of operations is fixed. Read and list first, mutate later. Confirm the identifiers — document, spreadsheet, file, message, calendar, space — before anything changes. When a command fails on a missing ID, the skill says to fall back to a list or search call and locate it. Large listings get narrowed before paging.

The catch: gws has to be installed and authorised ahead of time. The skill forbids running an interactive login from a tool call. With no working auth, the agent will only report that the plugin settings need configuring or that you should log in manually from a terminal. In SwarmClaw the subcommand goes into args, flags into params, JSON payloads into jsonInput; dryRun: true covers risky mutations and pageAll: true pulls every page.

What it helps with

  • locate a Drive file by name and return its ID
  • pull the text out of a Google Doc
  • export rows from a Google Sheet
  • scan a Gmail inbox for specific messages
  • check what is on the calendar for a date range

Example prompts for the agent

  • Run gws doctor and tell me whether the CLI is set up
  • Find the quarterly report in Drive and give me its file ID
  • List my last 10 Gmail messages and flag any that look like invoices

How to install google-workspace

1Skills CLI (Vercel)

npx skills add swarmclawai/swarmclaw --skill google-workspace -a claude-code

2Manually: put the files in place

~/.claude/skills/google-workspace/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/google-workspace/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about google-workspace

How do I install google-workspace in Claude Code?

Run npx skills add swarmclawai/swarmclaw --skill google-workspace -a claude-code. The skill lands at ~/.claude/skills/google-workspace/SKILL.md.

What does google-workspace do?

It gives the agent a working procedure for Google Workspace tasks via the gws CLI — Drive, Docs, Sheets, Gmail, Calendar, Chat. It sets command order, ID handling and JSON parsing.

What does the skill need to work?

An installed gws binary and valid authorisation. Interactive login from a tool call is off the table, so sign in from a terminal or through the plugin settings first.

Source text

SKILL.md · MIT
---
name: google-workspace
description: Use Google Workspace CLI (`gws`) for Drive, Docs, Sheets, Gmail, Calendar, Chat, and related Workspace API tasks.
homepage: https://github.com/googleworkspace/cli
metadata:
  openclaw:
    toolNames: [google_workspace, gws]
    capabilities: [google-workspace, google-docs, google-drive, google-sheets, gmail, google-calendar, google-chat]
    requires:
      bins: [gws]
---

# Google Workspace CLI

Use `gws` when the task is about Google Workspace resources or Google Workspace API automation.

Prefer `gws` over generic HTTP calls when possible because it already knows the Workspace API surface and returns structured JSON by default.

## Rules

1. Start with read/list/get commands before mutating Workspace state.
2. Confirm IDs first: document IDs, spreadsheet IDs, file IDs, message IDs, calendar IDs, space IDs.
3. Do not run interactive auth flows from an agent tool call. If auth is missing, report that `gws` needs to be configured in plugin settings or via a manual terminal login.
4. Keep commands machine-readable. Prefer JSON output and parse it instead of scraping human text.
5. For large list operations, limit the scope first, then page or filter.

## Common Commands

Check installation and health:

```bash
gws doctor
```

Inspect help for a resource or method:

```bash
gws help
gws drive help
gws drive files help
```

Google Docs:

```bash
gws docs get --document-id <DOC_ID>
```

Google Drive:

```bash
gws drive files list --params '{"pageSize":10}'
gws drive files get --file-id <FILE_ID>
```

Google Sheets:

```bash
gws sheets spreadsheets get --spreadsheet-id <SPREADSHEET_ID>
```

Gmail:

```bash
gws gmail users messages list --user-id me --params '{"maxResults":10}'
gws gmail users messages get --user-id me --message-id <MESSAGE_ID>
```

Google Calendar:

```bash
gws calendar events list --calendar-id primary --params '{"maxResults":10,"singleEvents":true}'
```

Google Chat:

```bash
gws chat spaces messages list --parent spaces/<SPACE_ID>
```

## Tool Usage In SwarmClaw

When using the `google_workspace` tool:

- Put the `gws` command after the binary into `args`, for example:
  `{"args":["drive","files","list"],"params":{"pageSize":5}}`
- Use `params` for `--params`
- Use `jsonInput` for `--json`
- Use `pageAll: true` when you intentionally want all pages
- Use `dryRun: true` before risky mutations if you are unsure

## Error Handling

- If `gws` is missing: tell the user to install Google Workspace CLI.
- If auth is missing or expired: tell the user to configure the plugin settings or authenticate `gws` manually.
- If a command fails because an ID is missing: switch to a list/search command first and find the right ID.

© swarmclawai · MIT · swarmclawai/swarmclaw

Similar skills

All skills for Automation and no-code: n8n, Zapier, Make →

google-workspace by other authors comes first.

From the same set4

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor