Read, send, and manage Gmail emails via the gmail-cli tool. An agent skill from olasunkanmi-SE/codebuddy.

MITAuto-check: warningsProductivity & Automation

Install Gmail

The automated check flagged lines worth reading first. See the safety section below.

skills CLI
$ npx skills add olasunkanmi-SE/codebuddy --skill gmail -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install olasunkanmi-SE/codebuddy gmail --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/olasunkanmi-SE/codebuddy.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/gmail .claude/skills/gmail && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
gmail
GitHub stars
141
Token cost
~1.9k tokens
SKILL.md length
649 words
Files
10
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Read, send, and manage Gmail emails via the gmail-cli tool. An agent skill from olasunkanmi-SE/codebuddy.

  • Works in 3 steps: Open a browser window for Google OAuth2… → Request permissions to access your Gmail… → Store credentials locally for future use
  • Tasks that involve Email management
  • SKILL.md covers ⚠️ Security Warning, Setup, Common Commands and Search Query Examples, plus 7 more sections
  • Runs Shell and Python scripts from its folder; calls bash and pip

What it does

Gmail is an agent skill from olasunkanmi-SE/codebuddy. Read, send, and manage Gmail emails via the gmail-cli tool.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files (for example `README.md`, `SECURITY.md` and `SETUP.md`).

It sits in Productivity & Automation, covering Email management. It works with Gmail. The repository describes itself as: An Autonomous AI Software Engineer. The licence is MIT.

When your agent uses it

  • Tasks that involve Email management

Example prompts

  • “/gmail”

Requirements

  • Python 3
  • A Bash shell

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Open a browser window for Google OAuth2 authentication
  2. Request permissions to access your Gmail account
  3. Store credentials locally for future use

What it can do on your machine

Read from SKILL.md and the folder at commit a9b8cd0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Shell and Python), which the agent can run.

    Shell commands in SKILL.md call:

    • bash
    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Gmail loads about 1.9k tokens when it runs. Until then it costs about 16 tokens; SKILL.md has 649 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~16
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: warnings

The automated check found patterns that need a careful read before installing.

  • WarningMentions a credentials file (SSH keys, cloud or package-manager tokens)SKILL.md:185
    --subject "Keys" --attach ~/.ssh/id_rsa  # ❌ DANGER!

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from olasunkanmi-SE/codebuddy at commit a9b8cd0, republished under its MIT licence (© olasunkanmi-SE). 649 words, ~1,945 tokens.

Download SKILL.mdSave it as .claude/skills/gmail/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.
name
gmail
description
Read, send, and manage Gmail emails via the gmail-cli tool.
metadata.displayName
Gmail
metadata.icon
mail
metadata.category
communication
metadata.version
1.0.0

gmail-cli

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.

⚠️ Security Warning

