Created
June 19, 2026 16:08
-
-
Save erikologic/935e7171711152198b17641d9b4213a4 to your computer and use it in GitHub Desktop.
Restish + Gmail CLI - OAuth pagination tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Restish + Gmail CLI | |
| Complete setup for using restish CLI with Gmail API. | |
| ## Files | |
| - `restish` - This overview | |
| - `paginate` - Pagination handler | |
| - `CONFIGURATION.md` - OAuth setup | |
| ## Quick Start | |
| ```bash | |
| restish gmail gmail-users-labels-list me | |
| ``` | |
| ## Usage | |
| ### Paginate | |
| ```bash | |
| paginate '.nextPageToken' '.messages[]' restish gmail gmail-users-messages-list me | |
| paginate '.nextPageToken' '.labels[]' restish gmail gmail-users-labels-list me | |
| ``` | |
| ### Label operations | |
| ```bash | |
| restish gmail gmail-users-messages-modify me MSG_ID -d '{"addLabelIds": ["LABEL_ID"]}' | |
| restish gmail gmail-users-messages-modify me MSG_ID -d '{"removeLabelIds": ["LABEL_ID"]}' | |
| ``` | |
| ### Bulk | |
| ```bash | |
| sqlite3 data/gmail.db "SELECT id FROM messages WHERE sender='spam'" | \ | |
| while read id; do | |
| restish gmail gmail-users-messages-modify me "$id" -d '{"addLabelIds": ["TRASH"]}' | |
| done | |
| ``` | |
| All 79 operations: `restish gmail --help` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment