
Security News
The Nightmare Before Deployment
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.
gmaillm
Advanced tools
LLM-friendly Gmail API wrapper with CLI and progressive disclosure patterns.
For the simplest installation with automatic setup:
cd /path/to/gmaillm
# Install globally and setup shell completion
make install
make verify
make install-completion
See make help for all available targets.
cd /path/to/gmaillm
pip3 install --break-system-packages -e .
For faster typing with tab-completion support:
# 1. Install the package
pip3 install --break-system-packages -e .
# 2. Install shell completions
gmail --install-completion
# 3. Restart your shell
exec $SHELL
Note: After running --install-completion, you'll see a message confirming the completion script was installed. Restart your shell to activate it.
~/.bash_completion.d/ or ~/.bashrc~/.zshrc or completion directory~/.config/fish/completions/gmaillm automatically detects whether it's running as a plugin or standalone:
Plugin mode (when CLAUDE_PLUGIN_ROOT is set):
${CLAUDE_PLUGIN_ROOT}/credentials/${CLAUDE_PLUGIN_ROOT}/credentials/oauth-keys.json${CLAUDE_PLUGIN_ROOT}/credentials/credentials.jsonStandalone mode (default):
~/.gmaillm/~/.gmaillm/oauth-keys.json~/.gmaillm/credentials.jsonObtain OAuth2 credentials from Google Cloud Console:
oauth-keys.json~/.gmaillm/oauth-keys.json (recommended for standalone)${CLAUDE_PLUGIN_ROOT}/credentials/oauth-keys.json (for plugin use)~/Desktop/OAuth2/gcp-oauth.keys.json (fallback)Authenticate with Gmail:
gmail setup-auth
This will:
Verify setup:
gmail verify
If you see "Credentials file is empty" error:
# Run authentication setup
python3 -m gmaillm.setup_auth
# If port 8080 is in use, specify a different port
python3 -m gmaillm.setup_auth --port 8081
If you see "Address already in use" error:
# Kill any existing auth processes
pkill -f "gmaillm.setup_auth"
# Try a different port
python3 -m gmaillm.setup_auth --port 9999
# Verify setup
gmail verify
# List emails
gmail list
gmail list --folder SENT --max 5
# Read email
gmail read <message_id>
gmail read <message_id> --full
# View thread
gmail thread <message_id>
# Search
gmail search "from:example@gmail.com has:attachment"
# Reply
gmail reply <message_id> --body "Thanks for the update!"
# Send
gmail send --to user@example.com --subject "Test" --body "Hello"
# List folders
gmail folders
# Manage labels
gmail label list # List all labels (system and custom)
gmail label create MyLabel # Create a new label
# Manage email styles
gmail styles list # List all email styles
gmail styles show professional-formal # View a specific style
gmail styles create my-style # Create a new style
gmail styles validate my-style # Validate style format
gmail styles validate-all --fix # Validate and auto-fix all styles
gmaillm supports a flexible email style system that allows you to define different writing styles for various contexts. Each style includes templates, formatting guidelines, and usage patterns.
# List all styles
gmail styles list
# View a specific style
gmail styles show professional-formal
# Create a new style (opens editor)
gmail styles create my-new-style
# Edit an existing style (opens editor)
gmail styles edit casual-friend
# Delete a style
gmail styles delete old-style
gmail styles delete old-style --force # Skip confirmation
# Validate style format
gmail styles validate my-style
gmail styles validate my-style --fix # Auto-fix formatting issues
# Validate all styles
gmail styles validate-all
gmail styles validate-all --fix # Auto-fix all styles
Each style file uses YAML frontmatter and XML-like sections:
---
name: "Style Name"
description: "When to use: Context description with usage guidance."
---
<examples>
Example email 1
---
Example email 2
</examples>
<greeting>
- "Hi [Name],"
- "Hello [Name],"
</greeting>
<body>
- Writing guideline 1
- Writing guideline 2
</body>
<closing>
- "Best,"
- "Thanks,"
</closing>
<do>
- What to do
- Best practices
</do>
<dont>
- What to avoid
- Common mistakes
</dont>
Required sections (in strict order):
examples - Example emails showing the style in actiongreeting - Greeting patterns and guidelinesbody - Body content guidelinesclosing - Closing patternsdo - Best practicesdont - Things to avoidSee STYLES.md for complete style guide documentation.
Process emails interactively with prompts for each action:
# Run named workflow
gmail workflows run clear
# Run with custom query
gmail workflows run --query "is:unread from:boss@example.com"
Process emails programmatically with continuation tokens for automation:
# Start workflow (returns JSON with token + first email)
gmail workflows start clear
# Continue with actions (returns next email + same token)
gmail workflows continue <token> archive
gmail workflows continue <token> skip
gmail workflows continue <token> reply --reply-body "Thanks!"
gmail workflows continue <token> view # View full body
gmail workflows continue <token> quit # End workflow
JSON Response:
{
"success": true,
"token": "abc123...",
"email": { /* full email data */ },
"message": "Archived",
"progress": {"total": 10, "processed": 3, "remaining": 7, "current": 4},
"completed": false
}
Automation Example:
# Archive all unread emails
TOKEN=$(gmail workflows start clear | jq -r '.token')
while [ "$TOKEN" != "null" ]; do
RESULT=$(gmail workflows continue "$TOKEN" archive)
TOKEN=$(echo "$RESULT" | jq -r '.token')
done
gmail workflows list # List configured workflows
gmail workflows show clear # View workflow details
gmail workflows create daily \
--query "is:unread" \
--auto-mark-read # Create new workflow
gmail workflows cleanup # Remove expired states
from gmaillm import GmailClient
client = GmailClient()
# List emails
result = client.list_emails(folder='INBOX', max_results=10)
print(result.to_markdown())
# Read email
email = client.read_email(message_id, format="summary")
print(email.to_markdown())
Once you've installed shell completions (gmail --install-completion), you can:
gmail l and press <TAB> → expands to available commandsgmail send --to user and press <TAB> → shows field completionsgmail and press <TAB> → shows all available commands# Most common commands
gmail verify # Check if setup is working
gmail status # See your inbox status
gmail list # Show recent emails
gmail search "from:someone@example.com" # Find specific emails
gmail send --to user@example.com \
--subject "Hello" --body "Hi there" # Send an email
# Get help for a specific command
gmail send --help
gmail search --help
make test # Run full test suite with coverage
uv run pytest tests/ # Run tests directly
FAQs
LLM-friendly Gmail API wrapper with CLI and progressive disclosure patterns
We found that gmaillm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.

Research
/Security News
Impostor NuGet package Tracer.Fody.NLog typosquats Tracer.Fody and its author, using homoglyph tricks, and exfiltrates Stratis wallet JSON/passwords to a Russian IP address.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.