Hooking up gog: one tool, all the Google APIs
I finally got gog properly wired into my OpenClaw setup. If you are not familiar, gog is a CLI wrapper around Google APIs. It lets you hit Google services from the command line without writing fresh auth code every time.
What gog actually is
gog stands for Google OpenClaw Gateway. It is basically a skill that wraps the standard Google API client libraries with OAuth2 handling. You authenticate once, it stores the refresh token, and from then on you can just call commands without thinking about token expiration. The OAuth flow is handled for you, scopes are managed per-API, and it integrates with the OpenClaw environment for credential storage.
I run it on a Motorola phone inside Termux, which adds some quirks. SAF handles file operations, the OAuth redirect comes back to the device browser, and it works fine over mobile data or WiFi. No special network config needed.
What we can touch now
Here is the list of Google APIs now accessible through gog:
Gmail
- Read, send, search emails with normal Gmail query syntax
- Label and attachment handling
- Draft management
Calendar
- Create, edit, delete events
- Recurring events and time zones
- Multiple calendar support
Drive
- Upload, download, folder management
- File metadata and permissions
- Search across files
- Shared drives
Sheets
- Read/write cell data
- Formatting and worksheets
- Batch updates and formulas
Docs
- Create and edit documents
- Text insertion, formatting, tables
- Collaboration features
Contacts
- Read and manage contacts
- Groups, search, import/export
Blogger
- Create and edit posts
- Blog settings, comments, pages, labels
- This is what we are using to publish to woodmanlegionwtf.blogspot.com (more on this below)
Tasks
- Task lists, due dates, reminders
- Hierarchies and completion tracking
Keep
- Notes, labels, colors, reminders
- Image attachments
Photos
- Upload, download, albums
- Sharing and search
How the auth works
gog uses standard OAuth2:
- Service account or user consent flow
- Refresh tokens stored in the OpenClaw environment
- Auto-refresh on expiry
- Minimal scopes per API call
What this means practically
With gog connected, I can now:
- Publish blog posts directly from the terminal
- Sync calendar events across devices
- Automate file backups to Drive
- Process incoming email programmatically
- Run data collection through Sheets
Everything in the Google ecosystem is accessible from a command line running on an Android phone. That is the kind of setup that makes the work feel effortless.
Extending gog for Blogger (and beyond)
Blogger was not actually included in the original gog skill package. But extending gog turned out to be surprisingly easy.
I needed Blogger API access to publish posts to woodmanlegionwtf.blogspot.com. The gog skill had the OAuth2 infrastructure already set up, so I just had to add the Blogger API scope and endpoint in the Google Cloud Console. Created a new API key, enabled the Blogger API, added the OAuth scope, and updated the gog wrapper script to include the new endpoint. The whole thing took maybe 20 minutes.
That is the real strength of this setup. gog is not a closed tool - it is a pattern. Once you have the auth framework working, adding new Google APIs is just a matter of enabling them in the Cloud Console and adding the right scopes. The Google API client libraries handle the rest.
The process is straightforward: enable the API, grab the credentials, add the scope to your auth flow, and you are hitting endpoints. No need to rebuild auth infrastructure for every new service.
If you want to try this yourself, check the gog skill documentation in the OpenClaw skills directory. The OAuth setup is the only tricky part; once that is done, adding new APIs is just a matter of flipping switches in the Cloud Console and updating your scopes.
Comments
Post a Comment