agentleFS
5uck1ess5uck1ess/devkit/skills/gcli/SKILL.md

gcli

Skill4 starsChanged 4 months agoMITView on GitHub

Google Workspace CLI (Gmail, Calendar, Drive) via gcli — use --for-ai flag for token-efficient structured output.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before using any gcli command, verify it is installed:

    line 16
  2. Distinctive:

    If gcli is not installed, tell the user and stop.

    line 22
  3. Distinctive:

    When writing email body:

    line 99
  4. Very specific:

    Create a temp file: tmp=$(mktemp)

    line 100
  5. Distinctive:

    Write content to it

    line 101
  6. Very specific:

    Use --body-file "$tmp" to send — avoids shell escaping issues

    line 102

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

gcli — Google Workspace CLI

Single binary for Gmail, Calendar, and Drive. Always use --for-ai for structured, token-efficient output.

Confirmation Required

NEVER send, reply, forward, or delete email/calendar events without explicit user confirmation of the recipient(s), subject, and body. Always show the user what will be sent and wait for approval before executing. The same applies to cal create, cal edit, cal delete, and drive upload.

Prerequisites

Before using any gcli command, verify it is installed:

command -v gcli >/dev/null 2>&1 && echo "gcli: installed" || echo "gcli: not installed — install from https://github.com/AryaLabsHQ/gcli and run 'gcli login'"

If gcli is not installed, tell the user and stop. Do not attempt gcli commands without this check.

Gmail

# List inbox (default 20)
gcli mail list --for-ai
gcli mail list 10 --unread --for-ai

# Read a thread
gcli mail get <thread-id> --for-ai

# Search
gcli mail search "from:boss subject:review" --for-ai

# Send
gcli mail send -t "user@example.com" -s "Subject" --body-file msg.txt

# Reply (use thread-id from list/search)
gcli mail reply <thread-id> --body-file reply.txt
gcli mail reply <thread-id> --all --body-file reply.txt

# Forward / mark
gcli mail forward <thread-id> -t "other@example.com"
gcli mail mark <message-id> --read
gcli mail mark <message-id> --trash

Calendar

# Today's events
gcli cal list --for-ai

# Next 7 days
gcli cal list 7 --for-ai

# All calendars
gcli cal list 7 --all-calendars --for-ai

# Event details
gcli cal get <event-id> --for-ai

# Create
gcli cal create "Meeting" -s "tomorrow 2pm" -d "1h" --attendee "person@example.com"

# Edit / delete
gcli cal edit <event-id> -s "tomorrow 3pm"
gcli cal delete <event-id>

Drive

# List root
gcli drive list --for-ai

# List folder
gcli drive list "path/to/folder" --for-ai

# Search
gcli drive search "quarterly report" --for-ai

# Shared files
gcli drive list -s --for-ai

# Download / upload
gcli drive download "path/to/file" -o ./local-file
gcli drive upload ./local-file "path/to/folder"

# Info / permissions
gcli drive info "path/to/file" --for-ai
gcli drive permissions "path/to/file" --for-ai

Composing Emails

When writing email body:

  1. Create a temp file: tmp=$(mktemp)
  2. Write content to it
  3. Use --body-file "$tmp" to send — avoids shell escaping issues
  4. Clean up: rm -f "$tmp"

Tips

  • Thread IDs from mail list and mail search feed into mail get, mail reply, mail forward
  • Event IDs from cal list feed into cal get, cal edit, cal delete
  • --for-ai strips HTML and formats for LLM consumption — always use it for reads
  • Attachments: -A file1.pdf -A file2.pdf (repeatable)

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.