完善仓库 README 快捷命令 #122

Merged
wbtiger merged 2 commits from Mengz/gitlink-cli:mengz/repo-readme-file-support into master 2026-07-14 22:24:53 +08:00
Contributor

本次变更聚焦仓库 README 快捷命令的完善。repo +readme 原本已经能调用 README API,但帮助文案仍是硬编码英文,缺少单元测试,仓库 Skill 也还把 README 查询放在 Raw API 示例里,导致用户和 AI Agent 容易绕开已有 shortcut。现在命令说明和参数说明接入中英文 i18n,并在 README 与 gitlink-repo Skill 中补充根目录和子目录 README 的用法;--ref 会传给 API 的 ref--path 会规范化后传给 filepath,可稳定查询 docs/docs/guide/ 等目录下的 README。

同时新增 repo +readme 单元测试,覆盖默认查询、指定分支与子目录、HTTP 错误返回,确保请求路径 /owner/repo/readme.json 和查询参数不会在后续调整中退化。已验证 go test ./shortcuts/repo ./internal/i18ngo test ./shortcuts/...go build ./...git diff --check、中英文 repo +readme --help,并实操调用公开仓库 README API 成功。全量 go test ./... 仍受 Windows 环境下既有 cmd/authinternal/auth 凭据目录测试影响失败,本次改动未涉及认证存储逻辑。

本次变更聚焦仓库 README 快捷命令的完善。`repo +readme` 原本已经能调用 README API,但帮助文案仍是硬编码英文,缺少单元测试,仓库 Skill 也还把 README 查询放在 Raw API 示例里,导致用户和 AI Agent 容易绕开已有 shortcut。现在命令说明和参数说明接入中英文 i18n,并在 README 与 `gitlink-repo` Skill 中补充根目录和子目录 README 的用法;`--ref` 会传给 API 的 `ref`,`--path` 会规范化后传给 `filepath`,可稳定查询 `docs`、`/docs/guide/` 等目录下的 README。 同时新增 `repo +readme` 单元测试,覆盖默认查询、指定分支与子目录、HTTP 错误返回,确保请求路径 `/owner/repo/readme.json` 和查询参数不会在后续调整中退化。已验证 `go test ./shortcuts/repo ./internal/i18n`、`go test ./shortcuts/...`、`go build ./...`、`git diff --check`、中英文 `repo +readme --help`,并实操调用公开仓库 README API 成功。全量 `go test ./...` 仍受 Windows 环境下既有 `cmd/auth`、`internal/auth` 凭据目录测试影响失败,本次改动未涉及认证存储逻辑。
Mengz force-pushed mengz/repo-readme-file-support from 27abd86583 to a8118da49b 2026-06-09 12:52:15 +08:00 Compare
wbtiger merged commit ccac57046a into master 2026-07-14 22:24:28 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Gitlink/gitlink-cli#122
No description provided.