agentleFS
mgonzalezbailemgonzalezbaile/personal-assistant/.claude/skills/google-workspace-cli/SKILL.md

google-workspace-cli

Skill8 starsChanged 5 months agoMITView on GitHub

Use when the user mentions Google Drive, Google Docs, Sheets, Slides, Gmail, Calendar, Google files, shared drives, or wants to search, read, create, or edit any Google Workspace content. Accesses Google Workspace via the `gws` CLI.

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always use the Shell tool to execute gws commands.

    line 252
  2. Very specific:

    Use --dry-run before write operations to preview what will be sent.

    line 255
  3. Very specific:

    Use gws <service> <resource> --help to discover available methods for any API.

    line 256
  4. Very specific:

    Use gws schema <service>.<resource>.<method> to inspect the full API schema for a method.

    line 257

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Google Workspace CLI (gws)

The gws CLI is installed globally and authenticated with the user's Google Workspace account. Use it via the Shell tool to interact with Google Drive, Docs, Sheets, Slides, Gmail, and Calendar.

Command Pattern

gws <service> <resource> <method> [flags]

Common Flags

FlagPurpose
--params '{...}'Query/path parameters as JSON
--json '{...}'Request body as JSON
--dry-runValidate without sending
--page-allFetch all pages (NDJSON output)
--page-limit NLimit pages fetched (default: 10)
--format tableOutput as table (also: json, yaml, csv)
--upload ./fileUpload file with multipart request

Drive

Search files

gws drive files list --params '{"q": "name contains '\''quarterly report'\''", "pageSize": 10}'

List recent files

gws drive files list --params '{"pageSize": 10, "orderBy": "modifiedTime desc"}'

List files in a folder

gws drive files list --params '{"q": "'\''FOLDER_ID'\'' in parents"}'

List shared drives

gws drive drives list

Get file metadata

gws drive files get --params '{"fileId": "FILE_ID"}'

Upload a file

gws drive +upload ./report.pdf --parent FOLDER_ID

Export Google Workspace files

# Doc as PDF
gws drive files export --params '{"fileId": "FILE_ID", "mimeType": "application/pdf"}' > doc.pdf

# Sheet as CSV
gws drive files export --params '{"fileId": "FILE_ID", "mimeType": "text/csv"}' > data.csv

Advanced search queries

The q parameter supports operators:

QueryExample
By namename contains 'budget'
By typemimeType = 'application/vnd.google-apps.document'
By owner'user@example.com' in owners
Shared with mesharedWithMe
Starredstarred = true
Modified aftermodifiedTime > '2026-01-01T00:00:00'
Combinedname contains 'budget' and mimeType = 'application/pdf'

MIME types for Google Workspace files:

TypeMIME
Documentapplication/vnd.google-apps.document
Spreadsheetapplication/vnd.google-apps.spreadsheet
Presentationapplication/vnd.google-apps.presentation
Folderapplication/vnd.google-apps.folder
Formapplication/vnd.google-apps.form

Docs

Read a document

gws docs documents get --params '{"documentId": "DOCUMENT_ID"}'

The response contains the full document structure with text content in body.content[].paragraph.elements[].textRun.content.

Create a document

gws docs documents create --json '{"title": "Meeting Notes"}'

Append text (helper)

gws docs +write --document DOCUMENT_ID --text 'Hello, world!'

Batch update (insert, format, replace)

gws docs documents batchUpdate --params '{"documentId": "DOCUMENT_ID"}' --json '{
  "requests": [
    {"insertText": {"location": {"index": 1}, "text": "New heading\n"}},
    {"updateTextStyle": {"range": {"startIndex": 1, "endIndex": 12}, "textStyle": {"bold": true}, "fields": "bold"}}
  ]
}'

Replace text

gws docs documents batchUpdate --params '{"documentId": "DOCUMENT_ID"}' --json '{
  "requests": [{"replaceAllText": {"containsText": {"text": "OLD", "matchCase": true}, "replaceText": "NEW"}}]
}'

Sheets

Read values

gws sheets +read --spreadsheet SPREADSHEET_ID --range 'Sheet1!A1:B10'

Read full sheet

gws sheets spreadsheets values get --params '{"spreadsheetId": "SPREADSHEET_ID", "range": "Sheet1"}'

Append rows (helper)

gws sheets +append --spreadsheet SPREADSHEET_ID --values 'Alice,100,true'
gws sheets +append --spreadsheet SPREADSHEET_ID --json-values '[["Alice",100],["Bob",200]]'

Write values

gws sheets spreadsheets values update \
  --params '{"spreadsheetId": "SPREADSHEET_ID", "range": "Sheet1!A1:B2", "valueInputOption": "USER_ENTERED"}' \
  --json '{"values": [["Name", "Score"], ["Alice", "95"]]}'

Create a spreadsheet

gws sheets spreadsheets create --json '{"properties": {"title": "Q1 Budget"}}'

Get spreadsheet metadata

gws sheets spreadsheets get --params '{"spreadsheetId": "SPREADSHEET_ID"}'

Gmail

List recent messages

gws gmail users messages list --params '{"userId": "me", "maxResults": 10}'

Read a message

gws gmail users messages get --params '{"userId": "me", "id": "MESSAGE_ID"}'

Send an email (helper)

gws gmail +send --to user@example.com --subject "Hello" --body "Hi there!"

Search messages

gws gmail users messages list --params '{"userId": "me", "q": "from:alice@example.com subject:report"}'

Calendar

List today's events

gws calendar events list --params '{"calendarId": "primary", "timeMin": "2026-03-28T00:00:00Z", "timeMax": "2026-03-28T23:59:59Z", "singleEvents": true, "orderBy": "startTime"}'

Note: replace the date values with the actual current date. singleEvents: true is required for orderBy: startTime to work and expands recurring events into individual instances.

List upcoming events

gws calendar events list --params '{"calendarId": "primary", "timeMin": "2026-03-23T00:00:00Z", "maxResults": 10, "singleEvents": true, "orderBy": "startTime"}'

Create an event (helper)

gws calendar +insert --calendar primary --summary "Team Standup" --start "2026-03-24T10:00:00" --end "2026-03-24T10:30:00"

Get event details

gws calendar events get --params '{"calendarId": "primary", "eventId": "EVENT_ID"}'

Slides (Presentations)

Get presentation

gws slides presentations get --params '{"presentationId": "PRESENTATION_ID"}'

Create presentation

gws slides presentations create --json '{"title": "Q1 Review"}'

Tips

  • Always use the Shell tool to execute gws commands.
  • Responses are JSON by default. Use --format table for human-readable output when displaying to the user.
  • For large result sets, use --page-all with --page-limit to control volume.
  • Use --dry-run before write operations to preview what will be sent.
  • Use gws <service> <resource> --help to discover available methods for any API.
  • Use gws schema <service>.<resource>.<method> to inspect the full API schema for a method.
  • The CLI is authenticated against your Google account (run gws auth login if not yet done).
  • For full documentation: https://googleworkspace-cli.mintlify.app/commands/overview

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.