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>