gread
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGread
Gread
Provide the ability to search, inspect, and read source code from all public GitHub repositories and their associated documentation.
提供搜索、查看和读取所有公开GitHub仓库及其相关文档中源代码的能力。
Endpoints
端点
All endpoints are GET endpoints exposed at . Only use parameters through the query string (). The system returns well-formatted markdown blocks.
https://api.gread.dev?key=value- If the exact repository full name is known (e.g., ), view repository (
owner/repo) directly./repo - Otherwise, search repositories () first to find the correct repository.
/search - To retrieve documents, also view the main repository through ; its corresponding document repo will also be returned (if exists).
/repo
所有端点均为暴露在 的 GET 端点。仅通过查询字符串()使用参数。系统返回格式规范的markdown块。
https://api.gread.dev?key=value- 如果已知仓库的完整名称(例如:),可直接通过
owner/repo查看仓库。/repo - 否则,先通过 搜索仓库以找到正确的目标仓库。
/search - 如需获取文档,同样通过 查看主仓库;若存在对应的文档仓库,也会一并返回。
/repo
1. Search Repositories
1. 搜索仓库
Search for GitHub repositories by name, description, or topic keywords using the GitHub Search API.
Format:
Example:
GET https://api.gread.dev/search?q={keyword}GET https://api.gread.dev/search?q=hono| Parameter | Type | Required | Description |
|---|---|---|---|
| string | Yes | Keyword to search in repository names, descriptions, or topics |
使用GitHub Search API,通过名称、描述或主题关键词搜索GitHub仓库。
格式:
示例:
GET https://api.gread.dev/search?q={keyword}GET https://api.gread.dev/search?q=hono| 参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| string | 是 | 用于搜索仓库名称、描述或主题的关键词 |
2. View Repository
2. 查看仓库
View repository basic information and its directory structure. Includes corresponding documentation repo if available.
Format:
Example:
GET https://api.gread.dev/repo?name={user/repo}GET https://api.gread.dev/repo?name=honojs/hono| Parameter | Type | Required | Description |
|---|---|---|---|
| string | Yes | Full name of the repository (owner/repo) |
查看仓库基本信息及其目录结构。若存在对应的文档仓库,也会包含在内。
格式:
示例:
GET https://api.gread.dev/repo?name={user/repo}GET https://api.gread.dev/repo?name=honojs/hono| 参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| string | 是 | 仓库的完整名称(owner/repo) |
3. List Directory Tree
3. 列出目录树
Detailed view of a repository's directory tree with recursion limits.
Format:
Example:
GET https://api.gread.dev/tree?name={user/repo}&dir={targetDir}&depth={num}&limit={num}GET https://api.gread.dev/tree?name=honojs/hono&dir=src&depth=3&limit=50| Parameter | Type | Required | Description |
|---|---|---|---|
| string | Yes | Full name of the repository (owner/repo) |
| string | No | Target directory path to inspect (defaults to root if empty) |
| number | No | Maximum depth into the directory structure to list (default:3) |
| number | No | Maximum number of items to display per directory level (default: 40) |
查看仓库目录树的详细视图,包含递归限制。
格式:
示例:
GET https://api.gread.dev/tree?name={user/repo}&dir={targetDir}&depth={num}&limit={num}GET https://api.gread.dev/tree?name=honojs/hono&dir=src&depth=3&limit=50| 参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| string | 是 | 仓库的完整名称(owner/repo) |
| string | 否 | 要查看的目标目录路径(为空时默认根目录) |
| number | 否 | 目录结构的最大递归深度(默认值:3) |
| number | 否 | 每个目录级别显示的最大条目数(默认值:40) |
4. Read Code
4. 读取代码
Retrieve the raw source code of specified files from within a known repository. Provide paths separated by commas.
Format:
Example:
GET https://api.gread.dev/read?name={user/repo}&paths={path1,path2}GET https://api.gread.dev/read?name=honojs/hono&paths=src/index.ts,package.json| Parameter | Type | Required | Description |
|---|---|---|---|
| string | Yes | Full name of the repository (owner/repo) |
| string | Yes | Comma-separated list of precise file paths within the repository |
从已知仓库中检索指定文件的原始源代码。提供用逗号分隔的路径。
格式:
示例:
GET https://api.gread.dev/read?name={user/repo}&paths={path1,path2}GET https://api.gread.dev/read?name=honojs/hono&paths=src/index.ts,package.json| 参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| string | 是 | 仓库的完整名称(owner/repo) |
| string | 是 | 仓库内精确文件路径的逗号分隔列表 |
5. Search within Repo
5. 仓库内搜索
Perform a fast inside the repository.
Format:
Example:
git grepGET https://api.gread.dev/grep?name={user/repo}&q={search_pattern}&i=true&F=true&E=true&C=2&path={targetDir}GET https://api.gread.dev/grep?name=honojs/hono&q=listen&C=2&path=src| Parameter | Type | Required | Description |
|---|---|---|---|
| string | Yes | Full name of the repository (owner/repo) |
| string | Yes | Search pattern or query to pass to git grep |
| boolean | No | Ignore case distinctions ( |
| boolean | No | Interpret pattern as fixed string ( |
| boolean | No | Interpret pattern as extended regular expression ( |
| number | No | Print num lines of output context ( |
| string | No | Directory or file path to limit the search scope |
在仓库内执行快速的 操作。
格式:
示例:
git grepGET https://api.gread.dev/grep?name={user/repo}&q={search_pattern}&i=true&F=true&E=true&C=2&path={targetDir}GET https://api.gread.dev/grep?name=honojs/hono&q=listen&C=2&path=src| 参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| string | 是 | 仓库的完整名称(owner/repo) |
| string | 是 | 传递给git grep的搜索模式或查询内容 |
| boolean | 否 | 忽略大小写差异( |
| boolean | 否 | 将模式解释为固定字符串( |
| boolean | 否 | 将模式解释为扩展正则表达式( |
| number | 否 | 输出上下文的行数( |
| string | 否 | 限制搜索范围的目录或文件路径 |