1---2name: agent-gsuite3description: Google Workspace operations — Docs, Sheets, Drive, Apps Script, Gmail, Calendar, Tasks, Slides, Contacts, Chat, and Search. Use for creating, reading, editing Google Docs/Sheets/Slides. Use for Drive file management. Use for Calendar events and scheduling. Use for Gmail messages, labels, and filters. Use for Tasks, Contacts, and Chat.4---56# Google Workspace — 12 Services, 106 Tools78You have access to a CLI tool that performs all Google Workspace operations. Run it via:910```bash11node ~/.claude/skills/agent-gsuite/scripts/gsuite.mjs <command> '<json-args>'12```1314All commands accept a single JSON argument. Output is always JSON.1516## Authentication1718Tokens are stored at `~/.config/agent-gsuite/token.json`. If tokens are missing, tell the user to run:1920```bash21bun x agent-gsuite auth login22```2324Or if bun is unavailable:2526```bash27node ~/.claude/skills/agent-gsuite/scripts/gsuite.mjs auth28```2930## Commands Reference3132### Google Docs3334| Command | JSON Args | Description |35|---------|-----------|-------------|36| `docs.create` | `{"title": "..."}` | Create a new doc |37| `docs.read` | `{"doc_id": "..."}` | Read doc text content |38| `docs.edit` | `{"doc_id": "...", "old_text": "...", "new_text": "...", "replace_all": false}` | Replace text in doc |39| `docs.insert` | `{"doc_id": "...", "text": "...", "position": "end"}` | Insert text (position: "end", text-to-insert-after, or index number) |40| `docs.delete` | `{"doc_id": "...", "text": "...", "delete_all": false}` | Delete text from doc |41| `docs.format` | `{"doc_id": "...", "search_text": "...", ...formatting}` | Format text (bold, italic, underline, strikethrough, font_size, font_family, foreground_color, background_color, heading, alignment) |42| `docs.insert_table` | `{"doc_id": "...", "rows": 3, "cols": 3, "position": "end"}` | Insert table |43| `docs.get_info` | `{"doc_id": "..."}` | Get doc metadata |44| `docs.get_structure` | `{"doc_id": "..."}` | Get headings hierarchy |45| `docs.get_sections` | `{"doc_id": "..."}` | Parse sections with indices |46| `docs.section` | `{"doc_id": "...", "action": "delete\|move\|replace", "section": "name-or-index", ...}` | Manage sections (target for move, content + preserve_heading for replace) |47| `docs.image` | `{"doc_id": "...", "action": "insert\|list\|delete\|replace", ...}` | Manage images (image_url, image_index, position, width, height) |48| `docs.batch` | `{"doc_id": "...", "operations": [...]}` | Batch operations (type: insert/delete/format with params) |49| `docs.list` | `{"max_results": 20, "query": "..."}` | List docs |50| `docs_find_replace` | `{"doc_id": "...", "find_text": "...", "replace_text": "...", "match_case": false}` | Find and replace all |51| `docs_export_pdf` | `{"doc_id": "..."}` | Export doc as PDF (base64) |52| `docs_as_markdown` | `{"doc_id": "..."}` | Get doc as markdown |5354### Google Sheets5556| Command | JSON Args | Description |57|---------|-----------|-------------|58| `sheets.create` | `{"title": "..."}` | Create spreadsheet |59| `sheets.read` | `{"sheet_id": "...", "range": "Sheet1"}` | Read values from range |60| `sheets.edit` | `{"sheet_id": "...", "range": "A1:B2", "values": [[...]]}` | Update range values |61| `sheets.insert` | `{"sheet_id": "...", "values": [[...]], "range": "Sheet1"}` | Append rows |62| `sheets.get_cell` | `{"sheet_id": "...", "cell": "A1"}` | Get cell value |63| `sheets.set_cell` | `{"sheet_id": "...", "cell": "A1", "value": "..."}` | Set cell value |64| `sheets.edit_cell` | `{"sheet_id": "...", "cell": "A1", "old_text": "...", "new_text": "...", "replace_all": false}` | Replace text in cell |65| `sheets.find_replace` | `{"sheet_id": "...", "find": "...", "replace": "...", "sheet_name": null}` | Find/replace across sheet |66| `sheets.get_info` | `{"sheet_id": "..."}` | Get spreadsheet metadata |67| `sheets.list` | `{"max_results": 20, "query": "..."}` | List spreadsheets |68| `sheets.tab` | `{"sheet_id": "...", "action": "add\|delete\|rename", "title": "...", "sheet_name": "..."}` | Manage tabs |69| `sheets.clear` | `{"sheet_id": "...", "range": "A1:B2", "clear_formats": false}` | Clear range |70| `sheets.format` | `{"sheet_id": "...", "range": "A1:B2", ...formatting}` | Format range (background_color, text_color, bold, italic, font_size, font_family, horizontal_alignment, vertical_alignment, wrap_strategy, number_format, borders) |71| `sheets.merge` | `{"sheet_id": "...", "range": "A1:B2", "action": "merge\|unmerge"}` | Merge/unmerge cells |72| `sheets.freeze` | `{"sheet_id": "...", "sheet_name": "...", "rows": 1, "columns": 0}` | Freeze rows/columns |73| `sheets.sort` | `{"sheet_id": "...", "range": "A1:C10", "sort_column": "A", "ascending": true}` | Sort range |74| `sheets.rows_cols` | `{"sheet_id": "...", "sheet_name": "...", "action": "insert\|delete", "dimension": "ROW\|COLUMN", "start_index": 0, "count": 1}` | Insert/delete rows or columns |75| `sheets.dimension_size` | `{"sheet_id": "...", "sheet_name": "...", "dimension": "COLUMN\|ROW", "start": "A", "end": "C", "size": 150}` | Set column width or row height |76| `sheets.get_formula` | `{"sheet_id": "...", "cell": "A1"}` | Get cell formula and value |77| `sheets.batch` | `{"sheet_id": "...", "operations": [...]}` | Batch operations (type: setValue/format) |7879### Google Drive8081| Command | JSON Args | Description |82|---------|-----------|-------------|83| `drive.search` | `{"query": "...", "type": "all\|docs\|sheets", "max_results": 20}` | Search Drive |84| `drive_get_download_url` | `{"file_id": "..."}` | Get download URL |85| `drive_copy` | `{"file_id": "...", "name": "...", "parent_folder_id": "..."}` | Copy a file |86| `drive_manage_access` | `{"file_id": "...", "action": "share\|unshare\|list", "email": "...", "role": "reader\|writer"}` | Manage file permissions |8788### Apps Script8990| Command | JSON Args | Description |91|---------|-----------|-------------|92| `scripts.create` | `{"sheet_id": "...", "script_name": "..."}` | Create script project |93| `scripts.list` | `{"sheet_id": "..."}` | List scripts |94| `scripts.read` | `{"sheet_id": "...", "script": "name-or-index"}` | Read script files |95| `scripts.write` | `{"sheet_id": "...", "script": "...", "file_name": "...", "content": "...", "file_type": "SERVER_JS\|HTML"}` | Write script file (full overwrite) |96| `scripts.edit` | `{"sheet_id": "...", "script": "...", "file_name": "...", "old_text": "...", "new_text": "...", "replace_all": false}` | Edit script file (text replacement) |97| `scripts.delete` | `{"sheet_id": "...", "script": "..."}` | Remove script tracking |98| `scripts.run` | `{"sheet_id": "...", "script": "...", "function_name": "...", "parameters": []}` | Execute script function |99| `scripts.sync` | `{"sheet_id": "..."}` | Sync and verify scripts |100101### Gmail — Messages102103| Command | JSON Args | Description |104|---------|-----------|-------------|105| `gmail.list_messages` | `{"query": "...", "max_results": 20, "label_ids": [...]}` | List messages (query: "from:x@x.com", "is:unread", "subject:meeting") |106| `gmail.get_message` | `{"message_id": "...", "format": "full"}` | Get message details (format: full, minimal, metadata) |107| `gmail.send_message` | `{"to": "...", "subject": "...", "body": "...", "from": "...", "cc": "...", "bcc": "..."}` | Send email |108| `gmail.list_threads` | `{"query": "...", "max_results": 10}` | List threads |109| `gmail.get_thread` | `{"thread_id": "...", "format": "full"}` | Get thread details |110| `gmail.modify_message` | `{"message_id": "...", "add_labels": [...], "remove_labels": [...]}` | Modify message labels |111| `gmail.trash_message` | `{"message_id": "..."}` | Move message to trash |112| `gmail.delete_message` | `{"message_id": "..."}` | Permanently delete message |113| `gmail_get_attachments` | `{"message_id": "..."}` | List message attachments |114| `gmail_download_attachment` | `{"message_id": "...", "attachment_id": "..."}` | Download attachment as base64 |115| `gmail_bulk_modify_labels` | `{"query": "...", "add_labels": [...], "remove_labels": [...], "max_results": 2000}` | Bulk label modification by query |116117### Gmail — Labels118119| Command | JSON Args | Description |120|---------|-----------|-------------|121| `gmail.list_labels` | `{}` | List all Gmail labels with counts and metadata |122| `gmail_create_label` | `{"name": "...", "label_list_visibility": "...", "message_list_visibility": "...", "color": {"text_color": "#000", "background_color": "#fff"}}` | Create label |123| `gmail_update_label` | `{"label_id": "...", "name": "...", ...}` | Update label |124| `gmail_delete_label` | `{"label_id": "..."}` | Delete label |125126### Gmail — Filters127128| Command | JSON Args | Description |129|---------|-----------|-------------|130| `gmail_list_filters` | `{}` | List all Gmail filters |131| `gmail_get_filter` | `{"filter_id": "..."}` | Get filter details |132| `gmail_create_filter` | `{"criteria": {"from": "...", "subject": "...", "has_attachment": true, ...}, "action": {"add_label_ids": [...], "remove_label_ids": [...], "forward": "..."}}` | Create filter |133| `gmail_delete_filter` | `{"filter_id": "..."}` | Delete filter |134| `gmail_replace_filter` | `{"filter_id": "...", "criteria": {...}, "action": {...}}` | Replace filter (Gmail has no native update API) |135| `gmail_draft` | `{"to": "...", "subject": "...", "body": "...", "cc": "...", "bcc": "..."}` | Create draft email |136| `gmail_get_thread` | `{"thread_id": "...", "format": "full"}` | Get full thread content |137| `gmail_batch_get` | `{"message_ids": [...], "format": "full"}` | Batch get messages |138139### Google Calendar140141| Command | JSON Args | Description |142|---------|-----------|-------------|143| `calendar_list` | `{}` | List all calendars |144| `calendar_get_events` | `{"calendar_id": "primary", "time_min": "...", "time_max": "...", "query": "...", "max_results": 25, "detailed": false}` | Get events |145| `calendar_manage_event` | `{"action": "create\|update\|delete\|rsvp", "summary": "...", "start_time": "...", "end_time": "...", "event_id": "...", "attendees": [...], "add_google_meet": true}` | Manage events |146| `calendar_freebusy` | `{"time_min": "...", "time_max": "...", "calendar_ids": ["primary"]}` | Query free/busy |147| `calendar_create` | `{"summary": "...", "description": "...", "timezone": "..."}` | Create calendar |148| `calendar_out_of_office` | `{"action": "list\|create\|delete", "start_time": "...", "end_time": "..."}` | Manage OOO |149| `calendar_focus_time` | `{"action": "list\|create\|delete", "start_time": "...", "end_time": "..."}` | Manage focus time |150151### Google Tasks152153| Command | JSON Args | Description |154|---------|-----------|-------------|155| `tasks_list_lists` | `{}` | List task lists |156| `tasks_get_list` | `{"tasklist_id": "..."}` | Get task list |157| `tasks_manage_list` | `{"action": "create\|update\|delete\|clear", "title": "..."}` | Manage task lists |158| `tasks_list` | `{"tasklist_id": "@default", "show_completed": true}` | List tasks |159| `tasks_get` | `{"tasklist_id": "...", "task_id": "..."}` | Get task |160| `tasks_manage` | `{"action": "create\|update\|delete\|move", "title": "...", "due": "...", "status": "needsAction\|completed"}` | Manage tasks |161162### Google Slides163164| Command | JSON Args | Description |165|---------|-----------|-------------|166| `slides_create` | `{"title": "..."}` | Create presentation |167| `slides_get` | `{"presentation_id": "..."}` | Get presentation metadata |168| `slides_batch_update` | `{"presentation_id": "...", "requests": [...]}` | Batch update |169| `slides_get_page` | `{"presentation_id": "...", "page_id": "..."}` | Get page elements |170| `slides_get_thumbnail` | `{"presentation_id": "...", "page_id": "...", "mime_type": "PNG"}` | Get slide thumbnail |171172### Google Contacts173174| Command | JSON Args | Description |175|---------|-----------|-------------|176| `contacts_list` | `{"page_size": 100}` | List contacts |177| `contacts_get` | `{"resource_name": "people/c123"}` | Get contact |178| `contacts_search` | `{"query": "..."}` | Search contacts |179| `contacts_manage` | `{"action": "create\|update\|delete", "given_name": "...", "emails": [...], "phones": [...]}` | Manage contacts |180| `contacts_list_groups` | `{}` | List groups |181| `contacts_get_group` | `{"resource_name": "..."}` | Get group |182| `contacts_batch` | `{"action": "add_to_group\|remove_from_group", "resource_names": [...], "group_resource_name": "..."}` | Batch group ops |183| `contacts_manage_group` | `{"action": "create\|update\|delete", "name": "..."}` | Manage groups |184185### Google Chat186187| Command | JSON Args | Description |188|---------|-----------|-------------|189| `chat_list_spaces` | `{}` | List Chat spaces |190| `chat_get_messages` | `{"space_name": "spaces/AAAA", "page_size": 25}` | Get messages |191| `chat_send_message` | `{"space_name": "...", "text": "...", "thread_key": "..."}` | Send message |192| `chat_search_messages` | `{"query": "..."}` | Search messages |193| `chat_create_reaction` | `{"message_name": "...", "emoji": "👍"}` | Add reaction |194| `chat_download_attachment` | `{"attachment_name": "..."}` | Download attachment |195196### Google Custom Search197198| Command | JSON Args | Description |199|---------|-----------|-------------|200| `search_custom` | `{"query": "...", "num": 10, "site_search": "...", "file_type": "pdf"}` | Web search (requires GOOGLE_API_KEY) |201| `search_engine_info` | `{"search_engine_id": "..."}` | Get search engine info |202203## Usage Pattern204205Always use this exact invocation pattern:206207```bash208node ~/.claude/skills/agent-gsuite/scripts/gsuite.mjs <command> '<json-args>'209```210211Example: Create a document:212```bash213node ~/.claude/skills/agent-gsuite/scripts/gsuite.mjs docs.create '{"title":"Meeting Notes"}'214```215216Example: Read a spreadsheet:217```bash218node ~/.claude/skills/agent-gsuite/scripts/gsuite.mjs sheets.read '{"sheet_id":"1abc...xyz","range":"Sheet1!A1:D10"}'219```220221Example: Format text bold in a doc:222```bash223node ~/.claude/skills/agent-gsuite/scripts/gsuite.mjs docs.format '{"doc_id":"1abc...xyz","search_text":"Important","bold":true}'224```225226Example: Search Gmail for unread emails:227```bash228node ~/.claude/skills/agent-gsuite/scripts/gsuite.mjs gmail.list_messages '{"query":"is:unread","max_results":10}'229```230231Example: Create a Gmail filter:232```bash233node ~/.claude/skills/agent-gsuite/scripts/gsuite.mjs gmail_create_filter '{"criteria":{"from":"newsletter@example.com"},"action":{"add_label_ids":["Label_123"],"remove_label_ids":["INBOX"]}}'234```