A fast, powerful, and script-friendly CLI for Google services.
Built with Python for performance and reliability.
Based on steipete/gogcli β the original project was built in Go.
This project is a Python reimplementation with added LLM support more advanced AI support.
Features β’ Installation β’ Quick Start β’ Commands β’ Agent
|
|
|
|
| Feature | Description |
|---|---|
| π€ Natural Language Agent | Ask in plain English β supports DeepSeek, OpenAI, Gemini & Anthropic |
| π Web Search | Real-time access to news, prices, and weather |
| π Secure Storage | OS-level keyring for sensitive tokens |
| π» JSON Output | Perfect for automation and scripting |
| π₯ Multi-Account | Manage multiple Google accounts with aliases |
# Clone the repository
git clone https://github.com/pygog/pygog.git
cd pygog
# Install in editable mode
pip install -e .Note: Requires Python 3.10 or higher.
- Go to the Google Cloud Console
- Create a new project
- Enable the Gmail, Drive, Calendar, and Tasks APIs
- Create an OAuth Client ID (Desktop App)
- Download the credentials JSON file
pygog auth credentials path/to/credentials.json# Opens browser for secure OAuth flow
pygog auth add your.email@gmail.com --services gmail,drive,calendar,tasksβ You're ready to go!
The killer feature of pygog β talk to your Google Workspace in plain English.
Set your preferred LLM API key:
# Choose one (PowerShell)
$env:DEEPSEEK_API_KEY = "sk-..."
$env:OPENAI_API_KEY = "sk-..."
$env:GEMINI_API_KEY = "AIza..."
$env:ANTHROPIC_API_KEY = "sk-ant..."
$env:OPENROUTER_API_KEY = "sk-or...""Set a calendar event" β’ "List all my calendar events and tasks"
"Hello" β’ "List all emails received today" β’ "Add to tasks"
"Fetch the last sent email with its content"
# Email & Drive
pygog ask "Find the Q4 report PDF and email it to my boss"
pygog ask "What unread emails do I have?"
# Calendar & Tasks
pygog ask "What meetings do I have this week?"
pygog ask "Remind me to call John tomorrow at 2pm"
# Web Search
pygog ask "What is the gold price in Delhi today?"
pygog ask "Latest tech news"
# Specify model (optional)
pygog ask "Summarize my emails" --model gpt-4o# Search for recent emails
pygog gmail search "from:boss newer_than:1d" --max 5
# Send an email
pygog gmail send --to "friend@example.com" --subject "Hello" --body "Sent from pygog!"
# List your labels
pygog gmail labels list# List files in root directory
pygog drive ls --max 10
# Download and export as PDF
pygog drive download <FILE_ID> --format pdf --out report.pdf
# Upload a file
pygog drive upload ./backup.zip --name "Weekly Backup"# View today's events
pygog calendar events --today
# Create a new event
pygog calendar create --summary "Team Meeting" --from "2026-02-01T10:00:00" --to "2026-02-01T11:00:00"
# Check availability
pygog calendar freebusy --calendars "user1@org.com,user2@org.com" --from "today" --to "tomorrow"# List all task lists
pygog tasks lists
# View tasks in a list
pygog tasks list <TASKLIST_ID>
# Add a new task
pygog tasks add <TASKLIST_ID> --title "Review PR" --due "tomorrow"Stop typing long email addresses:
# Set an alias
pygog auth alias set work "primary.work.account@company.com"
# Use it anywhere
pygog --account work gmail search "urgent"pygog config set default_account your.email@gmail.com| Format | Flag | Use Case |
|---|---|---|
| Table | (default) | Human-readable terminal output |
| JSON | --json |
Scripting with jq |
| Plain | --plain |
TSV-style for grep/awk |
# Example: Get first file ID from Drive
pygog --json drive ls | jq '.[0].id'Your security is our priority:
- π Keyring Integration β OAuth tokens stored in OS-level secure storage
- macOS: Keychain
- Windows: Credential Manager
- Linux: Secret Service
- π« No Plaintext β Tokens are never stored in plaintext files
- β OAuth 2.0 β Industry-standard secure authentication
- Google Meet integration
- Contacts support
- Keep notes management
- Interactive TUI mode
- Vim-style keybindings
Contributions are welcome! Feel free to:
- Fork the repository
- Create a feature branch
- Submit a pull request
- Inspired by and based on steipete/gogcli
- Original implementation was written in Go
- This version is implemented in Python and adds LLM support
This project is licensed under the MIT License β see the LICENSE file for details.