Manage Gmail - send, read, search emails, manage labels and drafts. Use when user wants to interact with their Gmail account for email operations.
This skill provides comprehensive Gmail integration through lightweight CLI scripts. All operations are token-efficient and composable.
Before using this skill, you must set up OAuth authentication:
Install dependencies:
cd ~/.claude/skills/gmail-skill && npm install
Set up Google Cloud credentials:
docs/google-cloud-setup.mdcredentials.json and save to scripts/auth/credentials.jsonAuthenticate:
cd ~/.claude/skills/gmail-skill && npm run setup
This will open a browser for Google OAuth and save your token locally.
The Gmail skill supports multiple accounts (e.g., personal and work email):
# Add a second account (from skill directory)
npm run setup -- --account work
# Add a third account
npm run setup -- --account personal
Each account needs separate OAuth authentication.
# List all configured accounts
node scripts/manage-accounts.js --list
# Set default account (used when --account is not specified)
node scripts/manage-accounts.js --set-default work
# Remove an account
node scripts/manage-accounts.js --remove old-account
All Gmail operations support the --account parameter:
# Send email from work account
node gmail-send.js --account work --to "[email protected]" --subject "..." --body "..."
# Send from personal (or omit --account to use default)
node gmail-send.js --account personal --to "[email protected]" --subject "..." --body "..."
# Search work emails
node gmail-search.js --account work --query "is:unread"
If --account is not specified, the default account is used.
When first using Gmail operations, read the comprehensive README:
cat ~/.claude/skills/gmail-skill/README.md
This provides detailed usage examples for all operations.
All scripts are in the scripts/ directory and output JSON for easy parsing:
cd ~/.claude/skills/gmail-skill/scripts
All scripts return JSON. Parse the output and present relevant information to the user in a friendly format.
Save intermediate results to files when chaining operations:
# Search for emails
node gmail-search.js --query "from:[email protected]" > /tmp/search-results.json
# Read first message from results
MESSAGE_ID=$(cat /tmp/search-results.json | jq -r '.messages[0].id')
node gmail-read.js --id "$MESSAGE_ID"
node gmail-send.js --to "[email protected]" --subject "Subject" --body "Body text"
node gmail-search.js --query "is:unread" --limit 10
node gmail-read.js --id "MESSAGE_ID"
# List all labels
node gmail-labels.js --action list
# Add label to message
node gmail-labels.js --action add --id "MESSAGE_ID" --label "Important"
# Create draft
node gmail-drafts.js --action create --to "[email protected]" --subject "Subject" --body "Draft body"
# Send draft
node gmail-drafts.js --action send --id "DRAFT_ID"
If scripts fail:
token.json exists in scripts/auth/npm run setup againThis skill is designed for minimal token usage: