- Restore origin/master core skeleton files (types.go, runner.go, client.go)
- Add NoProgress field to Client struct for upload.go
- Remove duplicate file declarations (testing_helpers.go, batch_common.go, etc.)
- Remove batch_*.go files that conflict with origin/master batch.go
- Fix workflow newPRSummaryShortcut call signature
- Fix duplicate wiki key in register.go
Note: Some new PR features (PaginateAllKey, DoRaw, etc.) require framework
extensions not yet integrated. These PRs' tests may fail until their framework
changes are properly merged.
The merge of PR #406 (MSYS2 path fix) via --theirs accidentally
dropped the resolveAPIPath function added by PR #254. This commit
restores the :owner/:repo placeholder and --var template resolution
while keeping the MSYS2 path restoration as the first step.
Single-issue deletion via DELETE /api/v1/:owner/:repo/issues/:number.
The existing +batch-delete requires repo manager permissions and global
database IDs; +delete works for the issue author using the web issue
number. Destructive, so it refuses to run without --yes.
Includes en/zh i18n keys, README examples, and unit tests.
Production-verified on gitlink.org.cn (create -> delete -> 404 view).
tag +view -n <name> wraps GET /v1/:owner/:repo/tags/:name. In
production the show endpoint's tag-existence precheck (gitea-hat
tag_name_set) rejects tags that the paginated list returns
('标签不存在!' even for a tag visible in tags.json), so on error the
command falls back to scanning the paginated list for the requested
name and emits the matching entry.
Production-reproduced the precheck bug and verified the fallback
returns the correct tag. 2 unit tests cover the direct path and the
fallback.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Wraps GET /v1/:owner/:repo/git/trees/:sha and /git/blobs/:sha,
which had no CLI coverage:
- repo +git-tree -s <sha|ref> [--recursive]: paged tree entries
- repo +blob -s <sha> [--decode]: blob object; --decode prints the
base64 content as plain text for piping
Production-verified on gitlink.org.cn (tree listing by ref, blob
fetched by SHA and decoded byte-for-byte). 2 unit tests, README
examples, bilingual i18n keys.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The CLI had no way to read commit history at all. New group wrapping
Api::V1::Projects::CommitsController:
- commit +list [-s ref]: paged commit list, optionally from a
branch/tag/SHA
- commit +recent [-k keyword]: recent commits with keyword filter
- commit +diff -s <sha>: full diff of a commit
- commit +files -s <sha> [-f filepath]: files changed by a commit,
optionally restricted to one path
Production-verified on gitlink.org.cn against a 6700+-commit repo
(list totals, keyword-filtered recent, real SHA diff/files). 3 unit
tests, README section, bilingual i18n keys.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The contents/batch endpoint accepts multiple file operations per
commit, but each existing shortcut sent exactly one. file +batch
takes a JSON spec (array of {action_type, file_path, content,
encoding}) and applies them atomically in one commit:
gitlink-cli file +batch -s spec.json -b master -m 'batch ops'
Client-side validation: action_type must be create|update|delete,
file_path required. content/encoding are normalized for delete
entries — the server rejects entries missing content with
'请输入正确的文件参数Files' (production-reproduced).
Production-verified on gitlink.org.cn: 2-file create in one commit,
then 2-file delete in one commit. Unit test covers payload shape,
delete normalization, and action_type validation.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Wraps GET /actions/runs/:run_id/jobs/:job/logs (runs#job_logs, which
redirects to the log file). Non-JSON body is printed as-is so the
output pipes cleanly into grep/less.
Production-verified on gitlink.org.cn (real run's job log streamed).
Unit test covers the nested path and the --run-id integer guard.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- branch +all: full branch-name list via GET /branches/all
(AllListService), no paging — handy for scripting and completion.
- branch +set-default: switch the repository default branch via
PATCH /branches/update_default_branch (manager permission),
which the CLI previously had no way to do.
Production-verified on gitlink.org.cn (full name list returned;
default branch update status 0). 2 unit tests, README examples,
bilingual i18n keys.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Completes the pull-journal comment lifecycle. The CLI could only
create PR comments (via the linked issue's journals); the dedicated
v1 pull journals endpoints also support list/update/destroy:
- pr +comments -i <num>: list a PR's journals
- pr +comment-edit -i <num> -c <journal-id> -b <text> [-s state]
- pr +comment-delete -i <num> -c <journal-id>
The server's UpdateService hard-requires state in
opened|resolved|disabled (omitting it fails with
'State不包含于列表中'), so +comment-edit always sends state,
defaulting to opened, with client-side validation of the enum.
--comment-id is integer-validated.
Production-verified full lifecycle on gitlink.org.cn:
create -> list -> edit (note updated) -> delete. 3 unit tests,
README examples, bilingual i18n keys.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Completes the journal (comment) lifecycle for issues. The CLI could
only create comments; the v1 journals endpoints also support listing,
updating, and deleting:
- issue +comments -n <num>: list journals with the server's filters
(--keyword, --category comment|operate, paging)
- issue +comment-edit -n <num> -c <journal-id> -b <text>
- issue +comment-delete -n <num> -c <journal-id>
--comment-id is integer-validated before any API call.
Production-verified full lifecycle on gitlink.org.cn: create ->
list (count reflects it) -> edit -> delete. 3 unit tests, README
examples, bilingual i18n keys.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- pr +commits: list commits of a pull request
(GET /pulls/:id/commits)
- pr +check-merge: pre-flight check_can_merge before creating a PR.
Detects same-branch no-ops and existing duplicate merge requests,
including the cross-fork case via --fork-project-id (which also
sets is_original, matching the server's duplicate lookup).
Production-verified on gitlink.org.cn: commits listing, a
'can merge' pass, and duplicate detection that points at the
existing PR. 2 unit tests, README examples, bilingual i18n keys.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Wraps GET /:owner/:repo/activity (ProjectTrendsController#index) with
the server's documented filters:
- --type: Issue | PullRequest | Version
- --status: create | close | journal
- --time: only events from the past N days (integer-validated)
Production-verified on gitlink.org.cn (filtered Issue/close feed
returns trends plus aggregate counts). Unit test covers query shape
and the --time guard; README example and bilingual i18n keys.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- repo +forks: list users who forked the repository (GET /forks,
same community time-range flags as +watchers/+stargazers)
- repo +top-counts: repository top-line counts (tags, branches,
commits, releases, size) via GET /top_counts
Production-verified on gitlink.org.cn (77 forks on a large repo;
counts payload matches web overview). 2 unit tests, README examples,
and bilingual i18n keys.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Wraps the v1 actions API (Api::V1::Projects::Actions):
- action +list: workflow files under .gitea/workflows
- action +runs -w <file>: paginated run history of a workflow
- action +run -w <file> -r <ref>: trigger a run
- action +rerun / +job-rerun: rerun a whole run or a single job
- action +enable / +disable -w <file>: per-workflow toggle (the server
requires the workflow param; omitting it errors)
Production-verified: list, runs, trigger (new run appeared in history),
and disable/enable round-trip. Rerun endpoints surface the server
message verbatim when gitea-hat rejects the rerun. 6 unit tests,
README section, and bilingual i18n keys.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Wraps GET /api/v1/:owner/:repo/blame (params: filepath, sha) as
repo +blame -p <path> [--ref <ref>], defaulting ref to master.
Production-verified on gitlink.org.cn (875-line file returned 274
blame parts with commit/author metadata). 2 unit tests, README
example, and bilingual i18n keys.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- branch +list -k/--keyword: filter branches by name keyword (passed
through to the v1 branches index)
- branch +all: list all branch names via /branches/all, no pagination
Production-verified on gitlink.org.cn (keyword narrows to matching
branches; /all returns the full set). 2 new unit tests, README
examples, and en-US/zh-CN i18n keys.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- issue +comment --reply-to <id>: reply to an existing comment; the
server requires both parent_id and reply_id, so both are set
- issue +comment-replies: list a comment's replies via the
children_journals endpoint with --page/--limit
Production-verified: parent -> reply -> list replies -> delete
round-trip on a real issue. 3 new unit tests and bilingual docs.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
pr +comment (and the conversation note posted by pr +review) wrote to
POST /api/v1/:owner/:repo/issues/:issue_id/journals, which attaches
the journal to the underlying issue record. Those journals never show
up in GET /pulls/:id/journals — the list the PR conversation is built
from — so comments posted by the CLI were invisible on the pull
request page.
Post to POST /api/v1/:owner/:repo/pulls/:id/journals (payload key
"note") instead, which also drops the extra PR-detail fetch that was
only needed to resolve the issue id.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Completes issue comment CRUD on top of the existing issue +comment by
covering the v1 journals endpoints (index/update/destroy):
- issue +comments: list comments with --category/--keyword filters and
--page/--limit pagination
- issue +comment-edit: PATCH a journal's notes by --comment-id
- issue +comment-delete: DELETE a journal by --comment-id
--comment-id is validated as an integer before any API call.
Production-verified against gitlink.org.cn: full create -> list ->
edit -> delete round-trip on a real issue. Includes 6 unit tests,
bilingual README examples, and en-US/zh-CN i18n keys.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Adds a repo +edit shortcut that updates repository metadata via
PATCH /:owner/:repo.json: --description, --website, --private,
--default-branch, --category-id, --language-id.
The server dispatches on which key is present (website, default_branch,
or general metadata) and the metadata path validates name/identifier,
so the command resolves them from the repository detail first and sends
each field group as its own request. Requires at least one field and
validates --private and integer IDs before any API call.
Production-verified against gitlink.org.cn (description/website update
and default-branch round-trip). Includes 6 unit tests and bilingual
README examples plus en-US/zh-CN i18n keys.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Add a complementary soft layer to the hard gates: advisory_flags surface
governance hints (e.g. oversized-but-not-blocked PRs -> suggest splitting) in
the scorecard WITHOUT affecting score or verdict. Hard gates stay the real
teeth; advisory leaves the call to humans.
- additive & backward-compatible: default off; policies lacking the section
behave exactly as before (verified: default policy on real PR #275 yields
zero advisory section, PASS 87/100 unchanged)
- deterministic: consumes only already-collected PR data (no wall-clock input),
preserving same-input -> same-score -> same-verdict
- first flag large_pr_files (changed-files >= threshold) answers the
166-open-PR backlog reality where big PRs should be flagged, not blocked
- evaluate_advisory_flags() is separate from score_dimensions/decide_verdict;
the 5-dim scoring and verdict logic are untouched
- 7 new unit tests (15 total) incl. an invariant that enabling advisory does
NOT change total/verdict; verified live on real open PR #275
- REFERENCE.md 1.9 + gatekeeper.yaml + verification.md E + demo scorecard
Extends the merged gatekeeper line (#90 skill -> #219 workflow -> #220 issueops).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add `search +recommend`, listing the platform's recommended/featured
projects via GET /api/projects/recommend — a discovery endpoint that had
no shortcut coverage. The endpoint returns a bare JSON array; the command
normalizes it into structured data for clean output.
Includes unit tests, bilingual (en-US/zh-CN) help text, README updates,
and a change note. Verified against production gitlink.org.cn.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A Go workflow (subtopic 3) that composes existing gitlink-cli commands
into a reproducible research-team insight pipeline:
[search +users] -> profile statistics x N (+ user +info)
-> aggregate (ability matrix / discipline coverage / roles / languages)
-> render team report (self-contained HTML, inline SVG: ability radar
overlay + collaboration network graph)
-> archive (team-insight.md + command_log.json)
Implemented in Go to match the main repo's stack (shared go.mod, covered
by go build / vet / test / gofmt); standard library only, no third-party
deps. Handles Windows .cmd CLI shims, retries transient TLS timeouts, and
auto-flags mirror-inflated accounts in the report.
Includes unit tests, docs (architecture + runbook + SVG diagram),
run_demo.ps1, sample config, and real demo outputs (3 GitLink members,
19 command invocations). Reuses the gitlink-research-profile skill's
portrait model.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a new AI Agent skill that builds person/team-centric research
portraits from GitLink's native statistics endpoints (consumed via the
`gitlink-cli profile` commands):
- ability radar (influence/contribution/activity/experience/language)
- discipline/major categories
- role distribution (owner/manager/developer/reporter)
- recent activity series and yearly contribution heatmap
- language stack (percent + per-language score)
- team aggregation and cross-discipline collaboration matching
Differentiated from gitlink-research-tracker (topic/project-centric) and
gitlink-contributor-insight (PR-derived activity): this skill is
person/team-centric and uses the platform's native portrait data.
Includes SKILL.md, REFERENCE.md (field reference from real responses),
a real sample report (何慧/@yystopf, with mirror-inflation caveats
correctly applied), and an agent-conversation example. Registered in
skills/README.md.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a `wiki` shortcut group wrapping GitLink's /api/wiki and
/api/wikiExport endpoints, which previously had no shortcut coverage
(wiki management was a guide-listed capability):
- wiki +list -> GET /wiki/wikiPages
- wiki +view -> GET /wiki/getWiki
- wiki +create -> POST /wiki/createWiki
- wiki +update -> PUT /wiki/updateWiki
- wiki +delete -> DELETE /wiki/deleteWiki
- wiki +export -> GET /wikiExport/wikiExport-wrapper
The numeric project ID is resolved from --owner/--repo (or --project-id).
Page content accepts --content/--content-file (base64-encoded
automatically) or --content-base64. create/update/delete support
--dry-run; export supports --type markdown|pdf|html.
Includes unit tests, bilingual (en-US/zh-CN) i18n help text, README
updates, and a change note.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
GitLink uses POST /users/{owner}/messages/read with ids array,
not PATCH on individual message. Fixed code and test accordingly.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Empty string doesn't work as CLI flag value. Use 'clear' keyword instead:
- --label 327264,327265 set labels
- --label clear remove all labels
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Support setting or clearing labels on existing issues:
- --label 327264,327265 set labels
- --label "" clear all labels
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The GitLink v1 API expects issue_tag_ids (array of integers), not label_id.
This fixes the bug where --label was silently ignored when creating issues.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The update API requires PUT, not POST. Previous commit 7a85c6d incorrectly
changed it to POST which caused HTTP 500 errors. Also added shared test
helpers to common package and rewrote wiki tests to match reference files.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The gateway API requires the message field to be present (even as empty
string). Previously update omitted it when --message was not provided,
causing HTTP 500 errors. Also removed dead code in callWikiAPI and added
a test for update without message.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
将 skills/ 目录下 21 个文件中的 gitlink-cli api <METHOD> <PATH> 命令
替换为对应的 Shortcut 命令,修复因 Token 注入不完整导致的 HTML 响应问题。
主要替换:
- api GET /:owner/:repo/languages → repo +languages
- api GET /:owner/:repo/sub_entries → repo +files
- api GET /:owner/:repo/raw/... → repo +raw
- api POST /:owner/:repo/create_file → repo +create-file
- api POST /:owner/:repo/pulls/:id/reviews → pr +review
- api GET /:owner/:repo/pulls/:id → pr +view
- 等共 107 处替换
注: 6 处 pm 域命令暂留(pm 模块尚未构建)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- heatmap: show user contribution heatmap with optional --year flag
- stats: show user development statistics with optional --start-time/--end-time
- trends: show user project trends
- includes 11 new unit tests covering normal paths, parameter validation, and HTTP error handling
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add three new shortcuts to the pr module:
- commits: list commits in a pull request (v1 API)
- branches: list branches for PR creation
- check-merge: check if two branches can be merged
Each shortcut includes unit tests covering both success and HTTP error paths.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add 5 new repo shortcuts:
- languages: show language breakdown
- contributors: list contributors with pagination
- files: list directory contents with ref/path filters
- tags: list tags with pagination
- commits: list commits with sha/path filters
Include 13 unit tests covering normal paths and HTTP error paths.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- heatmap: show user contribution heatmap with optional --year flag
- stats: show user development statistics with optional --start-time/--end-time
- trends: show user project trends
- includes 11 new unit tests covering normal paths, parameter validation, and HTTP error handling
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add three new shortcuts to the pr module:
- commits: list commits in a pull request (v1 API)
- branches: list branches for PR creation
- check-merge: check if two branches can be merged
Each shortcut includes unit tests covering both success and HTTP error paths.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add 5 new repo shortcuts:
- languages: show language breakdown
- contributors: list contributors with pagination
- files: list directory contents with ref/path filters
- tags: list tags with pagination
- commits: list commits with sha/path filters
Include 13 unit tests covering normal paths and HTTP error paths.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Tests set Owner on RuntimeContext, not on the global cmdutil variable.
This fixes all 4 notification test failures.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add gitlink-growth skill (SKILL.md) with workflow for PR/Issue activity
tracking, contributor rankings, and badge awarding. Include report template
and SQL query reference with exploration queries for data-driven badge design.
2026-05-26 22:29:14 +08:00
818 changed files with 90275 additions and 6230 deletions
The official [GitLink](https://www.gitlink.org.cn) CLI tool — built for humans and AI Agents. Supports **macOS, Linux, and Windows**. Covers repository management, issue tracking, pull requests, webhooks, member collaboration, CI/CD, and AI-powered workflows, with 40+ commands and AI Agent [Skills](./skills/README.md).
The official [GitLink](https://www.gitlink.org.cn) CLI tool — built for humans and AI Agents. Supports **macOS, Linux, and Windows**. Covers repository management, wiki pages, issue tracking, pull requests, webhooks, member collaboration, CI/CD, and AI-powered workflows, with 40+ commands and AI Agent [Skills](./skills/).
**[中文文档](./README.zh-CN.md)**
@ -78,20 +78,12 @@ The official [GitLink](https://www.gitlink.org.cn) CLI tool — built for humans
- **Agent-Native Design** — Structured [Skills](./skills/README.md) out of the box, compatible with Claude Code, OpenClaw, and other AI platforms — Agents can operate GitLink with zero extra setup
- **Wide Coverage** — Repository, Issue, PR, Webhook, Member, Branch, Release, CI, Pipeline, Org, Search, and User workflows are covered by high-level commands
- **Agent-Native Design** — Structured [Skills](./skills/) out of the box, compatible with Claude Code, OpenClaw, and other AI platforms — Agents can operate GitLink with zero extra setup
- **Wide Coverage** — Repository, Wiki, Issue, PR, Webhook, Member, Branch, Release, CI, Pipeline, Org, Search, and User workflows are covered by high-level commands
- **AI-Friendly & Optimized** — Every command is tested with real Agents, featuring concise parameters, smart defaults, and structured output
- **Cross-Platform** — Runs on macOS, Linux, and Windows (x64/arm64), install via `npm install -g @gitlink-ai/cli` in one command, binary auto-downloaded
- **Open Source, Zero Barriers** — MulanPSL-2.0 license, ready to use, just `npm install`
@ -104,7 +96,8 @@ The official [GitLink](https://www.gitlink.org.cn) CLI tool — built for humans
This change adds a new `attachment` shortcut group to `gitlink-cli` so users can upload and delete standalone attachments without dropping down to raw API calls.
This change expands branch management coverage so repository maintainers can complete more of the branch lifecycle from `gitlink-cli` without falling back to manual API calls.
## Commands
- `branch +all`
- `branch +set-default`
- `branch +restore`
## Improvements
- `branch +list` now supports `--state` so users can inspect visible branches, deleted branches, or all branch records.
- `branch +list` now supports `--keyword` to filter branches by name on the server side.
- The README examples document the deleted-branch recovery flow so users can retrieve `branch_id` and restore the branch in one CLI workflow.
## API Mapping
| Shortcut | Method | API path |
|----------|--------|----------|
| `branch +all` | GET | `/api/v1/{owner}/{repo}/branches/all.json` |
- Both commands support `--name` filtering and return the original API response in the configured output format.
This closes a small but useful OpenAPI coverage gap for repository bootstrap workflows. Agents and scripts can now discover valid license and ignore template names before creating repositories, without falling back to raw API paths.
Adds higher-level compare shortcuts so users and AI agents can inspect commit lists and summarize branch differences without manually stitching together raw compare responses.
## Commands
| Command | Purpose |
|---------|---------|
| `gitlink-cli compare +commits` | List commits between two refs with optional author, keyword, limit, and reverse filters. |
| `gitlink-cli compare +summary` | Summarize compare metadata, commit sample, changed file totals, file status counts, top files, path groups, and extension groups. |
## Behavior
- Reuse the existing compare endpoint so branch, tag, and commit refs keep the same URL-safe encoding behavior.
- Normalize commit output into stable fields such as `subject`, `author_login`, and `committer_login`.
- Aggregate compare file data into top changed files, directory groups, extension groups, and created / modified / deleted / renamed counts.
- Mark truncated summaries when `--max-files` analyzes only part of a large compare result.
- Validate `compare +files`, `compare +commits`, and `compare +summary` numeric flags before sending API requests.
Added `gitlink-cli ignore +list` to expose GitLink's `.gitignore` template catalog from the CLI. This fills the OpenAPI wrapper gap for `GET /ignores` and helps repository bootstrap workflows pick a valid ignore template before creating a project.
## Commands
| Command | Method / Endpoint | Purpose |
| --- | --- | --- |
| `ignore +list` | `GET /ignores` | List all built-in `.gitignore` templates |
| `ignore +list --name Go` | `GET /ignores?name=Go` | Filter templates by name |
## Validation
```bash
GOPROXY=https://goproxy.cn,direct go test ./shortcuts/ignore ./shortcuts
Added a new `message-settings` shortcut group for managing notification delivery preferences from the CLI.
Included commands:
- `message-settings +catalog`
- `message-settings +view`
- `message-settings +update`
- `message-settings +preset`
This change normalizes the setting catalog into stable `Group::Key` identifiers, enriches user settings with group and display names, supports safe partial updates with `--dry-run`, and preserves unspecified settings while updating only the selected keys or groups.
This change expands the `org` shortcut group from basic organization lookup into an operational workflow for team and membership management.
The updated command set keeps `org +list`, `org +info`, and `org +create`, and adds stronger organization administration coverage:
- `org +members` now supports `--all`, `--team`, `--login`, and `--keyword`, and automatically fetches all pages before applying filters.
- `org +teams` lists organization teams with `--authorize`, `--unit`, `--keyword`, and `--include-users` support, returning normalized team summaries.
- `org +team-create` creates a team and supports `--dry-run` for request preview.
- `org +member-remove` removes an organization member by `--user-id` or resolves `--login` automatically, with `--dry-run` support.
The output shape is normalized for automation use. Member results now include matched counts, team summaries, and consistent user fields. Team results expose permission-level aggregation, unit information, and optional normalized user details.
The command examples in `README.md` were extended so the new team and member management flows are discoverable from the main project documentation.
`gitlink-cli pr` 已覆盖合并请求的列表、详情、评审、评论等操作,`gitlink-cli ci +builds` 可列出仓库的 CI 构建,但两者相互独立。用户或 AI Agent 想确认「某个合并请求的最新提交是否通过了 CI」,此前需要手动读取 PR 的源分支/源提交,再逐条比对构建列表。
本次变更新增 `pr +checks`,对齐 `gh pr checks` 的语义:解析合并请求 head,自动关联并汇总对应的 CI 构建状态。
## 变更内容
- 新增 `gitlink-cli pr +checks --id N` Shortcut。
- 先 `GET /{owner}/{repo}/pulls/{id}` 读取合并请求详情,取源分支 `head` 与源提交 `head_commit_sha`(字段依据 API 文档「获取一个合并请求」章节)。
- 再 `GET /{owner}/{repo}/builds` 拉取 CI 构建列表,在客户端按 head 提交/分支筛选。
This change adds a `pr +edit` verb, bringing pull requests in line with `issue`, `label`, `release`, `milestone`, and `webhook`, which already expose an edit/update command.
## Commands
- Add `pr +edit` for `PUT /api/{owner}/{repo}/pulls/{index}.json`.
## Behavior
- `pr +edit` first GETs the current PR (the same `/pulls/{index}` path used by `pr +view`), then merges the requested changes onto its current values before the PUT. The update endpoint requires `title`, `body`, `head`, `base`, `issue_tag_ids`, and `receivers_login` together, so unspecified flags fall back to the existing values to avoid clobbering them.
- Flags: `--title`, `--body`, `--base`, `--head`, and `--tag-ids` (comma-separated). At least one is required.
- `--tag-ids` replaces the tag set when given; otherwise the PR's current tag IDs are preserved.
- PR detail fields are read defensively across the top-level, `pull_request`, and `issue` scopes, matching how the health checks parse the same endpoint.
## Verification
- Unit tests cover field preservation, tag-id override, the nested `pull_request` response shape, the missing-field guard, and the HTTP error path.
`gitlink-cli pr +view` now normalizes pull request lifecycle timestamps so merged and closed pull requests expose stable top-level time fields in JSON output.
## Command
| Command | Purpose |
|---------|---------|
| `gitlink-cli pr +view` | Return PR detail and normalize `created_at`, `merged_at`, `closed_at`, and `closed_on` when GitLink provides them directly or journals can infer them. |
## Behavior
- Promote `created_at` and `merged_at` from nested response objects to the top-level payload.
- Backfill `closed_at` and `closed_on` for merged pull requests when GitLink omits an explicit close timestamp.
- Read issue journals only when a merged or closed pull request is still missing lifecycle timestamps.
- Recognize merge and close journal operations after stripping HTML tags and whitespace.
- Support both `pull_request_status` and `pull_request_staus` status shapes returned by GitLink APIs.
Adds a `reaction` shortcut group for repository social interactions. The group exposes watcher and stargazer lists plus follow/unfollow and like/unlike actions.
## Commands
| Command | Purpose |
|---------|---------|
| `gitlink-cli reaction +watchers` | List repository watchers |
| `gitlink-cli reaction +stargazers` | List repository stargazers |
| `gitlink-cli reaction +follow` | Follow a repository |
| `gitlink-cli reaction +unfollow` | Unfollow a repository |
| `gitlink-cli reaction +like` | Like a repository |
| `gitlink-cli reaction +unlike` | Unlike a repository |
## Behavior
- `+watchers` and `+stargazers` support optional `--start-at` and `--end-at` Unix timestamp filters.
- Write actions accept optional `--project-id`; if omitted, the shortcut resolves the project ID from `--owner/--repo` automatically.
- Timestamp and project ID inputs are validated before API calls are sent.
## Tests
The unit tests verify list query parameters, project ID auto-resolution, explicit project ID handling, follow/unfollow endpoints, like/unlike endpoints, and validation failures.
This change fills the missing release asset workflow in `gitlink-cli`, so users can upload files, attach existing assets, inspect attached assets, and detach assets without dropping the rest of the release metadata.
## Commands
- Add `release +assets` to inspect the assets currently attached to a release.
- Add `release +attach` to merge existing attachment IDs into a release.
- Add `release +detach` to remove attachment IDs from a release.
- Add `release +upload` to upload a local file and attach it to a release in one command.
## Behavior
- Add multipart upload support to `internal/client` and expose it through `shortcuts/common.RuntimeContext`.
- Keep the `RuntimeContext` encapsulation instead of calling the low-level client directly from shortcuts.
- Preserve existing release fields when attaching, detaching, or uploading assets, so these commands do not accidentally overwrite `name`, `tag_name`, `body`, `target_commitish`, `draft`, or `prerelease`.
- Accept release tags for asset operations by resolving them to the internal release version ID before write operations.
- Clean up the uploaded attachment automatically if the follow-up release update fails, avoiding orphaned assets.
## Verification
- Add multipart client tests covering field values, uploaded filename, content type, and file body.
# Repository File Read, Search, and Batch Commit Shortcuts
## Summary
This change adds repository file workflow shortcuts for users and automation agents that need to read file content, find files, and commit multiple file changes without manually assembling Raw API calls.
## Commands
| Command | Purpose |
|---------|---------|
| `gitlink-cli repo +file` | Read one repository file with content, commit info, and download metadata |
| `gitlink-cli repo +files` | Search repository files by name with optional branch, tag, or commit filtering |
| `gitlink-cli repo +commit-files` | Commit one file operation or a batch JSON operation list through the `contents/batch` API |
`changes.json` can be either an array of file operations:
```json
[
{
"action_type": "create",
"file_path": "docs/guide.md",
"content": "# Guide\n",
"encoding": "text"
},
{
"action_type": "delete",
"file_path": "docs/old-guide.md"
}
]
```
or an object with a `files` array. The CLI supplies `branch`, `message`, optional author and committer fields, and optional `new_branch` from command flags.
## Validation
- `repo +commit-files` requires `--branch` and `--message`.
- Single-file mode requires `--path`; `create` and `update` require exactly one of `--content` or `--from`.
- `delete` operations reject `content` and `encoding` so the request body matches the API intent.
- `--encoding` accepts only `text` and `base64`.
- `--ops` cannot be combined with single-file flags.
- Author and committer names must be provided together with their matching email fields.
- `--dry-run` prints the resolved request and does not call the remote API.
## Tests
Unit tests cover direct file reads through `sub_entries`, file search query mapping, single-file request bodies, base64 local file reading, JSON batch operation files, dry-run behavior, and validation failures that must not perform an API request.