360 Secure SkillHub
360 安全技能中心

Google Gog

该 Skill 说明如何通过 gog CLI 管理 Google 服务(Gmail、Drive、Calendar)的 OAuth 令牌:令牌在 API 调用时自动刷新,失效时用 gog auth add 重新授权;无头环境改用文件钥匙串并设置密码,另提供 Gmail 发送与搜索、Drive 列举/上传/下载及令牌有效性检查命令。

herry3zz
herry3zz
热度 82.67
最近更新 2026-05-18 12:09:19
分类:自动化依赖:第三方 API / 代码执行应用场景:自动化脚本 / 邮件起草 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add google-gog
Metadata
name
Google Services (gog CLI)
description
OAuth token refresh management for Google APIs via gog CLI.
slug
google-gog
tags
["google","gmail","drive","oauth","gog","credentials"]

Google Services (gog CLI)

Configuration

  • Account: xtyherry@gmail.com
  • Credentials: ~/.openclaw/credentials/client_secret.json
  • Token Storage: OS Keyring (auto-encrypted)

Refresh Token Lifecycle

Tokens auto-refresh transparently on API calls. No action needed.

If token invalid:

gog auth add xtyherry@gmail.com --services gmail,drive,calendar --manual --force-consent

For automation (cron/headless):

export GOG_KEYRING_BACKEND=file
export GOG_KEYRING_PASSWORD=<password>
gog auth list --check  # Check token validity and expiration

Quick Commands

# Gmail: send, search
gog gmail send user@example.com --subject "Hi" --body "Message"
gog gmail search "newer_than:7d"

# Drive: list, upload, download
gog drive ls /
gog drive upload file.txt /
gog drive download /file.txt ./output.txt

# Check token health
gog auth list --check