介绍
# GitHub Integration Skill
直接从您的 AI 助手查询和管理 GitHub 仓库。
## 功能
| 功能 | 描述 | |------------|-------------| | `list_repos` | 列出您的仓库并支持筛选 | | `get_repo` | 获取特定仓库的详细信息 | | `check_ci_status` | 检查 CI/CD 流水线状态 | | `create_issue` | 在仓库中创建新 Issue | | `create_repo` | 创建新仓库 | | `search_repos` | 搜索您的仓库 | | `get_recent_activity` | 获取最近的提交记录 |
## 使用方法
``` You: List my Python repos Bot: [lists your Python repositories]
You: Check CI status on my main project Bot: [shows CI/CD status]
You: Create an issue about the bug Bot: [creates the issue] ```
## 设置
### 1. 生成 GitHub 个人访问令牌
1. 访问 https://github.com/settings/tokens 2. 点击 "Generate new token (classic)" 3. 名称:`openclaw-github-skill` 4. 权限范围:`repo`(必需),`read:user`(可选) 5. 复制该令牌
### 2. 配置凭据
**选项 A:环境变量(推荐)**
在启动 OpenClaw 之前设置环境变量:
```bash export GITHUB_TOKEN="ghp_your_token_here" export GITHUB_USERNAME="your_github_username" ```
**选项 B:OpenClaw 配置**
添加到 `~/.openclaw/openclaw.json`:
```json { "github": { "token": "ghp_your_token_here", "username": "your_username" } } ```
### 3. 重启 OpenClaw
```bash openclaw gateway restart ```
## 安全提示
⚠️ **保护您的令牌:**
- 切勿将您的令牌提交到 git 或公开分享 - 使用最小所需权限范围(私有仓库用 `repo`,仅公开仓库用 `public_repo`) - 如果怀疑令牌已泄露,请轮换更新 - 在生产环境中考虑使用密钥管理器
⚠️ **最佳实践:**
- 不要在共享机器的 shell 配置文件(如 ~/.zshrc)中存储令牌 - 对于本地开发,使用环境变量是可以接受的 - 对于生产环境,请使用您平台的密钥/凭据存储
## 速率限制
- 未认证请求:60 次/小时 - 已认证请求:5,000 次/小时
## 系统要求
- OpenClaw 网关正在运行 - 具有相应权限范围的 GitHub 个人访问令牌