CRITICAL: This tool accesses your Gmail account. Follow security best practices:

  • ✅ ALWAYS set file permissions: chmod 700 ~/.gmail-cli && chmod 600 ~/.gmail-cli/*
  • ✅ NEVER commit credentials.json or token.pickle to git
  • ✅ Use the secure installation script: bash .codebuddy/skills/gmail/install.sh
  • ✅ Review SECURITY.md for comprehensive security guidance
  • ⚠️ Extra caution on shared systems - other users may access your credentials if permissions are wrong!

Setup

Recommended: Use the secure installation script:

bash
cd .codebuddy/skills/gmail
bash install.sh

This script will:

  • Create isolated Python virtual environment
  • Install dependencies with security audit
  • Set secure file permissions (700/600)
  • Guide you through OAuth2 setup

Manual Setup (if needed):

Before using, you must authenticate with Google OAuth2. Run the following command in the terminal:

bash
./.codebuddy/bin/gmail-cli-wrapper auth

This will:

  1. Open a browser window for Google OAuth2 authentication
  2. Request permissions to access your Gmail account
  3. Store credentials locally for future use

Important: You need to set up OAuth2 credentials first. See SETUP.md for detailed instructions.

Common Commands

Authentication
  • Authenticate: ./.codebuddy/bin/gmail-cli-wrapper auth
  • Reset authentication: ./.codebuddy/bin/gmail-cli-wrapper auth --reset
Reading Emails
  • List recent emails: ./.codebuddy/bin/gmail-cli-wrapper list --max 10
  • List unread emails: ./.codebuddy/bin/gmail-cli-wrapper list --unread
  • Search emails: ./.codebuddy/bin/gmail-cli-wrapper list --query "subject:meeting"
  • Read specific email: ./.codebuddy/bin/gmail-cli-wrapper read <message-id>
Sending Emails
  • Send email: ./.codebuddy/bin/gmail-cli-wrapper send --to "user@example.com" --subject "Hello" --body "Message text"
  • Send with CC: ./.codebuddy/bin/gmail-cli-wrapper send --to "user@example.com" --cc "other@example.com" --subject "Hello" --body "Message"
  • Send with attachment: ./.codebuddy/bin/gmail-cli-wrapper send --to "user@example.com" --subject "Files" --body "See attached" --attach /path/to/file.pdf
  • Multiple attachments: ./.codebuddy/bin/gmail-cli-wrapper send --to "user@example.com" --subject "Files" --body "Documents" --attach file1.pdf file2.docx

Search Query Examples

Gmail 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 days

Example:

bash
./.codebuddy/bin/gmail-cli-wrapper list --query "from:client@company.com subject:invoice has:attachment"

Configuration

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)

Prerequisites

Before using this tool, you need to:

  1. Install Python 3.7+
  2. Install required packages: pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib
  3. Set up OAuth2 credentials from Google Cloud Console (see SETUP.md)

🔒 Security Best Practices

File Permissions (MANDATORY)
bash
# 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
Show full SKILL.md (261 more words)Show less
Input Validation

The secure implementation (gmail-cli-secure.py) validates all inputs:

  • ✅ Email addresses checked against RFC 5322 format
  • ✅ File paths validated to prevent path traversal
  • ✅ Sensitive files blocked from attachments
  • ✅ Text fields sanitized to prevent injection attacks
Safe Usage Example
bash
# ✅ 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"
❌ Unsafe Practices
bash
# 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!

Notes

  • OAuth2 Required: You must complete OAuth2 authentication before using the tool
  • Google Account Access: Requires a Google account with Gmail enabled
  • API Permissions: Recommended scopes: gmail.readonly + gmail.send (NOT gmail.modify)
  • Rate Limits: Subject to Gmail API rate limits (usually sufficient for normal use)
  • Security: Tokens are stored locally in ~/.gmail-cli/; must have 600 permissions
  • First Time Setup: Setup requires creating a Google Cloud project and OAuth2 credentials (see SETUP.md)
  • Token Rotation: Revoke tokens every 30-90 days or after device loss
  • Shared Systems: Extra caution on shared computers - use restrictive permissions!

Troubleshooting

  • Authentication fails: Try ./.codebuddy/bin/gmail-cli-wrapper auth --reset to re-authenticate
  • Package errors: Install packages with pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib
  • Credentials not found: Make sure ~/.gmail-cli/credentials.json exists (see SETUP.md)
  • Permission denied: Ensure the wrapper has execute permissions: chmod +x ./.codebuddy/bin/gmail-cli-wrapper

📚 Documentation

  • SECURITY.md - 🔒 READ THIS FIRST - Comprehensive security guide
  • SETUP.md - Detailed setup instructions with Google Cloud Console configuration
  • README.md - Quick start guide and feature overview
  • gmail-cli-secure.py - Reference implementation with input validation
  • email/skill.md - Alternative SMTP-based email sending (simpler but less features)

🛡️ Security Checklist

Before using Gmail CLI, verify:

  • Installed using install.sh script (virtual environment + security audit)
  • ~/.gmail-cli/ has 700 permissions
  • credentials.json has 600 permissions
  • token.pickle has 600 permissions
  • .gitignore configured to exclude sensitive files
  • Using minimal OAuth2 scopes (readonly + send, NOT modify)
  • Read SECURITY.md for best practices
  • Understand how to revoke tokens if compromised

© olasunkanmi-SE, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 9 other files in skills/gmail of olasunkanmi-SE/codebuddy.

  • SKILL.md
  • .gitignore
  • README.md
  • SECURITY.md
  • SETUP.md
  • activate-gmail-cli.sh
  • generate-hashes.sh
  • gmail-cli-secure.py
  • install.sh
  • requirements.txt

Open the folder on GitHubat commit a9b8cd0

Compare with similar skills

Gmail next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Gmail compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Gmail this skillolasunkanmi-SE/codebuddy141—~1.9kAutomated safety check: WarnMIT
Career-Ops Gmail Lead Plugincareer-ops-hq/career-ops74k—~233Automated safety check: NotesMIT
Gmailteam-attention/plugins-for-claude-natives825—~967Automated safety check: PassMIT
Connect Apps with ComposioComposioHQ/awesome-claude-skills77k3 repos~557Automated safety check: PassNone
Gmail Emailopen-gitagent/gitagent710—~235Automated safety check: NotesMIT
Zeleremorses/zele299—~1.3kAutomated safety check: PassNone

Similar skills

  • Career-Ops Gmail Lead Plugin

    career-ops-hq/career-ops

    Pulls job leads from a Gmail label into the career-ops pipeline, extracting job URLs from DMARC-passing emails and de-duplicating against existing leads.

    74k GitHub stars~233 tokensUpdated today
    Productivity & AutomationAuto-check: notes
  • Gmail

    team-attention/plugins-for-claude-natives

    This skill should be used when the user asks to "check email", "read emails", "send email", "reply to email", "search inbox", or manages Gmail.

    825 GitHub stars~967 tokensUpdated 5 mo ago
    Productivity & AutomationAuto-check passed
  • Connect Apps with Composio

    ComposioHQ/awesome-claude-skills

    Connects an agent to 1000+ external apps through the Composio Tool Router plugin, so it can actually send emails, create issues and post messages instead of only drafting them.

    77k GitHub starsUsed in 3 repos~557 tokens
    Productivity & AutomationAuto-check passed
  • Gmail Email

    open-gitagent/gitagent

    Send emails via Gmail SMTP using App Password authentication.

    710 GitHub stars~235 tokensUpdated 1 mo ago
    Productivity & AutomationAuto-check: notes
  • Zele

    remorses/zele

    zele is a multi-account email and calendar CLI for Gmail, IMAP/SMTP (Fastmail, Outlook, any provider), and Google Calendar.

    299 GitHub stars~1.3k tokensUpdated 6 days ago
    Productivity & AutomationAuto-check passed
  • Google Workspace

    yc-software/qm

    Read and act on the user's Gmail, Google Calendar, and Google Tasks through per-user OAuth.

    15k GitHub stars~1.8k tokensUpdated today
    Productivity & AutomationAuto-check passed

More from olasunkanmi-SE/codebuddy

All 11 skills in this repo
  • Datadog

    olasunkanmi-SE/codebuddy

    Query metrics, manage monitors, post events, and interact with Datadog via the dogshell CLI.

    141 GitHub stars~1.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Telegram

    olasunkanmi-SE/codebuddy

    Send Telegram messages, files, and interact with Telegram bots via the telegram-send CLI tool.

    141 GitHub stars~817 tokensUpdated 1 mo ago
    Auto-check passed
  • Elasticsearch

    olasunkanmi-SE/codebuddy

    Interact with Elasticsearch clusters via the API. An agent skill from olasunkanmi-SE/codebuddy.

    141 GitHub stars~425 tokensUpdated 1 mo ago
    Auto-check passed
  • GitHub

    olasunkanmi-SE/codebuddy

    Manage GitHub repositories, issues, and pull requests via the gh CLI.

    141 GitHub stars~611 tokensUpdated 1 mo ago
    Auto-check: notes
  • GitLab

    olasunkanmi-SE/codebuddy

    Manage GitLab issues and merge requests via the glab CLI. An agent skill from olasunkanmi-SE/codebuddy.

    141 GitHub stars~476 tokensUpdated 1 mo ago
    Auto-check: notes
  • Mysql

    olasunkanmi-SE/codebuddy

    Manage MySQL databases via the mysql CLI. An agent skill from olasunkanmi-SE/codebuddy.

    141 GitHub stars~399 tokensUpdated 1 mo ago
    Auto-check passed

Works with

Questions about Gmail

What does Gmail do?

Read, send, and manage Gmail emails via the gmail-cli tool. An agent skill from olasunkanmi-SE/codebuddy. Gmail is an agent skill from olasunkanmi-SE/codebuddy. Read, send, and manage Gmail emails via the gmail-cli tool.

When should I use Gmail?

Gmail fits situations like: tasks that involve Email management.

How do I install Gmail in Claude Code?

Run `npx skills add olasunkanmi-SE/codebuddy --skill gmail -a claude-code`. Or copy the skill folder (skills/gmail in olasunkanmi-SE/codebuddy) into .claude/skills/gmail in your project. Claude Code loads it when a task matches its description.

How do I install Gmail in Codex?

Run `npx skills add olasunkanmi-SE/codebuddy --skill gmail -a codex`. Or copy the skill folder (skills/gmail in olasunkanmi-SE/codebuddy) into .agents/skills/gmail in your project. Codex loads it when a task matches its description.

Can I use Gmail in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add olasunkanmi-SE/codebuddy --skill gmail -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gmail, .gemini/skills/gmail, .github/skills/gmail and .opencode/skills/gmail in your project.

What does Gmail need to run?

Going by SKILL.md and its folder, Gmail needs a shell and Python for the scripts in its folder and the command-line tools its instructions call (bash and pip). Our summary lists: Python 3; A Bash shell.

Does Gmail access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Gmail safe to install?

Our automated static check of SKILL.md flagged 1 warning(s): mentions a credentials file (ssh keys, cloud or package-manager tokens). Read the flagged lines before installing; the check is not a guarantee either way.

What licence does Gmail use?

Gmail is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Gmail use?

About 1.9k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Gmail?

Skills that share tags, products or a category with Gmail: Career-Ops Gmail Lead Plugin (career-ops-hq/career-ops, 74k stars), Gmail (team-attention/plugins-for-claude-natives, 825 stars), Connect Apps with Composio (ComposioHQ/awesome-claude-skills, 77k stars) and Gmail Email (open-gitagent/gitagent, 710 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Gmail?

olasunkanmi-SE (a GitHub user) maintains it in olasunkanmi-SE/codebuddy, which has 141 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on August 28, 2026.

Source: olasunkanmi-SE/codebuddy on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.