跳到正文
TakoAPI
返回技能列表

gmail-oauth

由 kai-jar 提供

DevOps & Cloud
3.2k下载量由 clawskills.sh 提供
7星标
2浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Set up Gmail API access via gog CLI with manual OAuth flow.

描述

该技能的功能

Sets up Gmail API access using the `gog` CLI with a headless-compatible OAuth flow. Handles credential configuration, token exchange, and common authentication errors for personal or server-side Gmail integrations.

The `gog` CLI with file-based keyring makes OAuth token management work on headless servers where browser-based flows are impractical.

何时使用

  • Authorizing Gmail access on a headless server
  • Renewing expired OAuth tokens without a browser on the server
  • Setting up Gmail API for a personal automation script
  • Troubleshooting OAuth errors like invalid_grant or redirect_uri_mismatch
  • Configuring Gmail integration for a self-hosted email tool

示例工作流

输入

User asks: set up Gmail OAuth on my headless server

智能体
  1. 1

    Install gog CLI via brew and create a Google Cloud project with Gmail API enabled

  2. 2

    Download OAuth client secret JSON (Desktop app type) from Google Cloud Console

  3. 3

    Run gog auth credentials with the JSON file and configure file-based keyring

  4. 4

    Generate the OAuth URL, open it in a desktop browser, approve permissions, and copy the auth code

  5. 5

    Exchange the code immediately using the auth script and verify access with a test search

输出

Gmail API access configured with a permanent refresh token stored in file-based keyring

前置要求

  • Google Cloud project with Gmail API enabled
  • OAuth 2.0 client credentials JSON file (Desktop app type) from Google Cloud Console
  • gog CLI (`brew install steipete/tap/gogcli`)
  • GOG_KEYRING_PASSWORD environment variable

安装

clawhub install kai-jar/gmail-oauth

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接