新增仓库洞察快捷命令 #116
Loading…
Reference in New Issue
No description provided.
Delete Branch "Mengz/gitlink-cli:mengz/repo-insight-shortcuts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
本次 PR 为仓库常用洞察能力补齐高层 Shortcut,让用户和 AI Agent 不必记忆 Raw API 路径,也能直接查看仓库语言占比、贡献者列表以及代码统计。新增
repo +languages、repo +contributors、repo +code-stats,全部复用现有 RuntimeContext 的 owner/repo 解析、API 调用和统一输出;code-stats支持--ref,可按分支、标签或 Commit 查看统计。实现过程中实测了公开仓库接口,发现contributors/stat当前会返回服务端业务失败,因此没有暴露不稳定命令,只保留可稳定使用的能力。同时补充了 README、中文 README、
gitlink-repoSkill 和doc/changes/repo-insight-shortcuts.md,方便用户和 Agent 发现新命令;单元测试覆盖了 method、path、query 参数和错误路径。Windows 下 auth 测试原本只隔离 HOME,os.UserHomeDir()仍可能读取真实 USERPROFILE,导致go test ./...失败,本次一并补齐 USERPROFILE/HOMEDRIVE/HOMEPATH 隔离,保证本地全量测试可重复通过。已验证:
go test ./shortcuts/repo/...go test ./cmd/auth ./internal/authgo test ./...go build ./...git diff --checkrepo +languages、repo +contributors、repo +code-stats已在Gitlink/gitlink-cli公开仓库实测通过Step 1:
From your project repository, check out a new branch and test the changes.Step 2:
Merge the changes and update on Gitea.