Full access to Google Workspace (Drive, Docs, Sheets, Slides, Calendar, Gmail) using curl and the Google APIs directly - no MCP server or additional dependencies required. Use for searching files, reading/writing documents, managing calendar events, and email operations. First check if user has authenticated, if not guide them through the OAuth flow.
Inherits all available tools
Additional assets for this skill
This skill inherits all available tools. When active, it can use any tool Claude has access to.
_auth.shcalendar/calendars.shcalendar/create.shcalendar/delete.shcalendar/get.shcalendar/list.shcalendar/search.shcalendar/update.shcheck-auth.shdrive/docs/create.shdrive/docs/list.shdrive/docs/read.shdrive/docs/search.shdrive/docs/write.shdrive/files/delete.shdrive/files/download.shdrive/files/list.shdrive/files/upload.shdrive/search.shdrive/sheets/append.shThis skill provides full access to Google Workspace APIs via helper scripts.
Check if user has set up their credentials:
check-auth.sh
If USER_NOT_AUTHENTICATED, guide the user through the Setup section below.
All scripts handle authentication automatically. Prepend the base directory path to all script paths.
drive/search.sh <query> [count] # Search all files by content
drive/files/list.sh [count] # List recent files
drive/files/upload.sh <local_path> [folder_id] # Upload file
drive/files/download.sh <file_id> <output_path> # Download file
drive/files/delete.sh <file_id> # Move file to trash
drive/docs/list.sh [count] # List recent Google Docs
drive/docs/search.sh <query> # Search docs by name
drive/docs/read.sh <doc_id> [options] # Read document content (supports tabs)
drive/docs/create.sh <title> [folder_id] # Create new doc
drive/docs/write.sh <doc_id> <text> [index] # Write/append text
Document Tabs: Google Docs can have multiple tabs. The read.sh script supports:
drive/docs/read.sh <doc_id> # Read first tab (default)
drive/docs/read.sh <doc_id> --list-tabs # List all tabs in document
drive/docs/read.sh <doc_id> --tab "Transcript" # Read tab by name
drive/docs/read.sh <doc_id> --tab-index 1 # Read tab by index (0-based)
drive/docs/read.sh <doc_id> --all-tabs # Read all tabs
drive/sheets/list.sh [count] # List recent spreadsheets
drive/sheets/search.sh <query> # Search sheets by name
drive/sheets/read.sh <id> [range] # Read sheet values
drive/sheets/write.sh <id> <range> <values_json> # Write values
drive/sheets/append.sh <id> <sheet_name> <values_json> # Append rows
drive/sheets/create.sh <title> [folder_id] # Create new sheet
Example: drive/sheets/write.sh 1abc "Sheet1!A1:B2" '[["Name","Age"],["John",30]]'
drive/slides/list.sh [count] # List recent presentations
drive/slides/search.sh <query> # Search slides by name
drive/slides/read.sh <presentation_id> # Read presentation
drive/slides/create.sh <title> [folder_id] # Create new presentation
calendar/calendars.sh # List all calendars
calendar/list.sh [count] [calendar_id] # List upcoming events
calendar/search.sh <query> [count] [calendar_id] # Search events
calendar/get.sh <event_id> [calendar_id] # Get event details
calendar/create.sh <summary> <start> <end> [description] [calendar_id]
calendar/update.sh <event_id> <json_updates> [calendar_id]
calendar/delete.sh <event_id> [calendar_id]
Example: calendar/create.sh "Meeting" "2024-12-10T10:00:00" "2024-12-10T11:00:00"
gmail/labels.sh # List all labels
gmail/list.sh [count] [label] # List recent emails
gmail/search.sh <query> [count] # Search emails
gmail/read.sh <message_id> [format] # Read email content
gmail/send.sh <to> <subject> <body> # Send email
gmail/draft.sh <to> <subject> <body> # Create draft
Example: gmail/search.sh "from:john@example.com" 5
IMPORTANT: The user needs to provide their client_id and client_secret from Google Cloud Console. They can get these by creating OAuth 2.0 credentials (Desktop app type) in their Google Cloud project.
Ask the user for their client_id and client_secret. Only these two values are needed:
client_id: looks like xxx.apps.googleusercontent.comclient_secret: looks like GOCSPX-xxxThe skill's oauth-app.json file should already contain the client_id.
Note: When running bash commands with special characters like parentheses in values, wrap the entire command in bash -c '...' to avoid shell parsing issues.
bash -c 'CLIENT_ID="YOUR_CLIENT_ID"; SCOPES="https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/documents https://www.googleapis.com/auth/spreadsheets https://www.googleapis.com/auth/presentations https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/gmail.modify"; ENCODED_SCOPES=$(echo $SCOPES | sed "s/ /%20/g"); echo "https://accounts.google.com/o/oauth2/auth?client_id=${CLIENT_ID}&redirect_uri=http://localhost&scope=${ENCODED_SCOPES}&response_type=code&access_type=offline&prompt=consent"'
Tell the user to open this URL in their browser.
http://localhost/?code=XXXXX... (the page won't load - that's expected)Example redirect URL:
http://localhost/?code=4/0ATx...XXX&scope=https://www.googleapis.com/auth/drive%20...
Extract the code from the URL (everything between code= and &scope=) and exchange it:
bash -c 'CODE="EXTRACTED_CODE"; CLIENT_ID="YOUR_CLIENT_ID"; CLIENT_SECRET="YOUR_CLIENT_SECRET"; curl -s -X POST https://oauth2.googleapis.com/token -d "code=$CODE" -d "client_id=$CLIENT_ID" -d "client_secret=$CLIENT_SECRET" -d "redirect_uri=http://localhost" -d "grant_type=authorization_code"'
This returns JSON with access_token and refresh_token. Save the refresh_token.
mkdir -p ~/.config/gdrive-skill && cat > ~/.config/gdrive-skill/credentials.json << 'EOF'
{
"client_secret": "YOUR_CLIENT_SECRET",
"refresh_token": "YOUR_REFRESH_TOKEN"
}
EOF
chmod 600 ~/.config/gdrive-skill/credentials.json && echo "Credentials saved!"
Setup complete!
Google Drive API supports powerful query operators beyond simple keyword search.
| Operator | Description | Example |
|---|---|---|
=, != | Exact match | name = 'Report.pdf' |
<, <=, >, >= | Date/time comparison | modifiedTime > '2024-01-01' |
contains | Substring match | name contains 'meeting' |
in | Collection membership | 'user@example.com' in owners |
and, or, not | Logical operators | name contains 'a' and name contains 'b' |
| Field | Description |
|---|---|
name | File name |
fullText | Searches name, description, and content |
mimeType | File type (e.g., application/vnd.google-apps.document) |
modifiedTime | Last modification (RFC 3339: 2024-12-01T00:00:00Z) |
createdTime | Creation date |
viewedByMeTime | Last viewed by user |
trashed | In trash (true/false) |
starred | Starred (true/false) |
parents | Parent folder ID |
owners | File owner email |
writers | Users with write access |
readers | Users with read access |
sharedWithMe | In "Shared with me" |