| name | github-fetcher |
| description | Fetch GitHub repository information by URL or configured topics. Returns structured JSON data about repositories including name, description, language, stars, and topics. |
| homepage | https://github.com |
| metadata | {"openclaw":{"emoji":"🐙","requires":{"bins":["cargo","rustc"],"env":[]}}} |
GitHub Fetcher
Fetch GitHub repository information using the GitHub Search API. This skill can fetch repositories by providing a direct GitHub API URL or by using pre-configured topics from config.json.
Installation
This skill requires Rust toolchain (cargo and rustc) to be installed on your system.
Configuration
Create a config.json file in the skill directory with the following structure:
{
"topics": ["zk-snark", "blockchain", "defi"],
"last_update_time": "none"
}
- topics: Array of search topics to fetch repositories for
- last_update_time: Track when the last fetch was performed ("none" for first time)
Usage
Using the Script
The skill provides a command-line interface through the compiled Rust binary:
./target/debug/github_fetcher --url "https://api.github.com/search/repositories?q=zk-snark&sort=stars&order=desc"
./target/debug/github_fetcher --topic zk-snark
Arguments
| Argument | Description | Required |
|---|
--url <URL> | Direct GitHub API search URL | Either this or --topics |
--topic <TOPIC> | The topic want to search | Either this or --url |
Examples
1. Fetch by URL
./target/debug/github_fetcher --url "https://api.github.com/search/repositories?q=zk-snark&sort=stars&order=desc"
2. Fetch by Topics
./target/debug/github_fetcher --topic zk-snark
Output Format
The skill outputs JSON data directly to stdout (or to specified file). The output format is designed to be easily processed by AI models for further formatting and localization.
Single URL Fetch (--url)
[
{
"name": "repository-name",
"id": 123456,
"description": "Repository description",
"language": "Rust",
"html_url": "https://github.com/user/repo",
"nb_star": 1000,
"create_time_str": "2023-01-01T00:00:00Z",
"topic_str": "topic1&topic2&topic3"
}
]
Topics Fetch (--topics)
{
"ethereum": [
{
"name": "ethereum-repo",
"id": 123456,
"description": "Ethereum related repo",
"language": "Go",
"html_url": "https://github.com/ethereum/repo",
"nb_star": 5000,
"create_time_str": "2022-01-01T00:00:00Z",
"topic_str": "ethereum&blockchain"
}
],
"solidity": [
]
}
Output Processing & Formatting
The raw JSON output is designed to be processed by AI models to create beautiful, localized reports. Here's how you can transform the output:
1. Chinese Localization Example
Convert English field names and descriptions to Chinese:
Raw Output:
{
"name": "gnark",
"description": "Fast zk-SNARK library with high-level API",
"language": "Go",
"nb_star": 1694
}
AI-Processed Output:
## 📊 仓库分析报告
### 🔝 热门仓库
- **[gnark](https://github.com/Consensys/gnark)** ⭐ 1,694
- **主要语言**: Go
- **描述**: 快速的零知识证明库,提供高级API设计电路
- **适用场景**: 区块链开发、zk-rollup、zkEVM项目
2. Enhanced Formatting Guidelines
When processing the JSON output, consider:
- 使用emoji图标 增强视觉效果 (⭐, 🔝, 📊, 🔧等)
- 创建可点击链接 使用Markdown格式
[仓库名](URL)
- 添加分类标签 按语言、应用场景、活跃度等分类
- 提供使用建议 基于仓库特点给出推荐场景
- 包含技术趋势分析 统计语言分布、热门话题等
3. Structured Report Template
# 📈 [搜索关键词] GitHub 仓库分析报告
## 🔝 Top N 仓库概览
[表格或列表形式展示]
## 📊 技术生态分析
- **语言分布**: [统计结果]
- **应用场景**: [分类总结]
- **活跃度指标**: [星标数、更新频率等]
## 🎯 推荐使用场景
| 场景 | 推荐仓库 | 理由 |
|------|----------|------|
| [场景1] | [仓库名] | [具体理由] |
Rate Limiting
GitHub API has rate limits. The skill includes automatic retry logic and 10-second delays between paginated requests to respect these limits.
Error Handling
Common errors include:
- Network errors: Check internet connection and GitHub API status
- Rate limiting: Wait and retry; the skill handles this automatically
- Invalid URLs: Ensure the GitHub API URL is correctly formatted
- Missing configuration: When using
--topics, ensure config.json exists and is valid
Building
To compile the skill:
cd scripts
chmod +x scripts/build.sh
./scripts/build.sh
.\scripts\build.ps1
The compiled binary will be available at `scripts/target/debug/github_fetcher`.