| name | gcli |
| description | Google Workspace CLI (Gmail, Calendar, Drive) via gcli — use --for-ai flag for token-efficient structured output. |
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
gcli mail list --for-ai
gcli mail list 10 --unread --for-ai
gcli mail get <thread-id> --for-ai
gcli mail search "from:boss subject:review" --for-ai
gcli mail send -t "user@example.com" -s "Subject" --body-file msg.txt
gcli mail reply <thread-id> --body-file reply.txt
gcli mail reply <thread-id> --all --body-file reply.txt
gcli mail forward <thread-id> -t "other@example.com"
gcli mail mark <message-id> --read
gcli mail mark <message-id> --trash
Calendar
gcli cal list --for-ai
gcli cal list 7 --for-ai
gcli cal list 7 --all-calendars --for-ai
gcli cal get <event-id> --for-ai
gcli cal create "Meeting" -s "tomorrow 2pm" -d "1h" --attendee "person@example.com"
gcli cal edit <event-id> -s "tomorrow 3pm"
gcli cal delete <event-id>
Drive
gcli drive list --for-ai
gcli drive list "path/to/folder" --for-ai
gcli drive search "quarterly report" --for-ai
gcli drive list -s --for-ai
gcli drive download "path/to/file" -o ./local-file
gcli drive upload ./local-file "path/to/folder"
gcli drive info "path/to/file" --for-ai
gcli drive permissions "path/to/file" --for-ai
Composing Emails
When writing email body:
- Create a temp file:
tmp=$(mktemp)
- Write content to it
- Use
--body-file "$tmp" to send — avoids shell escaping issues
- 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)