google-oauth

Run a local Google OAuth 2.0 flow with token persistence to .env.

Updated Feb 14, 2026
One-click install
npx skills add https://github.com/Shakudo-io/opencode-skills --skill google-oauth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: google-oauth
Source: https://github.com/Shakudo-io/opencode-skills/tree/main/google-oauth
Command: npx skills add https://github.com/Shakudo-io/opencode-skills --skill google-oauth

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires httpx, python-dotenv, and includes scripts (resource) components.

What problem does it solve?

Self-hosted Google OAuth 2.0 authentication with a local callback server and token persistence, removing the need for external intermediaries.

Core Features & Use Cases

  • Local OAuth callback server on port 3000 to capture authorization redirects.
  • Exchange authorization codes for access and refresh tokens and persist them to a .env file.
  • Automatic token refresh and support for Gmail, Calendar, Drive, and Google Ads APIs.

Quick Start

Set up a Google Cloud OAuth Client ID and Secret, then run python auth_flow.py --scopes gmail_full to start the interactive flow and save tokens to .env.

Frequently Asked Questions about google-oauth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a self-hosted Google OAuth 2.0 flow with a local callback server?

A self-hosted Google OAuth 2.0 flow uses a local callback server on port 3000 to capture authorization redirects, exchange codes for tokens, and persist them locally for offline reuse without external intermediaries.

How do I persist and refresh Google API access tokens offline?

You can persist and refresh Google API access tokens offline by exchanging authorization codes for access and refresh tokens, then saving them directly to a .env file for environment-driven configuration and automatic token refresh.

Can I use a local server for Google OAuth with Gmail, Calendar, and Drive APIs?

Yes, the local OAuth callback server supports Gmail, Calendar, Drive, and Google Ads APIs by running an interactive flow to capture redirects, exchange tokens, and enable offline API access.

What is the best way to store Google OAuth tokens in a .env file?

The best way to store Google OAuth tokens in a .env file is using a self-contained client-side workflow that exchanges authorization codes for tokens and persists them via python-dotenv for offline reuse.

Do I need a Google Cloud OAuth Client ID and Secret to run a local token exchange?

Yes, you need a Google Cloud OAuth Client ID and Secret to run the interactive authentication flow, which starts the local server, captures the callback, and saves the resulting tokens to your environment.

Why does my Google OAuth flow require a local callback URL?

Your Google OAuth flow requires a local callback URL to dynamically capture the authorization redirect, complete the token exchange locally, and remove the need for external intermediary services.