2.5 KiB
Code history and batch file shortcuts
Background
Agent workflows such as PR review, commit quality checks, repository health reports, and research reproducibility audits need commit timelines, changed files, commit diffs, and sometimes controlled multi-file updates. Before this change, several of these operations required Raw API calls.
This change adds a larger Subtask 1 feature set around repository code history and file operations.
New shortcuts
Repository shortcuts:
repo +filessearches repository files with optional--searchand--ref.repo +commitslists commits for a branch, tag, or commit ref with pagination.repo +commit-fileslists files changed by a commit, with optional file-path filtering.repo +commit-diffreturns a commit diff.repo +tagslists repository tags with pagination and optional name filtering.repo +tagreturns one tag's metadata and target commit.repo +delete-tagdeletes a repository tag after explicit confirmation.repo +batch-commitcreates, updates, or deletes multiple files in one commit.
Pull request shortcuts:
pr +commitslists commits included in a pull request.
Safety model
All history and file inspection commands are read-only.
repo +delete-tag and repo +batch-commit can modify repository content, so
they require an explicit confirmation flag for remote writes:
gitlink-cli repo +delete-tag --owner me --repo proj --name v0.1.0 --dry-run
gitlink-cli repo +delete-tag --owner me --repo proj --name v0.1.0 --yes
gitlink-cli repo +batch-commit --owner me --repo proj \
--branch master --message "docs: update" \
--files 'update:README.md:# Updated' \
--dry-run
gitlink-cli repo +batch-commit --owner me --repo proj \
--branch master --message "docs: update" \
--files 'update:README.md:# Updated' \
--yes
The --files format is:
action:path[:content][;action:path[:content]...]
Supported actions are create, update, and delete. create and update
require content; delete does not.
Tests
Unit tests cover:
- repository file search query mapping;
- commit list pagination and ref mapping;
- commit changed-file and diff endpoints;
- repository tag list/detail/delete endpoint mapping;
- PR commit list endpoint;
repo +batch-commitdry-run behavior;repo +batch-commitremote write protection without--yes;- batch file operation payload construction and validation.
Suggested verification:
go test ./shortcuts/repo ./shortcuts/pr
Full project verification:
make test