skills/claude-skills-open/skills/infra/google-auth/SKILL.md
Google OAuth setup, refresh tokens
npx skillsauth add aaaaqwq/agi-super-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
AI驱动的智能浏览器自动化工具。使用LLM理解页面并自动执行任务,比传统Playwright更智能、更省token。适用于复杂交互、动态页面、需要智能决策的浏览器操作。Chrome浏览器优先。
tools
网页登录态管理。使用 fast-browser-use (fbu) 管理各平台登录状态,定期检查可用性,新平台授权时自动保存 profile。
development
Monitor and report on API provider quotas, balances, and usage. Query official providers (Moonshot, DeepSeek, xAI, Google AI Studio) and relay/proxy providers (Xingjiabiapi, Aixn, WoW) via their billing APIs. Also checks subscription services (Brave Search, OpenRouter). Generates quota reports. Triggers on "查额度", "API余额", "quota check", "billing report", "api balance", "供应商额度", "中转站余额", "费用报告", "check balance", "how much credit".
development
# A股基金监控 Skill A股基金净值监控,支持实时估值和盘后净值,自动判断交易日/节假日。 ## 用法 ### 快速监控(命令行) ```bash # 默认配置,输出到控制台 bash ~/clawd/skills/a-fund-monitor/scripts/monitor.sh # 推送到群(使用--push参数) bash ~/clawd/skills/a-fund-monitor/scripts/monitor.sh --push # 监控指定基金 bash ~/clawd/skills/a-fund-monitor/scripts/monitor.sh --codes "000979 002943" ``` ### Agent调用 ``` 执行A股基金监控任务。 1. 读取配置文件: ~/clawd/skills/a-fund-monitor/config.json 2. 获取实时净值数据 3. 非交易日自动切换为简短报告 配置文件格式: { "funds": [ {"code": "000979", "name": "景顺长城沪港深精选股票