{"id":15966612,"url":"https://github.com/swinton/gmail-repl","last_synced_at":"2025-04-04T13:27:03.336Z","repository":{"id":167665724,"uuid":"643291961","full_name":"swinton/gmail-repl","owner":"swinton","description":"A REPL for GMail","archived":false,"fork":false,"pushed_at":"2023-08-08T15:35:08.000Z","size":39,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-09T23:17:09.672Z","etag":null,"topics":["cli","gmail","gmail-api","nodejs","repl","shell"],"latest_commit_sha":null,"homepage":"https://github.com/swinton/gmail-repl","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swinton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2023-05-20T17:40:29.000Z","updated_at":"2024-04-16T05:53:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"d12bd8eb-9f50-42f7-addd-a484a10837e2","html_url":"https://github.com/swinton/gmail-repl","commit_stats":null,"previous_names":["swinton/gmail-repl"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swinton%2Fgmail-repl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swinton%2Fgmail-repl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swinton%2Fgmail-repl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swinton%2Fgmail-repl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swinton","download_url":"https://codeload.github.com/swinton/gmail-repl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247184070,"owners_count":20897705,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cli","gmail","gmail-api","nodejs","repl","shell"],"created_at":"2024-10-07T18:02:28.407Z","updated_at":"2025-04-04T13:27:03.318Z","avatar_url":"https://github.com/swinton.png","language":"JavaScript","readme":"# 🔁 `gmail-repl`\n\n\u003e A REPL for GMail\n\n## Setup\n\nFollow [the Node.js quickstart](https://developers.google.com/gmail/api/quickstart/nodejs) from the Gmail for Developers guide, and make sure your [desktop application credentials](https://developers.google.com/gmail/api/quickstart/nodejs#authorize_credentials_for_a_desktop_application) are stored in a `credentials.json` file -- see [`credentials-example.json`](credentials.example.json) for an example.\n\n## Usage\n```shell\n./repl.js\n```\n\n## Examples\n\n### Get profile\n\u003e [`users.getProfile`](https://developers.google.com/gmail/api/reference/rest/v1/users/getProfile)\n\n```javascript\nawait profile()\n```\n\n### List messages\n\u003e [`users.messages.list`](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/list)\n\n- See: [Search operators you can use with Gmail](https://support.google.com/mail/answer/7190?hl=en)\n\n```javascript\n// List all messages\nawait messages()\n\n// List all from \u003cemail\u003e\nawait messages('from:me@example.com')\n\n// List unread from \u003cemail\u003e sent after \u003cdate\u003e\nawait messages('from:me@example.com is:unread after:2023/05/19')\n```\n\n### Read a message\n\u003e [`users.messages.get`](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/get)\n\n```javascript\nawait message('1883a5111e8ef47c')\n```\n\n### List threads\n\u003e [`users.threads.list`](https://developers.google.com/gmail/api/reference/rest/v1/users.threads/list)\n\n- See: [Search operators you can use with Gmail](https://support.google.com/mail/answer/7190?hl=en)\n\n```javascript\n// List all threads\nawait threads()\n\n// List all from \u003cemail\u003e\nawait threads('from:me@example.com')\n\n// List unread from \u003cemail\u003e sent after \u003cdate\u003e\nawait threads('from:me@example.com is:unread after:2023/05/19')\n\n```\n\n### Read a thread\n\u003e [`users.threads.get`](https://developers.google.com/gmail/api/reference/rest/v1/users.threads/get)\n\n```javascript\nawait thread('1883b361aaef86b6')\n```\n\n### Batch delete\n\u003e [`users.messages.batchDelete`](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/batchDelete)\n\n- See: [Search operators you can use with Gmail](https://support.google.com/mail/answer/7190?hl=en)\n\n#### Batch delete unimportant promotional messages\n\n```javascript\nawait batchDeleteMessages('category:promotions -is:important -is:starred')\n```\n\n#### Batch delete messages from before 2021\n\n```javascript\nawait batchDeleteMessages('before:2021/01/01')\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswinton%2Fgmail-repl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswinton%2Fgmail-repl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswinton%2Fgmail-repl/lists"}