结构变化
This commit is contained in:
285
raw/Skills/GOG-CLI-安装配置指南.md
Normal file
285
raw/Skills/GOG-CLI-安装配置指南.md
Normal file
@@ -0,0 +1,285 @@
|
||||
---
|
||||
title: 输出: /opt/homebrew/bin/gog
|
||||
source:
|
||||
author: shenwei
|
||||
published:
|
||||
created:
|
||||
description:
|
||||
tags: [gog, gog-cli, macos]
|
||||
---
|
||||
|
||||
#gog #gog-cli #macos
|
||||
|
||||
本文档记录在 macOS 系统上安装和配置 gog CLI 的完整步骤,以便通过命令行管理 Google Workspace(Gmail、Google Calendar、Google Drive、Google Contacts、Google Docs、Google Sheets)。
|
||||
|
||||
## 目录
|
||||
```table-of-contents
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 前置条件
|
||||
|
||||
- macOS 系统
|
||||
- Homebrew 已安装
|
||||
- Google 账号
|
||||
|
||||
---
|
||||
|
||||
## 安装步骤
|
||||
|
||||
### 1. 安装 gog CLI
|
||||
|
||||
使用 Homebrew 安装 gog CLI:
|
||||
|
||||
```bash
|
||||
brew install steipete/tap/gogcli
|
||||
```
|
||||
|
||||
验证安装:
|
||||
|
||||
```bash
|
||||
which gog
|
||||
# 输出: /opt/homebrew/bin/gog
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 配置 OAuth 凭证
|
||||
|
||||
### 1. 在 Google Cloud Console 创建 OAuth 凭证
|
||||
|
||||
1. 打开 [Google Cloud Console - Credentials](https://console.cloud.google.com/apis/credentials)
|
||||
2. 点击 **「创建凭证」** → 选择 **「OAuth 客户端 ID」**
|
||||
3. 应用类型选择 **「桌面应用」**
|
||||
4. 命名(例如:`gogcli`)
|
||||
5. 点击 **「创建」**
|
||||
6. 点击 **「下载 JSON」**,得到 `credentials.json` 文件
|
||||
|
||||
### 2. 移动凭证文件到 gogcli 配置目录
|
||||
|
||||
- 创建 gogcli 配置目录(如果不存在):
|
||||
|
||||
```bash
|
||||
mkdir -p "/Users/weishen/Library/Application Support/gogcli"
|
||||
```
|
||||
|
||||
- 移动下载的凭证文件:
|
||||
|
||||
```bash
|
||||
mv ~/Downloads/credentials.json "/Users/weishen/Library/Application Support/gogcli/credentials.json"
|
||||
```
|
||||
|
||||
- 使用命令指定凭证路径:
|
||||
```bash
|
||||
gog auth credentials /Users/weishen/Library/Application\ Support/gogcli/credentials.json
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 解除 Google 安全限制
|
||||
|
||||
### 问题描述
|
||||
|
||||
首次授权时,Google 会显示以下错误:
|
||||
|
||||
> 此应用未经 Google 验证
|
||||
> 此应用请求访问您 Google 账号中的敏感信息。在开发者让该应用通过 Google 验证之前,请勿使用该应用。
|
||||
|
||||
### 解决方法:添加测试用户
|
||||
|
||||
1. 打开 [Google Cloud Console - Credentials](https://console.cloud.google.com/apis/credentials)
|
||||
2. 找到你创建的 OAuth 客户端ID的项目,点击进入详情
|
||||
3. 找到 **「目标对象」**
|
||||
4. 找到 **「测试用户」** 部分
|
||||
5. 点击 **「添加用户」**
|
||||
6. 输入你的 Google 邮箱:`ishenwei@gmail.com`
|
||||
7. 保存
|
||||
|
||||
添加测试用户后,重新运行授权命令即可:
|
||||
|
||||
```bash
|
||||
gog auth add ishenwei@gmail.com --services gmail,calendar,drive,contacts,docs,sheets
|
||||
```
|
||||
|
||||
这会打开浏览器让你登录 Google 账号并授权。
|
||||
|
||||
---
|
||||
|
||||
## 启用Google API 服务(以 Gmail API 为例)
|
||||
|
||||
### 1. 核心原理
|
||||
|
||||
Google API 调用需要满足两层条件:
|
||||
|
||||
| 层级 | 控制内容 |
|
||||
| -------------- | ---------- |
|
||||
| OAuth | 用户身份 |
|
||||
| API Enablement | 是否允许调用 API |
|
||||
👉 即使 OAuth 成功,如果 API 未启用:
|
||||
|
||||
也会报错:
|
||||
403 accessNotConfigured
|
||||
|
||||
### 2. 典型错误示例
|
||||
|
||||
Gmail API has not been used in project XXX
|
||||
|
||||
👉 表示:
|
||||
|
||||
该 Project 未启用 Gmail API
|
||||
|
||||
### 3. 操作步骤
|
||||
|
||||
#### Step 1:进入 API 页面
|
||||
|
||||
Google Cloud Console
|
||||
→ APIs & Services
|
||||
→ Library
|
||||
#### Step 2:搜索 API
|
||||
|
||||
例如:
|
||||
Gmail API
|
||||
#### Step 3:启用
|
||||
|
||||
Enable
|
||||
#### Step 4:等待生效
|
||||
|
||||
30 秒 ~ 2 分钟(有延迟)
|
||||
#### Step 5:重新授权(关键)
|
||||
|
||||
gog auth revoke
|
||||
gog auth login
|
||||
|
||||
👉 原因:
|
||||
旧 token 不包含新权限
|
||||
|
||||
---
|
||||
## 验证配置
|
||||
|
||||
### 1. 查看已授权的账号
|
||||
|
||||
```bash
|
||||
gog auth list
|
||||
```
|
||||
|
||||
- 正确结果
|
||||
```
|
||||
weishen@WeideMac-mini ~ % gog auth list
|
||||
ishenwei@gmail.com default calendar,contacts,docs,drive,gmail,sheets 2026-03-24T01:29:14Z oauth
|
||||
```
|
||||
|
||||
### 2. 测试 Gmail
|
||||
|
||||
```bash
|
||||
gog gmail search "newer_than:1d" --max 5
|
||||
```
|
||||
|
||||
- 正确结果:
|
||||
```
|
||||
weishen@WeideMac-mini ~ % gog auth list
|
||||
ishenwei@gmail.com default calendar,contacts,docs,drive,gmail,sheets 2026-03-24T01:29:14Z oauth
|
||||
```
|
||||
|
||||
### 3. 测试 Calendar
|
||||
|
||||
```bash
|
||||
gog calendar events primary --from 2026-01-01 --to 2026-12-31
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 常用命令
|
||||
|
||||
### Gmail
|
||||
|
||||
| 功能 | 命令 |
|
||||
|------|------|
|
||||
| 搜索邮件 | `gog gmail search 'newer_than:7d' --max 10` |
|
||||
| 发送邮件 | `gog gmail send --to a@b.com --subject "Hi" --body "Hello"` |
|
||||
| 发送邮件(多行) | `gog gmail send --to a@b.com --subject "Hi" --body-file ./message.txt` |
|
||||
| 创建草稿 | `gog gmail drafts create --to a@b.com --subject "Hi" --body-file ./message.txt` |
|
||||
| 发送草稿 | `gog gmail drafts send <draftId>` |
|
||||
|
||||
### Calendar
|
||||
|
||||
| 功能 | 命令 |
|
||||
|------|------|
|
||||
| 查看事件 | `gog calendar events <calendarId> --from <iso> --to <iso>` |
|
||||
| 创建事件 | `gog calendar create <calendarId> --summary "Title" --from <iso> --to <iso>` |
|
||||
| 查看颜色 | `gog calendar colors` |
|
||||
|
||||
### Drive
|
||||
|
||||
| 功能 | 命令 |
|
||||
|------|------|
|
||||
| 搜索文件 | `gog drive search "query" --max 10` |
|
||||
|
||||
### Contacts
|
||||
|
||||
| 功能 | 命令 |
|
||||
|------|------|
|
||||
| 列出联系人 | `gog contacts list --max 20` |
|
||||
|
||||
### Sheets
|
||||
|
||||
| 功能 | 命令 |
|
||||
|------|------|
|
||||
| 获取数据 | `gog sheets get <sheetId> "Tab!A1:D10" --json` |
|
||||
| 更新数据 | `gog sheets update <sheetId> "Tab!A1:B2" --values-json '[["A","B"],["1","2"]]' --input USER_ENTERED` |
|
||||
|
||||
### Docs
|
||||
|
||||
| 功能 | 命令 |
|
||||
|------|------|
|
||||
| 导出文档 | `gog docs export <docId> --format txt --out /tmp/doc.txt` |
|
||||
| 查看内容 | `gog docs cat <docId>` |
|
||||
|
||||
---
|
||||
|
||||
## 故障排除
|
||||
|
||||
### 凭证文件路径错误
|
||||
|
||||
确保凭证文件在以下位置:
|
||||
```
|
||||
/Users/weishen/Library/Application Support/gogcli/credentials.json
|
||||
```
|
||||
|
||||
### 需要重新授权
|
||||
|
||||
删除现有授权并重新授权:
|
||||
|
||||
```bash
|
||||
gog auth remove ishenwei@gmail.com
|
||||
gog auth add ishenwei@gmail.com --services gmail,calendar,drive,contacts,docs,sheets
|
||||
```
|
||||
|
||||
### 设置默认账号
|
||||
|
||||
避免每次重复指定账号:
|
||||
```
|
||||
cd ~
|
||||
nano .zshrc
|
||||
```
|
||||
在.zshrc中添加以下设定
|
||||
```bash
|
||||
export GOG_ACCOUNT=ishenwei@gmail.com
|
||||
```
|
||||
保存生效
|
||||
```
|
||||
source ~/.zshrc
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 参考链接
|
||||
|
||||
- gog 官网: https://gogcli.sh
|
||||
- gog GitHub: https://github.com/steipete/gogcli
|
||||
- Google Cloud Console: https://console.cloud.google.com/
|
||||
|
||||
---
|
||||
|
||||
*文档创建日期: 2026-03-15*
|
||||
*最后更新: 2026-03-15*
|
||||
216
raw/Skills/Last30Days-使用指南.md
Normal file
216
raw/Skills/Last30Days-使用指南.md
Normal file
@@ -0,0 +1,216 @@
|
||||
---
|
||||
title: Last30Days 使用指南
|
||||
source:
|
||||
author: shenwei
|
||||
published:
|
||||
created:
|
||||
description:
|
||||
tags: [hackernews, instagram, last30days, polymarket, scrapecreator, tiktok, x, youtube]
|
||||
---
|
||||
|
||||
# Last30Days 使用指南
|
||||
#last30days #youtube #tiktok #x #instagram #hackernews #polymarket #scrapecreator
|
||||
|
||||
|
||||
> 来源: https://github.com/mvanhorn/last30days-skill
|
||||
> 更新时间: 2026-03-29
|
||||
> 版本: v2.9.5
|
||||
|
||||
---
|
||||
|
||||
## 概述
|
||||
|
||||
`/last30days` 研究过去 30 天内在 Reddit、X、YouTube、TikTok、Instagram、Hacker News、Polymarket 和网页上的热门内容,生成研究报告。
|
||||
|
||||
**特点**: 深度研究需要 2-8 分钟,支持 8 个数据来源,结果自动保存到 `~/Documents/Last30Days/`
|
||||
|
||||
---
|
||||
|
||||
## 调用方式
|
||||
|
||||
```bash
|
||||
python3 ~/.openclaw/skills/last30days-official/scripts/last30days.py "<话题>" --emit=compact --no-native-web --save-dir=~/Documents/Last30Days
|
||||
```
|
||||
|
||||
### 示例
|
||||
```bash
|
||||
# 基本搜索
|
||||
python3 ~/.openclaw/skills/last30days-official/scripts/last30days.py "AI一人公司"
|
||||
|
||||
# 指定 X 账号搜索
|
||||
python3 ~/.openclaw/skills/last30days-official/scripts/last30days.py "OpenClaw" --x-handle=openclawai
|
||||
|
||||
# 对比模式
|
||||
python3 ~/.openclaw/skills/last30days-official/scripts/last30days.py "cursor vs windsurf"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 参数说明
|
||||
|
||||
| 参数 | 说明 | 示例 |
|
||||
| `--days=N` | 回溯 N 天(默认30天) | `--days=7` |
|
||||
| `--quick` | 快速模式(8-12条/来源) | |
|
||||
| `--deep` | 深度模式(50-70条Reddit,40-60条X) | |
|
||||
| `--x-handle=HANDLE` | 指定 X 账号搜索(不含@) | `--x-handle=elonmusk` |
|
||||
| `--emit=compact` | 紧凑输出 | |
|
||||
| `--no-native-web` | 不使用内置 web 搜索 | |
|
||||
| `--save-dir=PATH` | 保存目录 | `--save-dir=~/Documents/Last30Days` |
|
||||
|
||||
---
|
||||
|
||||
## 数据来源
|
||||
|
||||
| 来源 | 权重 | 说明 |
|
||||
|------|------|------|
|
||||
| Reddit | 高 | 有 upvotes、comments 互动数据 |
|
||||
| X (Twitter) | 高 | 有 likes、retweets 互动数据 |
|
||||
| YouTube | 高 | 有观看数、likes 和字幕 |
|
||||
| TikTok | 中 | 有观看数、likes 和标题 |
|
||||
| Instagram | 中 | 有观看数、likes 和标题 |
|
||||
| Hacker News | 中 | 有 points、comments |
|
||||
| Polymarket | 高 | 真实钱币投注,数据真实可信 |
|
||||
| Web | 低 | 无互动数据,补充博客/新闻 |
|
||||
|
||||
**权重说明**: Reddit/X > YouTube > TikTok > Polymarket > Web
|
||||
|
||||
---
|
||||
|
||||
## 输出格式
|
||||
|
||||
### 1. What I Learned(研究发现)
|
||||
- 基于 QUERY_TYPE 类型的摘要
|
||||
- 引用真实来源(@handle、r/subreddit)
|
||||
- 3-5 个关键模式
|
||||
|
||||
### 2. Key Patterns(关键模式)
|
||||
- 按权重排序的模式列表
|
||||
- 每个模式注明来源
|
||||
|
||||
### 3. Stats(统计数据)
|
||||
```
|
||||
├─ 🟠 Reddit: N threads │ N upvotes │ N comments
|
||||
├─ 🔵 X: N posts │ N likes │ N reposts
|
||||
├─ 🔴 YouTube: N videos │ N views │ N with transcripts
|
||||
├─ 🎵 TikTok: N videos │ N views │ N likes
|
||||
├─ 📸 Instagram: N reels │ N views │ N likes
|
||||
├─ 🟡 HN: N stories │ N points │ N comments
|
||||
├─ 📊 Polymarket: N markets │ 相关赔率
|
||||
├─ 🌐 Web: N pages — Source Name, Source Name
|
||||
└─ 🗣️ Top voices: @handle1, @handle2
|
||||
```
|
||||
|
||||
### 4. Invitation(推荐下一步)
|
||||
根据 QUERY_TYPE 类型推荐后续操作
|
||||
|
||||
---
|
||||
|
||||
## API Keys 配置
|
||||
|
||||
在 `~/.openclaw/.env` 中配置:
|
||||
|
||||
```bash
|
||||
# 必填
|
||||
SCRAPECREATORS_API_KEY=... # Reddit + TikTok + Instagram(一个 key 覆盖三个)
|
||||
|
||||
# X/Twitter 搜索(2选1)
|
||||
AUTH_TOKEN=... # 方案1: 从浏览器 cookie 复制
|
||||
CT0=... # 方案1: 从浏览器 cookie 复制
|
||||
XAI_API_KEY=xai-... # 方案2: XAI API Key
|
||||
|
||||
# Web 搜索(可选)
|
||||
OPENROUTER_API_KEY=... # OpenRouter/Perplexity
|
||||
TAVILY_API_KEY=... # Brave Search
|
||||
PARALLEL_API_KEY=... # Parallel AI
|
||||
|
||||
# Bluesky(可选)
|
||||
BSKY_HANDLE=you.bsky.social
|
||||
BSKY_APP_PASSWORD=xxxx-xxxx-xxxx
|
||||
```
|
||||
|
||||
### 当前已配置
|
||||
- ✅ SCRAPECREATORS_API_KEY
|
||||
- ✅ XAI_API_KEY
|
||||
- ✅ OPENROUTER_API_KEY
|
||||
- ✅ TAVILY_API_KEY
|
||||
|
||||
---
|
||||
|
||||
## 新功能 (v2.9.5)
|
||||
|
||||
### Bluesky 支持
|
||||
- 需要 BSKY_HANDLE + BSKY_APP_PASSWORD
|
||||
- 创建 app password: bsky.app/settings/app-passwords
|
||||
|
||||
### Comparative Mode(对比模式)
|
||||
```bash
|
||||
"cursor vs windsurf" # 得到并排对比
|
||||
```
|
||||
|
||||
### Per-project .env
|
||||
在项目根目录创建 `.claude/last30days.env` 覆盖全局配置
|
||||
|
||||
### SessionStart config check
|
||||
Claude Code 启动时自动验证配置
|
||||
|
||||
---
|
||||
|
||||
## 最佳实践
|
||||
|
||||
### 1. 选择合适的深度
|
||||
| 场景 | 推荐 |
|
||||
|------|------|
|
||||
| 测试话题 | `--quick` |
|
||||
| 每周追踪 | `--days=7 --quick` |
|
||||
| 深度研究 | `--deep` |
|
||||
| 全面研究 | 默认 30 天 |
|
||||
|
||||
### 2. X 账号精确搜索
|
||||
如果搜索人物/品牌,加上 `--x-handle`:
|
||||
```bash
|
||||
--x-handle=openclawai # 搜索 OpenClaw 官方帖子
|
||||
```
|
||||
|
||||
### 3. 对比模式
|
||||
问 "X vs Y" 得到并排对比研究
|
||||
|
||||
### 4. Web 搜索补充
|
||||
根据类型自动补充:
|
||||
- RECOMMENDATIONS: `best {topic} recommendations`
|
||||
- NEWS: `{topic} news 2026`
|
||||
- PROMPTING: `{topic} prompts examples`
|
||||
- GENERAL: `{topic} 2026 discussion`
|
||||
|
||||
---
|
||||
|
||||
## 典型使用场景
|
||||
|
||||
| 场景 | 推荐用法 |
|
||||
|------|---------|
|
||||
| 每周行业动态 | `/last30days AI工具 --days=7 --quick` |
|
||||
| 竞品深度分析 | `/last30days competitor --deep --x-handle=竞品账号` |
|
||||
| 工具对比选型 | `/last30days toolA vs toolB` |
|
||||
| 人物热点追踪 | `/last30days person --x-handle=personHandle` |
|
||||
| 热点趋势发现 | `/last30days trending_topic` |
|
||||
|
||||
---
|
||||
|
||||
## 注意事项
|
||||
|
||||
1. 深度研究需要 2-8 分钟,耐心等待
|
||||
2. TikTok/Instagram 需要 ScrapeCreators API key(前 100 次免费)
|
||||
3. 建议先用 `--quick` 测试话题方向
|
||||
4. Reddit 评论往往比帖子更有价值,关注 top comments
|
||||
5. Polymarket 赔率是最高置信度的数据
|
||||
|
||||
---
|
||||
|
||||
## 相关资源
|
||||
|
||||
- GitHub: https://github.com/mvanhorn/last30days-skill
|
||||
- 技能目录: `~/.openclaw/skills/last30days-official/`
|
||||
- 研究保存: `~/Documents/Last30Days/`
|
||||
|
||||
---
|
||||
|
||||
*此笔记由星辉根据 README.md 总结生成*
|
||||
1229
raw/Skills/baoyu-skills-claude-code-技能集.md
Normal file
1229
raw/Skills/baoyu-skills-claude-code-技能集.md
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user