with one click
gmail
Read, send, and manage Gmail emails via the gmail-cli tool.
Menu
Read, send, and manage Gmail emails via the gmail-cli tool.
Interact with Elasticsearch clusters via the API.
Manage GitLab issues and merge requests via the glab CLI.
Manage Redis databases via the redis-cli tool.
Manage AWS resources via the aws CLI.
Query metrics, manage monitors, post events, and interact with Datadog via the dogshell CLI.
Send emails using mailsend-go CLI
| name | gmail |
| description | Read, send, and manage Gmail emails via the gmail-cli tool. |
| metadata | {"displayName":"Gmail","icon":"mail","category":"communication","version":"1.0.0","dependencies":{"cli":"gmail-cli","checkCommand":"gmail-cli --version","bundledInstall":"skills/gmail/install.sh","install":{"darwin":{"pip":"gmail-cli"},"linux":{"pip":"gmail-cli"},"windows":{"pip":"gmail-cli"}}},"config":[{"name":"GMAIL_CREDENTIALS_PATH","label":"Credentials Path","type":"string","required":false,"placeholder":"~/.gmail-cli/credentials.json"}],"auth":{"type":"oauth","setupCommand":"gmail-cli auth"}} |
Use ./.codebuddy/bin/gmail-cli-wrapper to interact with Gmail.
This tool allows you to read, send, and manage Gmail messages directly from the chat.
Note: The wrapper script ensures commands run within an isolated Python virtual environment for security.
CRITICAL: This tool accesses your Gmail account. Follow security best practices:
chmod 700 ~/.gmail-cli && chmod 600 ~/.gmail-cli/*credentials.json or token.pickle to gitbash .codebuddy/skills/gmail/install.shSECURITY.md for comprehensive security guidanceRecommended: Use the secure installation script:
cd .codebuddy/skills/gmail
bash install.sh
This script will:
Manual Setup (if needed):
Before using, you must authenticate with Google OAuth2. Run the following command in the terminal:
./.codebuddy/bin/gmail-cli-wrapper auth
This will:
Important: You need to set up OAuth2 credentials first. See SETUP.md for detailed instructions.
./.codebuddy/bin/gmail-cli-wrapper auth./.codebuddy/bin/gmail-cli-wrapper auth --reset./.codebuddy/bin/gmail-cli-wrapper list --max 10./.codebuddy/bin/gmail-cli-wrapper list --unread./.codebuddy/bin/gmail-cli-wrapper list --query "subject:meeting"./.codebuddy/bin/gmail-cli-wrapper read <message-id>./.codebuddy/bin/gmail-cli-wrapper send --to "user@example.com" --subject "Hello" --body "Message text"./.codebuddy/bin/gmail-cli-wrapper send --to "user@example.com" --cc "other@example.com" --subject "Hello" --body "Message"./.codebuddy/bin/gmail-cli-wrapper send --to "user@example.com" --subject "Files" --body "See attached" --attach /path/to/file.pdf./.codebuddy/bin/gmail-cli-wrapper send --to "user@example.com" --subject "Files" --body "Documents" --attach file1.pdf file2.docxGmail CLI supports advanced search queries similar to Gmail's web interface:
"from:john@example.com" - Emails from a specific sender"subject:invoice" - Emails with "invoice" in subject"has:attachment" - Emails with attachments"is:unread" - Unread emails"after:2024/01/01" - Emails after a specific date"to:me cc:boss@company.com" - Emails to you with CC to boss"newer_than:2d" - Emails from last 2 daysExample:
./.codebuddy/bin/gmail-cli-wrapper list --query "from:client@company.com subject:invoice has:attachment"
Configuration and credentials are stored in:
~/.gmail-cli/credentials.json - OAuth2 credentials (from Google Cloud Console)~/.gmail-cli/token.pickle - Access token (auto-generated and auto-refreshed)Before using this tool, you need to:
pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib# Secure the credential directory
chmod 700 ~/.gmail-cli
# Secure credential files
chmod 600 ~/.gmail-cli/credentials.json
chmod 600 ~/.gmail-cli/token.pickle
# Verify permissions
ls -la ~/.gmail-cli/
# Should show: drwx------ for directory, -rw------- for files
The secure implementation (gmail-cli-secure.py) validates all inputs:
# ✅ SAFE: Properly quoted and validated
EMAIL="user@example.com"
SUBJECT="Monthly Report"
BODY="Please review"
FILE="/path/to/document.pdf"
# Validate before using
[[ -f "$FILE" ]] || exit 1
./.codebuddy/bin/gmail-cli-wrapper send --to "$EMAIL" --subject "$SUBJECT" \
--body "$BODY" --attach "$FILE"
# DON'T DO THIS: Never use untrusted input directly
read -p "Enter recipient: " RECIPIENT
./.codebuddy/bin/gmail-cli-wrapper send --to "$RECIPIENT" --subject "Test"
# DON'T DO THIS: Sending sensitive files
./.codebuddy/bin/gmail-cli-wrapper send --to "user@example.com" \
--subject "Keys" --attach ~/.ssh/id_rsa # ❌ DANGER!
gmail.readonly + gmail.send (NOT gmail.modify)~/.gmail-cli/; must have 600 permissions./.codebuddy/bin/gmail-cli-wrapper auth --reset to re-authenticatepip install google-api-python-client google-auth-httplib2 google-auth-oauthlib~/.gmail-cli/credentials.json exists (see SETUP.md)chmod +x ./.codebuddy/bin/gmail-cli-wrapperBefore using Gmail CLI, verify:
install.sh script (virtual environment + security audit)~/.gmail-cli/ has 700 permissionscredentials.json has 600 permissionstoken.pickle has 600 permissions.gitignore configured to exclude sensitive files