Commit Graph

48 Commits

Author SHA1 Message Date
wbtiger 05af86b431 Merge pull request #379: feat(repo): manage project topics
# Conflicts:
#	shortcuts/repo/repo.go
#	shortcuts/repo/repo_test.go
2026-07-14 21:57:49 +08:00
wbtiger a0668a3c96 Merge pull request #304: fix(i18n): restore locale validation on Windows
# Conflicts:
#	internal/i18n/locales/en-US.json
#	internal/i18n/locales/zh-CN.json
2026-07-14 21:57:40 +08:00
wbtiger 4e6cc86343 Merge pull request #412: feat(issue): 新增 issue +delete 单议题删除
# Conflicts:
#	shortcuts/issue/issue_test.go
2026-07-14 21:57:26 +08:00
wbtiger 3264c53bcc Merge pull request 'fix(output): deterministic --format table ordering and show error status code' (#258) from luwanzhou/gitlink-cli:fix/output-table-determinism into master 2026-07-14 20:43:51 +08:00
wbtiger b44eaa220e Merge pull request 'fix(output): --format table 支持资源包裹列表响应(此前 list 命令表格从不生效)' (#343) from Taoyouce/gitlink-cli:feat/table-list-rendering into master 2026-07-14 20:43:38 +08:00
wbtiger 40e2c610a5 Merge pull request 'feat(pr): 新增 pr +checkout 本地检出 PR 分支(对标 gh pr checkout)' (#356) from Taoyouce/gitlink-cli:feat/pr-checkout into master 2026-07-14 20:43:34 +08:00
wbtiger b45ff6af88 Merge pull request 'feat(issue): add issue +reopen to reopen a closed issue' (#362) from heke1228/gitlink-cli:feat/issue-reopen into master 2026-07-14 20:40:58 +08:00
wbtiger 4b435b0bf9 Merge pull request 'fix(i18n): add missing cmd.ignore.short group description key' (#364) from heke1228/gitlink-cli:fix/ignore-i18n-key into master 2026-07-14 20:40:53 +08:00
wbtiger 2c64b80f4c Merge pull request 'feat(repo): add repo +rename to rename the current repository' (#368) from heke1228/gitlink-cli:feat/repo-rename into master 2026-07-14 20:40:49 +08:00
wbtiger cc12bc7932 Merge pull request 'feat(pr): 全部 pr 子命令统一支持 --number(--id 保留为兼容别名)' (#341) from Taoyouce/gitlink-cli:feat/pr-number-alias into master 2026-07-14 20:37:21 +08:00
wbtiger df36a9aa40 Merge pull request 'feat(branch): add +all and keyword filtering for +list' (#377) from Taoyouce/gitlink-cli:feat/branch-all-and-filter into master 2026-07-14 20:36:46 +08:00
wbtiger 94940a8e56 Merge pull request 'feat(repo): add +git-tree and +blob for low-level git objects' (#388) from Taoyouce/gitlink-cli:feat/repo-git-objects into master 2026-07-14 20:36:37 +08:00
maidamaliziasimnw 0772d35187 fix(i18n): 命令组简介补齐 i18n——修复 ignore 组显示原始键名 cmd.ignore.short,9 个组硬编码英文改为翻译键
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-07-10 18:14:38 +00:00
Taoyouce a36e9c92c3 feat(issue): add issue +delete with --yes confirmation
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).
2026-07-10 11:39:12 +00:00
1os21ka23r9navae6mrro 605829335a feat(repo): add +git-tree and +blob for low-level git objects
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>
2026-07-08 14:59:27 +00:00
1os21ka23r9navae6mrro ca974f111e feat(repo): manage project topics (+topics, +topic-add, +topic-remove)
Wraps the v1 project_topics API:

- repo +topics: searchable, paginated topic list (-k keyword)
- repo +topic-add -n <name>: attach a topic; project_id auto-resolved
  from --owner/--repo (or passed via --project-id)
- repo +topic-remove -t <topic-id>: detach a topic (integer-validated)

Production-verified add/remove round-trip on gitlink.org.cn. 3 unit
tests, README examples, and bilingual i18n keys.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-07-08 14:10:09 +00:00
1os21ka23r9navae6mrro 2e92db38d7 feat(branch): add +all and keyword filtering for +list
- 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>
2026-07-08 14:03:05 +00:00
林晨 (Leo Cheng) 41d2f5bbb0
feat(repo): add repo +rename to rename the current repository
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
2026-07-08 13:49:41 +08:00
林晨 (Leo Cheng) 8f5cc1637d
feat(issue): add issue +reopen to reopen a closed issue
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
2026-07-08 12:11:47 +08:00
林晨 (Leo Cheng) 17ec98f198
fix(i18n): add missing cmd.ignore.short group description key
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
2026-07-08 12:11:33 +08:00
Taoyouce 73a7947e22 feat(pr): 新增 +checkout 本地检出 PR 分支(对标 gh pr checkout) 2026-07-07 16:16:35 +00:00
laurencewannamaker 95a8a37876 fix(output): --format table 支持资源包裹列表响应(此前 list 命令表格从不生效)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-07-05 23:29:15 +00:00
laurencewannamaker b88c90ffd5 feat(pr): 全部 pr 子命令支持 --number(与 issue 命令组语义一致,--id 保留为兼容别名)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-07-05 22:50:17 +00:00
whzy 8e24a8926a fix(i18n): restore locale validation on Windows 2026-06-26 22:12:05 +08:00
co63oc 2c9a8b6192 feat(shortcut): add shortcuts/wiki 2026-06-16 10:24:15 +08:00
luwanzhou 2f4b7674d6 fix(output): deterministic --format table ordering and show error status code
--format table 的渲染依赖 Go map 随机遍历顺序:printMapTable 的行顺序、
以及 collectKeys 补全非优先列后 printSliceTable 的列顺序,每次运行都可能不同,
导致同一命令两次输出不一致,难以对比/diff/脚本断言。

- collectKeys:优先列之后的剩余列改为 sort.Strings 排序,顺序稳定可预期。
- printMapTable:按 collectKeys 顺序输出,行序确定且与列表表列序一致。
- 错误输出:有错误码时显示 Error [<code>]: <message>,便于区分 404/422/500。

仅稳定 table 呈现顺序并丰富错误提示,不影响 json/yaml 输出与成功数据内容。
新增单测覆盖排序、25 次渲染确定性、错误码展示。
2026-06-15 12:59:23 +08:00
Tiger ecc5578cf4 Merge upstream/master: resolve conflicts in README.zh-CN.md and register_test.go
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-14 18:50:50 +08:00
luwanzhou 29ca94db76 feat(dataset): add full dataset CRUD (view/create/update/delete-attachment)
Extend the dataset group beyond the verified project query to the full
documented contract:

- dataset +view              -> GET    /v1/{owner}/{repo}/dataset (+page/limit)
- dataset +list --ids        -> GET    /v1/project_datasets   (prod-verified)
- dataset +create            -> POST   /v1/{owner}/{repo}/dataset
- dataset +update            -> PUT    /v1/{owner}/{repo}/dataset
- dataset +delete-attachment -> DELETE /attachments/{uuid}

Quality over a bare contract port: bilingual (en-US/zh-CN) i18n help,
--dry-run preview on create/update, --yes confirmation guard on the
destructive attachment delete, and license-id validation.

Only /v1/project_datasets is currently reachable on production www; the
per-repo routes follow the published OpenAPI spec and return 404 there
until the platform deploys them (documented in the change note). Unit
tests exercise every command against a mock server.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 14:01:57 +08:00
luwanzhou 7f731eb04f feat(dataset): add dataset query shortcuts
Add a `dataset` shortcut group for querying GitLink research datasets,
which previously had no shortcut coverage:

- dataset +list --ids <ids>  -> GET /v1/project_datasets
- dataset +view              -> GET /v1/project_datasets (project ID
                                 resolved from --owner/--repo)

Only the platform-wide query endpoint is available on production
gitlink.org.cn; the documented per-repo dataset CRUD routes return 404
there (verified against the API), so this group wraps the query endpoint
for both listing and per-repo viewing.

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>
2026-06-14 11:48:22 +08:00
luwanzhou da4c8c0d10 feat(profile): 新增用户画像统计快捷命令
新增只读 profile 命令组,封装此前无 shortcut 覆盖的
GitLink 用户画像统计接口:

profile +ability      -> /users/{user}/statistics/develop
profile +role         -> /users/{user}/statistics/role
profile +major        -> /users/{user}/statistics/major
profile +activity     -> /users/{user}/statistics/activity
profile +contribution -> /users/{user}/headmaps

省略 --user 时默认通过 /users/me 解析当前认证用户。
统计命令支持 --start-time/--end-time 时间窗口,
+contribution 支持 --year 参数。

包含单元测试、中英双语 i18n 帮助文本、README 更新
及变更说明文档。
2026-06-13 23:07:27 +08:00
NeeNe a580562922 chore: 打磨仓库文件树命令文档和国际化 2026-06-08 11:51:54 +08:00
wbtiger dd4ed35448 Merge pull request '修正 Issue 和 PR 列表筛选' (#117) from Mengz/gitlink-cli:mengz/list-filter-fixes into master 2026-06-08 02:24:41 +08:00
wbtiger 723e698db4 Merge pull request '新增 Raw API 批处理执行器' (#124) from Mengz/gitlink-cli:mengz/api-batch-runner into master 2026-06-08 02:24:14 +08:00
wbtiger 03a9d7a942 Merge pull request '修复认证凭据 fallback 配置目录不一致' (#133) from Mengz/gitlink-cli:mengz/auth-config-dir-fallback into master 2026-06-08 02:23:06 +08:00
wbtiger 7e863398aa Merge pull request '新增 CLI 自诊断命令' (#132) from Mengz/gitlink-cli:mengz/doctor-command into master 2026-06-08 02:19:54 +08:00
Mengz d6321e7af5 fix: 统一认证凭据 fallback 配置目录 2026-06-06 18:42:50 +08:00
Mengz dec10afaeb feat: 新增 CLI 自诊断命令 2026-06-06 18:11:45 +08:00
Mengz 35e50a1828 feat: 新增 Raw API 批处理执行器 2026-06-06 11:55:20 +08:00
Mengz 0b48ec90d8 fix: 修正 Issue 和 PR 列表筛选 2026-06-05 11:43:30 +08:00
whzy f4820c03b4 fix(i18n): align schema and gosec annotation 2026-06-03 13:43:56 +08:00
whzy 39306994bc fix(i18n): align schema and check tool lint 2026-06-02 14:59:59 +08:00
whzy 37dfd2e2e2 feat(i18n): add CLI localization foundation 2026-06-01 17:33:10 +08:00
wbtiger 902886cabd Merge pull request 'fix: preserve raw file API paths' (#85) from dtwdtw/gitlink-cli:fix/issue-142586-raw-file-api into master 2026-06-01 01:04:25 +08:00
wbtiger 0170b5b063 test: add comprehensive test coverage across all packages (88.5% → 90.3%)
Add 18 new test files covering formatter, envelope, config, auth,
client, context, register, and all shortcut group packages.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-31 15:41:54 +08:00
wbtiger f7263cc466 chore: add golangci-lint config and fix lint issues
- Add .golangci.yml with 8 essential linters (errcheck, govet,
  ineffassign, staticcheck, unused, errorlint, gosec, misspell)
- Fix real bugs: errors.As, %w wrapping, nil map check, dead code,
  unnecessary conversion, unused parameters
- Add `make lint` target, include it in `make check` pipeline
- Update pre-commit hook to run lint step

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-31 00:37:45 +08:00
fsafasff c28b72d46f fix: preserve raw file API paths 2026-05-29 11:41:10 +08:00
wbtiger 36249f3087 feat: add PR closed time and repo README shortcuts (#49, #52)
PR #49 (dtwdtw): enrich PR view with closed_at from issue journals
- Fetches close timestamp for closed/rejected PRs
- Skips extra API call for open PRs
- 2 new tests

PR #52 (dtwdtw): add repo +readme shortcut
- Fetches README content with optional --ref and --path params
- normalizeAPIPath prevents duplicate /api prefix in client
- 4 new tests (3 client + 1 repo)

Co-authored-by: dtwdtw <dtwdtw>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 00:35:31 +08:00
wbtiger e892370de8 init gitlink-cli 2026-04-17 10:01:30 +08:00