skills/claude-skills-open/skills/infra/google-auth/SKILL.md
Google OAuth setup, refresh tokens
npx skillsauth add aaaaqwq/claude-code-skills google-authInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Google OAuth setup, refresh tokens, troubleshooting
| What | Path |
|------|------|
| Credentials | $GOOGLE_TOOLS_PATH/credentials.json |
| Token | $GOOGLE_TOOLS_PATH/token.json |
SCOPES = [
'https://www.googleapis.com/auth/gmail.send',
'https://www.googleapis.com/auth/gmail.readonly',
'https://www.googleapis.com/auth/spreadsheets',
'https://www.googleapis.com/auth/calendar',
'https://www.googleapis.com/auth/documents',
'https://www.googleapis.com/auth/drive',
]
import json
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
with open('$GOOGLE_TOOLS_PATH/token.json', 'r') as f:
token_data = json.load(f)
creds = Credentials(
token=token_data.get('token'),
refresh_token=token_data.get('refresh_token'),
token_uri=token_data.get('token_uri'),
client_id=token_data.get('client_id'),
client_secret=token_data.get('client_secret')
)
# Gmail
gmail = build('gmail', 'v1', credentials=creds)
# Sheets
sheets = build('sheets', 'v4', credentials=creds)
# Drive
drive = build('drive', 'v3', credentials=creds)
from google.auth.transport.requests import Request
if creds.expired and creds.refresh_token:
creds.refresh(Request())
# Save the updated token
with open('$GOOGLE_TOOLS_PATH/token.json', 'w') as f:
json.dump({
'token': creds.token,
'refresh_token': creds.refresh_token,
'token_uri': creds.token_uri,
'client_id': creds.client_id,
'client_secret': creds.client_secret,
}, f)
from google_auth_oauthlib.flow import InstalledAppFlow
SCOPES = [...] # all required scopes
flow = InstalledAppFlow.from_client_secrets_file(
'$GOOGLE_TOOLS_PATH/credentials.json',
SCOPES
)
creds = flow.run_local_server(port=0)
# Save
with open('$GOOGLE_TOOLS_PATH/token.json', 'w') as f:
json.dump({
'token': creds.token,
'refresh_token': creds.refresh_token,
'token_uri': creds.token_uri,
'client_id': creds.client_id,
'client_secret': creds.client_secret,
}, f)
result = sheets.spreadsheets().values().get(
spreadsheetId='SPREADSHEET_ID',
range="'Sheet Name'!A1:Z100"
).execute()
rows = result.get('values', [])
sheets.spreadsheets().values().update(
spreadsheetId='SPREADSHEET_ID',
range="'Sheet Name'!A1",
valueInputOption='RAW',
body={'values': [['value1', 'value2']]}
).execute()
import base64
from email.mime.text import MIMEText
message = MIMEText('Body text', 'plain', 'utf-8')
message['to'] = '[email protected]'
message['from'] = 'Your Name <[email protected]>'
message['subject'] = 'Subject'
raw = base64.urlsafe_b64encode(message.as_bytes()).decode()
gmail.users().messages().send(userId='me', body={'raw': raw}).execute()
| Problem | Solution | |---------|----------| | 401 Unauthorized | Refresh token or create a new one | | invalid_grant | Token revoked, create a new one | | Scope mismatch | Load token without scope verification | | RefreshError | Create a new token via OAuth flow |
[email protected]email-send-direct -- single email via Gmail APIemail-send-bulk -- bulk email via Gmail APItelegram-send -- reads Sheets for datatesting
通用自媒体文章自动发布工具。支持百家号、搜狐号、知乎、微信公众号、小红书、抖音号六个平台的自动化发布流程。使用Playwright自动化实现平台导航和发布,支持通过storageState管理Cookie实现账号切换。
development
# SKILL.md - Model Configuration Status (mcstatus) ## 触发条件 - `/mcstatus` 命令 - 用户询问模型配备、模型配置、model status、模型列表等 ## 功能 实时生成 Agent + Cron 的模型配置报告,展示当前所有 agent 的主模型/fallback链和所有 cron 任务的模型分配。 ## 执行步骤 ### Step 1: 收集 Agent 模型配置 读取各 agent 的 models.json 获取主模型和 fallback 链: ```bash for agent in main ops code quant data research content market finance pm law product sales batch; do config=$(cat ~/.openclaw/agents/$agent/agent/models.json 2>/dev/null) if [ -n "$config" ]; then echo "=== $agent
tools
MCP 服务器智能管理助手。自动检测 MCP 可用性、智能开关、功能问答,提供人性化的 MCP 管理体验。
tools
从GitHub搜索并自动安装配置MCP(Model Context Protocol)服务器工具到Claude配置文件。当用户需要安装MCP工具时触发此技能。工作流程:搜索GitHub上的MCP项目 -> 提取npx配置 -> 添加到~/.claude.json -> 处理API密钥(如有)。