wbtiger
7d706f4e4c
Merge pull request #406 : fix(api): 修复 Windows Git Bash 下 API 路径被 MSYS2 污染导致 404
...
# Conflicts:
# cmd/api/api.go
2026-07-14 21:57:33 +08:00
chroe
bf9ecc4ba2
docs(api): add MSYS2 path fix doc; extract restoreAPIPath for testability
...
- 新增命令帮助文档 doc/changes/api-msys2-path.md(问题/根因/修复/影响/测试)。
- 将 runAPI 内联的路径还原逻辑抽成纯函数 restoreAPIPath,便于单元测试;
并修正一个边界缺陷:路径含多个已知前缀时(如 /api/v1/users)改为取
最早出现的位置,避免误截到 /v1/。
- 新增表驱动 TestRestoreAPIPath 覆盖:正常路径不变、v1/v2/api 污染还原、
无已知前缀保留、空路径。
2026-07-09 22:27:52 +08:00
chroe
b0424aa6d8
fix(api): restore API path polluted by MSYS2/Git Bash on Windows
...
在 Windows Git Bash (MSYS2) 环境下,gitlink-cli api GET /v1/owner/repo
的路径参数会被 MSYS2 自动改写为类似
C:/Program Files/Git/v1/owner/repo 的 Windows 路径(MSYS2 把 /v1
当成 Unix 路径转换为 Git 安装目录),导致 API 调用 404。
修复:在 runAPI 中检测路径首部是否为盘符(^[A-Za-z]:/),
若是则按常见 API 前缀(/v1/ /v2/ /api/ /users/ /projects/)
定位并还原原始 API 路径。
影响所有 Windows Git Bash 用户,跨平台兼容性修复。
2026-07-09 21:41:29 +08:00
luwanzhou
81d30d6741
fix(api): resolve :owner/:repo and --var placeholders in single calls
...
gitlink-cli api <METHOD> <PATH> 单次调用此前直接发送原始路径,不替换
REST 风格的 :owner/:repo 占位符——导致该命令自身的 Example
(api POST /:owner/:repo/issues)以及依赖该写法的 Skill/文档无法使用。
- 新增 resolveAPIPath:先按 --var 渲染 {{var}} 模板(复用批处理模板引擎),
再用 context.ResolveOwnerRepo(--owner/--repo → git remote,与所有 shortcut
一致)替换 :owner/:repo,最后补全前导 /。
- :owner/:repo 正则用 \b 边界避免误伤 :owner_id;ReplaceAllLiteralString
避免 owner/repo 中的 $ 被当作正则替换引用。
- 不含占位符且无 --var 的调用行为不变。
- 更新命令 Example;新增单元测试(占位符解析、单次 --var 渲染、缺失变量报错)。
修复 Issue: api 命令单次调用不替换 :owner/:repo 占位符。
2026-06-15 12:36:58 +08:00
Mengz
35e50a1828
feat: 新增 Raw API 批处理执行器
2026-06-06 11:55:20 +08:00
whzy
37dfd2e2e2
feat(i18n): add CLI localization foundation
2026-06-01 17:33:10 +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
wbtiger
898b7f59d1
feat: add milestone, compare, pr reopen shortcuts and api enhancements ( #45 )
...
- milestone shortcuts: list, create, view, update, delete, close, reopen
- compare shortcuts: view, files (compare branches/tags/commits)
- pr +reopen: reopen closed pull requests
- api: add --body-file and --body-stdin for reading JSON from file/stdin
- comprehensive tests for all new shortcuts
Co-authored-by: wangyue111 <wangyue111>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 00:44:39 +08:00
wbtiger
e892370de8
init gitlink-cli
2026-04-17 10:01:30 +08:00