feat(repo): add raw file content shortcuts #320
Loading…
Reference in New Issue
No description provided.
Delete Branch "ohanabi/gitlink-cli:feat/repo-raw-file-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?
合并请求描述
本次合并请求增强仓库文件读取能力,新增
repo +raw、repo +file-exists、repo +manifest,将常见的 raw 文件读取、文件存在性检查、依赖清单读取从 Raw API 沉淀为标准仓库 Shortcut。
相关Issue
关联Issue编号:暂无
变更内容
1. 增强了仓库原始文件读取能力
repo +raw。--path指定仓库文件路径。--ref指定分支、标签或提交,默认master。2. 增强了仓库文件存在性检查能力
repo +file-exists。sub_entries检查指定文件是否存在。3. 增强了依赖清单读取能力
repo +manifest。go、node、python、rust、java。go.modpackage.jsonrequirements.txt、pyproject.toml、Pipfile、setup.pyCargo.tomlpom.xml、build.gradle、build.gradle.kts..父路径段。5. 完善了测试、文档和 Skill
找到、非法输入和 HTTP 错误。
skills/gitlink-repo。skills/gitlink-compliance和skills/gitlink-code-review,优先使用repo Shortcut 读取文件和文件树。
doc/changes/repo-raw-file-shortcuts.md。问题描述
多个仓库分析流程需要读取 LICENSE、README、依赖清单、源文件等内容,但之前需要直接
使用 Raw API,例如
/raw/<ref>/<path>和sub_entries。这导致 Agent 和用户需要手动拼接路径与 query,且不同 Skill 中重复保留 Raw API 示例。
问题复现步骤
skills/gitlink-compliance/SKILL.md或skills/gitlink-code-review/ SKILL.md。API。
/raw/master/<path>或sub_entries? filepath=<path>&ref=<branch>。/或需要多语言 manifest fallback 时,使用体验不统一且容易出错。
根本原因
仓库 Shortcut 已支持
repo +tree、repo +readme等只读能力,但缺少通用 raw 文件读取、文件存在性检查和常见依赖清单读取封装,导致合规检查和代码审查仍依赖 Raw
API。
修复方案
在
shortcuts/repo中新增:repo +raw --path <path> --ref <ref>repo +file-exists --path <path> --ref <ref>repo +manifest --kind <go|node|python|rust|java> --ref <ref>实现路径清理、raw 路径分段转义、manifest 候选文件映射和
sub_entries结果匹配逻辑。同步补齐单元测试、i18n、README、中文 README、Repo/Compliance/Code Review
Skill 和 change note。
Pull request closed