forked from Gitlink/gitlink-cli
2.5 KiB
2.5 KiB
Repo Insight Shortcuts
Summary
Adds read-only repository insight shortcuts so maintainers and agents can inspect project health without falling back to Raw API calls.
Commands
| Command | Purpose |
|---|---|
gitlink-cli repo +languages |
Show repository language statistics |
gitlink-cli repo +contributors |
List repository contributors |
gitlink-cli repo +contributor-stats |
List contributor statistics with additions and deletions |
gitlink-cli repo +code-stats |
Show repository code statistics |
gitlink-cli repo +watchers |
List repository watchers |
gitlink-cli repo +stargazers |
List repository stargazers |
gitlink-cli repo +follow |
Follow a repository |
gitlink-cli repo +unfollow |
Unfollow a repository |
gitlink-cli repo +like |
Like a repository |
gitlink-cli repo +unlike |
Unlike a repository |
Validation
repo +contributor-stats --pass-yearmust be a positive integer.repo +watchersandrepo +stargazersaccept optional--start-atand--end-atUnix timestamps.- Time range timestamps must be non-negative, and
--start-atcannot be greater than--end-at. repo +follow,repo +unfollow,repo +like, andrepo +unlikeaccept optional--project-id; if omitted, the project ID is resolved from--owner/--repo.- Repository interaction actions support
--dry-runso callers can preview the resolved project ID and endpoint before changing remote state.
Tests
Unit tests cover endpoint paths, query parameter mapping, optional ref and time-range filters, project ID auto-resolution, dry-run previews, and invalid argument handling before any API request is sent.
中文说明
变更内容
- 新增
repo +languages、repo +contributors、repo +contributor-stats、repo +code-stats、repo +watchers、repo +stargazers等仓库洞察命令。 - 新增
repo +follow、repo +unfollow、repo +like、repo +unlike仓库互动命令,并支持--project-id和--dry-run。 repo +contributor-stats和repo +code-stats使用 v1 API,支持--ref和--pass-year参数。repo +watchers和repo +stargazers支持--start-at/--end-at时间范围,并在请求前校验时间戳。- 更新 README、README.zh-CN、
gitlink-repoSkill 和变更说明,减少仓库分析场景对 Raw API 的依赖。 - 提交者:王越
验证
GOPROXY=https://goproxy.cn,direct go test ./...go run . repo --helpgo run . repo +contributor-stats --helpgo run . repo +watchers --helpgit diff --check