{"id":47809548,"url":"https://github.com/patrick91/gmail-cli","last_synced_at":"2026-04-03T18:04:18.454Z","repository":{"id":335001505,"uuid":"1136421153","full_name":"patrick91/gmail-cli","owner":"patrick91","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-27T23:26:47.000Z","size":131,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-19T07:50:10.087Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patrick91.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-17T16:59:06.000Z","updated_at":"2026-01-27T23:26:51.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/patrick91/gmail-cli","commit_stats":null,"previous_names":["patrick91/gmail-cli"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/patrick91/gmail-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrick91%2Fgmail-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrick91%2Fgmail-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrick91%2Fgmail-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrick91%2Fgmail-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrick91","download_url":"https://codeload.github.com/patrick91/gmail-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrick91%2Fgmail-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31368157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T17:53:18.093Z","status":"ssl_error","status_checked_at":"2026-04-03T17:53:17.617Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-03T18:04:18.339Z","updated_at":"2026-04-03T18:04:18.427Z","avatar_url":"https://github.com/patrick91.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gmail-cli\n\nA CLI tool for syncing Gmail to a local SQLite database, optimized for agent workflows. Enables fast local search and reads without hitting the Gmail API on every query.\n\n## Installation\n\n```bash\npip install -e .\n```\n\n## Quick Start\n\n1. **Authenticate with Gmail:**\n   ```bash\n   gmail-cli auth oauth\n   ```\n\n   Follow the wizard to set up OAuth2 credentials from Google Cloud Console.\n\n2. **Sync your Gmail:**\n   ```bash\n   gmail-cli sync full\n   ```\n\n   This will download all your Gmail messages to a local SQLite database.\n\n3. **Search your messages:**\n   ```bash\n   gmail-cli search \"invoice\"\n   ```\n\n4. **Read a message:**\n   ```bash\n   gmail-cli read \u003cmessage-id\u003e\n   ```\n\n## Authentication\n\nThe tool uses OAuth2 to authenticate with Gmail. You'll need to:\n\n1. Create a Google Cloud project\n2. Enable the Gmail API\n3. Create OAuth2 credentials (Desktop app)\n4. Download and save the credentials to `~/.gmail-cli/credentials.json`\n\nRun `gmail-cli auth oauth` for a step-by-step wizard.\n\n## Configuration\n\nAll data is stored in `~/.gmail-cli/`:\n- `credentials.json` - Your OAuth credentials\n- `token.json` - Auto-generated OAuth tokens\n- `gmail.db` - SQLite database (created after first sync)\n- `attachments/` - Downloaded attachments\n\n## Commands\n\n### Authentication\n- `gmail-cli auth oauth` - Set up OAuth2 authentication\n- `gmail-cli auth status` - Show authentication status\n- `gmail-cli auth logout` - Clear stored credentials\n\n### Status\n- `gmail-cli status` - Show overall status (auth, database, sync state)\n\n### Sync\n- `gmail-cli sync full` - Full sync of all Gmail messages (resumes if interrupted)\n- `gmail-cli sync full --force` - Force fresh sync from scratch\n- `gmail-cli sync full --workers 2` - Adjust concurrent workers (1-10)\n- `gmail-cli sync incremental` - Only sync changes since last sync\n\n### Search\n- `gmail-cli search \"query\"` - Search messages using FTS5 full-text search\n- `gmail-cli search \"query\" --limit 100` - Limit number of results\n- `gmail-cli search \"query\" --json` - Output as JSON for agents\n\nSupports FTS5 syntax:\n- Simple: `gmail-cli search \"invoice\"`\n- Phrase: `gmail-cli search '\"quarterly report\"'`\n- Boolean OR: `gmail-cli search \"invoice OR receipt\"`\n- Boolean NOT: `gmail-cli search \"meeting NOT cancelled\"`\n\n### Read\n- `gmail-cli read \u003cmessage-id\u003e` - View a message\n- `gmail-cli read \u003cmessage-id\u003e --raw` - Show raw headers and body\n- `gmail-cli read \u003cmessage-id\u003e --json` - Output as JSON\n\n### Threads\n- `gmail-cli thread \u003cthread-id\u003e` - View all messages in a thread\n- `gmail-cli thread \u003cthread-id\u003e --json` - Output as JSON\n\n### Attachments\n- `gmail-cli attachments list \u003cmessage-id\u003e` - List message attachments\n- `gmail-cli attachments download \u003cattachment-id\u003e` - Download attachment\n- `gmail-cli attachments download \u003cattachment-id\u003e -o path` - Download to specific path\n\n## Development\n\nSee [PLAN.md](PLAN.md) for the full implementation plan.\n\n## Tech Stack\n\n- Python 3.12+\n- Typer + rich-toolkit for CLI\n- SQLite + FTS5 for storage and search\n- Google APIs for Gmail access\n- SQLModel for database models\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrick91%2Fgmail-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrick91%2Fgmail-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrick91%2Fgmail-cli/lists"}