Skip to content

Releases: atomgit-cli/cli

GitCode CLI v0.14.1

Choose a tag to compare

@github-actions github-actions released this 24 Sep 05:09

AtomGit CLI v0.14.1

v0.14.1 是安装与更新层的质量修复版本:npm bootstrap 安装器自动迁移旧 npm 全局安装残留的 bin 软链(现场报告的 refusing non-regular install target 安装失败就此收口)、安装错误信息全面可操作化、被中断安装的事务残留自动清扫并纳入 doctor 诊断、pip / Homebrew / pipx 跨渠道入口保护与渠道专属指引;更新层修复 gc update --help、识别 pnpm 安装形态,并让 Homebrew / deb / rpm 用户获得正确的渠道升级引导。命令入口保持 gc / gitcode 不变。

修复

安装器(npm bootstrap)

  • 旧 npm 全局安装残留软链自动迁移(!569,修复现场安装失败):旧版本经经典 npm 全局渠道安装 @gitcode-cli/cli 且 npm prefix 指向 ~/.local 时,bin 目录会留下指向 node_modules 的 gc/gitcode 软链,此前被一刀切拒绝;现识别为自家渠道残留并事务性迁移为真实文件(备份 + 回滚),断裂软链同样按链接文本识别;软链指向第三方包 gitcode-cli 或无关目标时仍拒绝(不抢占他方命令),但报错带软链指向与针对性处置指引
  • 安装错误信息可操作化(!571):安装失败时逐条透传底层原因(errno + 路径,不再被聚合错误吞掉);安装目录不可创建/不可写、目标被目录占用三类场景的报错均含 --target-dir 逃生指引;chooseGlobalBinDir 兜底失败同样包装
  • 事务残留清扫与诊断(!572):被 SIGKILL / Ctrl-C 中断的安装留下的 *.backup-* / *.tmp-*(每个约 13.6MB)此前永久累积;现安装启动时自动清扫 24 小时以上的陈旧残留(含 Windows .exe 变体与写探针文件),gc doctor install 新增 leftovers 字段检测报告
  • 跨渠道入口保护(!573):替换 pip console script 入口(python shebang 识别)前逐文件警告并附保留 pip 渠道的卸载指引;brew / pipx 软链被拒时给 brew uninstall gc / pipx uninstall gitcode-cli 渠道专属建议(不再误导性建议删软链);安装成功后检测 PATH 遮蔽并告警
  • npm 包装层坐标动态化的发布装配与契约(!570 前置)不受影响;坐标 allowlist 新增契约测试防止漂移复发

更新层

  • gc update --help 修复(!574):npm wrapper 下 --help、--no-update-check、--no-interactive 不再报 "unknown update argument"(违反 agent-friendly 发现契约),--help 输出 wrapper 侧帮助
  • pnpm 安装识别(!574):pnpm 全局安装(含 postinstall 写入路径与 Windows 布局)被正确识别并给出 pnpm add -g <坐标>@latest 升级指引,不再被误分类后走 npm 通道失败;项目级 pnpm 依赖给 pnpm update 指引
  • Homebrew / deb / rpm 升级引导可达(!575):gc update 此前只认 npm wrapper 设置的环境变量,brew 用户得到错误的"下载归档"建议;现与 doctor 共享发行版检测(路径特征 + dpkg/rpm 查询),输出 brew upgrade gc / 包管理器升级指引

发布元数据与 CI

  • brew formula 推送目标、nfpm maintainer/vendor/homepage、发布文档全面收敛 atomgit-cli 组织路径(!570)
  • 修复 GitHub CI 在 Windows 上掩盖 npm 测试失败的问题(多命令 step 改用 bash -e 逐命令失败即失败)

推荐升级方式

短命令快速升级

可信的个人本地环境可优先使用短命令(推荐坐标):

npx -y atomgit-cli@latest install
gitcode version
gitcode doctor install

等价坐标:npx -y @gitcode-cli/cli@latest install(旧坐标长期可用,无需迁移)。

短命令会继承当前目录和用户的 npm 配置。请仅在确认这些配置(包括 .npmrc)可信时使用。

CI、审计、未知项目目录或自定义 npm registry 环境,使用安全强化命令:

npx --yes --ignore-scripts --registry=https://registry.npmjs.org atomgit-cli@latest install
gitcode version

(scoped 坐标加固形式:npx --yes --ignore-scripts --registry=https://registry.npmjs.org --@gitcode-cli:registry=https://registry.npmjs.org @gitcode-cli/cli@latest install)

锁定版本安装

npx --yes --ignore-scripts --registry=https://registry.npmjs.org atomgit-cli@0.14.1 install
gitcode version

(scoped 坐标锁定形式:npx --yes --ignore-scripts --registry=https://registry.npmjs.org --@gitcode-cli:registry=https://registry.npmjs.org @gitcode-cli/cli@0.14.1 install)

其他渠道

  • npm 全局(经典)/ npm-bootstrap:gc update,或上面的 npx 命令
  • pnpm 全局:pnpm add -g atomgit-cli@latest(gc update 会给出该指引)
  • Homebrew:brew update && brew upgrade gc
  • pip / pipx:pip install -U gitcode-cli / 在对应环境升级
  • deb / rpm:通过系统包管理器升级

完整变更

  • 安装层质量链:!569(软链迁移)、!571(错误可操作性 + CI 修复)、!572(残留清扫 + doctor)、!573(跨渠道保护)
  • 发布元数据:!570(allowlist 契约 + brew/nfpm 收敛)
  • 更新层:!574(update --help + pnpm)、!575(渠道引导共享检测)
  • 关联 issue:#591-#597(全部随本版本交付)

GitCode CLI v0.14.0

Choose a tag to compare

@github-actions github-actions released this 22 Sep 08:37

GitCode CLI v0.14.0

v0.14.0 新增仓库 Actions 权限控制命令(单仓库与组织批量),修复插件目录分页解析;npm 分发进入三坐标并行时代(推荐 atomgit-cli),自动更新器随所装坐标自更新;项目仓库已迁移至 atomgit-cli/cli(GitCode 与 GitHub 双端 rename,旧链接经重定向继续可用)。

新功能

Actions 域

  • gc actions setting enable|disable — 仓库级 Actions 权限控制:-R owner/repo 单仓库或 --org <name> 批量启用/停用组织下全部仓库的 Actions(解决组织下仓库较多时逐个网页操作的问题)
    • 先读取每个仓库当前配置,仅修改 action_enabled 并保留其余权限字段;已处于目标状态的仓库跳过且不发送请求
    • 批量模式逐仓记录 updated / unchanged / failed(部分失败不中止,退出码 1 反映);组织列表分页采用首个空页终止 + 1000 页上限
    • 该接口使用 GitCode 网页会话 JWT(经典 PAT 不适用):交互式隐藏回显输入,或 --with-token 从 stdin 读取;JWT 仅在内存中使用
    • 危险操作确认门(家族式确认短语 {action} Actions for {target}),非交互需 --yes;--json 输出逐仓结果

OpenHarmony(arm64)npm 分发

  • npm 包新增 OpenHarmony arm64 支持:捆绑 gc-linux-arm64 静态二进制在 OpenHarmony 标准系统(Linux 内核)直接运行,npx ... install 一步引导,无需单独下载
  • 平台别名收窄:openharmony 仅在 arm64 下映射为 linux 二进制(见修复节)

npm 三坐标并行分发

  • 推荐坐标 atomgit-cli:@atomgit-cli/cli 与 @gitcode-cli/cli 并行等价,三坐标内容一致、版本同步演进、命令入口保持 gc / gitcode 不变
  • 三坐标为长期并行承诺,不设弃用时间表:每次正式发布以同一版本号发布全部坐标,发布流水线校验三坐标 dist-tag 一致
  • 自动更新器随所装坐标自更新:npm 包装层不再硬编码单一坐标——更新检查、精确安装、健康检查路径全部取自 package.json,各坐标只更新自身,不跨坐标安装
  • 注意:npm 上的裸名 gitcode-cli 为第三方无关项目(自带同名 gc 入口),非本工具,请勿安装

修复

  • gc actions plugin list 返回空列表:官方目录接口返回 content 分页包装且服务端单页上限 50(此前客户端按 100 请求并只识别旧包装字段,静默返回空)——现按服务端分页元数据取回全部页(51 个插件全部可见),无法识别的响应结构明确报错而非静默为空;翻页设 1000 页上限
  • npm openharmony 别名收窄到 arm64:OpenHarmony 标准系统仅 arm64 形态,openharmony/x64 现明确判定为不支持并给出合法组合提示(此前会误装 linux-x64 二进制)
  • gc actions setting 等写命令的 web-api 401 指引改为会话 JWT 专用说明,不再误导用户刷新 PAT

治理与流程

  • SIG 治理框架落地:spec/governance/sig-governance.md(状态机、单人模式限制、决策表)+ 三个试点 SIG(api / cli-ux / governance)+ RFC 流程(docs/rfcs/)+ YAML 校验脚本
  • 合并授权规则:AI 代理评审结论不构成合并授权,合并须人工逐 PR 明确指令;平台审批受限与零审批记录情形必须人工确认(spec/workflows/pr-workflow.md §9)
  • 仓库迁移:gitcode-cli/cli → atomgit-cli/cli(GitCode 与 GitHub 同步 rename,issue/PR 历史完整保留;Go module path 不变,不影响源码构建)

Agent-Friendly 改进

  • actions setting 支持 --json(写路径结果),预览/确认/失败明细走 stderr,stdout 仅结构化结果
  • 非交互缺 JWT 时在任何网络请求前 fail-fast(exit 2,零请求发出)

推荐升级方式

短命令快速升级

可信的个人本地环境可优先使用短命令(推荐坐标):

npx -y atomgit-cli@latest install
gitcode version
gitcode doctor install

等价坐标:npx -y @gitcode-cli/cli@latest install(旧坐标长期可用,无需迁移)。

短命令会继承当前目录和用户的 npm 配置。请仅在确认这些配置(包括 .npmrc)可信时使用。

CI、审计、未知项目目录或自定义 npm registry 环境,使用安全强化命令:

npx --yes --ignore-scripts --registry=https://registry.npmjs.org atomgit-cli@latest install
gitcode version

(scoped 坐标加固形式:npx --yes --ignore-scripts --registry=https://registry.npmjs.org --@gitcode-cli:registry=https://registry.npmjs.org @gitcode-cli/cli@latest install)

锁定版本安装

npx --yes --ignore-scripts --registry=https://registry.npmjs.org atomgit-cli@0.14.0 install
gitcode version

(scoped 坐标锁定形式:npx --yes --ignore-scripts --registry=https://registry.npmjs.org --@gitcode-cli:registry=https://registry.npmjs.org @gitcode-cli/cli@0.14.0 install)

完整变更

  • Actions setting 专项:!550(两轮 8 角色评审 + 人工写路径验证)
  • 多坐标并行:!564(动态坐标客户端)、!565(发布流水线 allowlist + 一致性门禁 + 恢复 v2)
  • OpenHarmony arm64 npm 分发:!515(含鸿蒙 arm64 真机流水线验证)、!549(别名收窄 arm64 + 文档对齐)
  • api-doc 同步:!552(actions run stop/rerun/retry 标记 native 覆盖)
  • 本轮合入 PR:!515/!549/!550/!551/!552/!553/!554/!555/!564/!565

GitCode CLI v0.13.0

Choose a tag to compare

@github-actions github-actions released this 16 Sep 03:28

GitCode CLI v0.13.0

v0.13.0 新增 13 个命令,覆盖 Actions 流水线写操作(停止/重跑/按 job 重试)、插件目录查询、SSH 公钥管理、仓库归档、组织与仓库讨论写操作,并落地 CI 凭证泄漏扫描防线。

新功能

Actions 域

  • gc actions run stop — 停止运行中的流水线(POST /api/v8/.../runs/{run_id}/stop),服务端幂等;带确认门保护(默认交互确认,--yes 跳过,非交互未携带 --yes 立即失败)
  • gc actions run rerun — 重跑整条流水线的全部 jobs(POST .../runs/{run_id}/rerun),仅 complete 状态的 run 可重跑,RUNNING 状态返回冲突(退出码 5);带确认门
  • gc actions run retry — 按 job 重试而不重跑整条流水线(POST .../runs/{run_id}/retry,body {"job_run_ids":[...]}):--job 可重复指定或 --failed 选择全部失败/取消 job;客户端前置校验 job 归属(服务端会静默接受跨 run 的 job id)并对 job 列表截断防御(total_count 与返回数不一致时拒绝执行);带确认门,确认文案列出将重试的 job 清单
  • gc actions run list 增强 — 按创建日期(--created,YYYY-MM-DD)与 commit SHA(--commit,完整 40 位)过滤流水线运行记录
  • gc actions plugin list/view — 查询 GitCode 官方 Actions 插件目录:列举可用插件、查看插件版本与 README

认证与 SSH 密钥

  • gc auth setup-git — 将 gc 配置为 git credential helper,git 操作自动携带认证;幂等追加不覆盖既有配置,纯客户端命令
  • gc ssh-key list/view/add/delete — SSH 公钥管理:add 支持 --title + 密钥文件、公钥 wire format 校验、终端输出安全过滤(sanitize);delete 含确认门;支持 --dry-run 与 --json

仓库与 Release

  • gc repo archive/unarchive — 仓库归档与恢复(归档后只读),带确认门保护与 --json
  • gc release delete-asset — 删除 release 附件,asset-id 来源 gc release view <tag> --json

标签与讨论

  • gc label edit — 更新标签名称与颜色(--new-name/--color)
  • gc discussions project delete — 删除仓库讨论(带确认门)
  • gc discussions project comments create — 在仓库讨论下创建评论
  • gc discussions delete — 删除组织讨论(带确认门)
  • gc discussions comments delete — 删除组织讨论评论/回复(带确认门)

修复

  • Windows 下 actions plugin 测试因 /tmp 路径不存在导致的基线失败(改用 t.TempDir())
  • gc release 资产操作错误链改进(WrapNotFound + asset-id 来源帮助)
  • gc auth setup-git 帮助文本披露 git-credential 跟进限制

安全

  • CI 凭证泄漏扫描防线:GitCode 与 GitHub 双平台 CI 新增 Secret Scan job(gitleaks v8.30.1,--redact=100 脱敏输出);GitCode 侧检测浅克隆并 --unshallow 补全历史后全量扫描(fail-closed)
  • 提交纪律成文:spec/foundations/security.md 新增「本地防线与提交纪律」(精确暂存、提交前复核、禁止 --no-verify、新 clone 必装钩子、误报登记 .gitleaksignore)
  • 写命令家族统一确认门(ConfirmOrAbort + --yes)与安全输出约定(红色 ✗ 前缀标识破坏性操作,JSON action 字段统一过去式)

Agent-Friendly 改进

  • 全部新命令支持 --json(只读与写路径结果均覆盖)
  • 写命令默认交互确认,非 TTY 未携带 --yes 立即失败(退出码 2),无隐式阻塞
  • actions run retry 的 job 归属校验与截断防御在请求前完成,未确认/未通过校验时 0 请求发出
  • docs/COMMANDS.md --json 命令索引(只读清单 + 写路径清单)与目录/章节顺序完整维护

推荐升级方式

短命令快速升级

可信的个人本地环境可优先使用短命令:

npx -y @gitcode-cli/cli@latest install
gitcode version
gitcode doctor install

短命令会继承当前目录和用户的 npm 配置。请仅在确认这些配置(包括 .npmrc)可信时使用。

CI、审计、未知项目目录或自定义 npm registry 环境,使用安全强化命令:

npx --yes --ignore-scripts --registry=https://registry.npmjs.org --@gitcode-cli:registry=https://registry.npmjs.org @gitcode-cli/cli@latest install
gitcode version

锁定版本安装

npx --yes --ignore-scripts --registry=https://registry.npmjs.org --@gitcode-cli:registry=https://registry.npmjs.org @gitcode-cli/cli@0.13.0 install
gitcode version

完整变更

  • Actions run 写命令专项:stop(!541)、rerun(!542)、retry(!543),两轮多角色评审 + 真实命令验证
  • 本轮合入 PR:!507/!508/!509/!510/!512/!513/!520/!525/!528/!532/!533/!541/!542/!543/!544/!545/!546/!547
  • CI Secret Scan 防线复盘:!546(gitleaks 双平台 + unshallow 全历史 + 提交纪律成文)

GitCode CLI v0.12.0

Choose a tag to compare

@github-actions github-actions released this 12 Aug 08:16

GitCode CLI v0.12.0

v0.12.0 是 gh-parity 专项里程碑版本,新增 13 个命令对齐 GitHub CLI,覆盖 actions workflow 管理、仓库配置、用户/搜索/浏览等核心能力。

新功能

Actions 域

  • gc actions run watch — 轮询监控流水线运行直到终态,支持 --interval/--compact/--exit-status,非 TTY 输出单次快照不阻塞
  • gc actions workflow list — 列举仓库流水线文件(GET /api/v8/.../actions/workflows),支持 --json/--limit/--page
  • gc actions workflow run — 手动触发流水线 dispatch(POST .../workflows/{id}/dispatches),支持 --ref/-f key=value/--json

仓库管理

  • gc repo branch list — 列举仓库全部分支,标记默认分支
  • gc repo branch create — 从指定 ref 创建分支,支持 --ref/--description
  • gc repo branch-protection list/create/update/delete — 保护分支规则 CRUD(4 个 API 端点),delete 含 --yes 确认保护
  • gc repo pr-settings view/update — PR 门禁合入规则管理(24 字段:流水线必过/禁止自合入/评审人数/合并模式/Squash/CLA/轻量级 PR 等),指针类型区分未提供与零值
  • gc repo edit — 更新仓库设置(description/homepage/private/public/default-branch/name),PATCH 后 re-read 完整对象

通用命令

  • gc browse — 在浏览器打开 GitCode 资源(repo/issue/PR/branch/commit),纯客户端,--no-browser 仅输出 URL,非 TTY 自动不阻塞
  • gc repo set-default — 设置/查看/清除默认仓库,纯客户端配置,GC_DEFAULT_REPO 环境变量覆盖
  • gc config list — 列出全部配置项及来源(environment/config/default),update.mode 默认 notify
  • gc config clear-cache — 清除 CLI 缓存目录

用户与搜索

  • gc user view — 查看当前用户或指定用户资料(GET /user, GET /users/{username})
  • gc user edit — 更新用户资料(PATCH /user),--name/--bio/--email/--company/--location/--website,--bio 经 secret 扫描
  • gc search repos/issues/users — 搜索仓库/Issues/用户(3 个 GET 端点),issues 支持 --repo/--state 过滤

PR 增强

  • gc pr edit 增强扩展 — 新增 --add-assignee/--remove-assignee/--add-reviewer/--remove-reviewer/--add-tester/--remove-tester(9 个 API 端点),对齐 gh pr edit --reviewer

修复

  • Windows PATH 持久化与并发安全加固(序列化 PATH 更新、保护 mutex、持久化 user PATH)

安全

  • 所有 --description/--bio/--pusher/--merger 等自由文本字段经 cmdutil.ScanContentForSecrets 扫描
  • delete 类命令(branch-protection delete)含 ConfirmOrAbort 确认保护 + --yes 跳过
  • assertNoAccessTokenQuery 安全断言覆盖所有新 API 函数

Agent-Friendly 改进

  • --json 输出覆盖全部新只读和写路径命令
  • 空+JSON 始终输出 [](agent-friendly 契约)
  • --no-interactive 在 TTY 下抑制浏览器打开和非交互行为
  • docs/COMMANDS.md --json 命令索引完整维护

推荐升级方式

短命令快速升级

可信的个人本地环境可优先使用短命令:

npx -y @gitcode-cli/cli@latest install
gitcode version
gitcode doctor install

短命令会继承当前目录和用户的 npm 配置。请仅在确认这些配置(包括 .npmrc)可信时使用。

CI、审计、未知项目目录或自定义 npm registry 环境,使用安全强化命令:

npx --yes --ignore-scripts --registry=https://registry.npmjs.org --@gitcode-cli:registry=https://registry.npmjs.org @gitcode-cli/cli@latest install
gitcode version

锁定版本安装

npx --yes --ignore-scripts --registry=https://registry.npmjs.org --@gitcode-cli:registry=https://registry.npmjs.org @gitcode-cli/cli@0.12.0 install
gitcode version

完整变更

  • 里程碑 gh-parity
  • 13 个 PR 合入:#481/#489/#490/#493/#494/#496/#497/#498/#499/#500/#501/#502/#503/#505

GitCode CLI v0.11.1

Choose a tag to compare

@github-actions github-actions released this 11 Aug 02:16
e8bb5fc

GitCode CLI v0.11.1

v0.11.1 是安装可靠性补丁版本,修复 Linux/macOS 上历史 gitcode -> gc 符号链接导致 npm bootstrap 拒绝升级的问题。

修复

  • 官方 registry 隔离的一行 bootstrap 现在能够自动迁移历史版本留在同一目录中的 gitcode -> gc 别名,无需先卸载 PyPI 包或手工删除链接。
  • 迁移只接受实际文件身份与同目录常规 gc 文件完全一致的链接;主程序目标、未知链接、越界链接及 Windows 符号链接继续拒绝覆盖。
  • 链接移动前后都会重新验证真实文件身份,不符合安全边界的链接会拒绝迁移。
  • 安装事务失败时会安全恢复旧二进制和原始链接;无法完整恢复时会明确报错并保留可恢复信息。

推荐升级方式

修复历史 npm bootstrap 安装

可信的个人本地环境可优先使用短命令:

npx -y @gitcode-cli/cli@latest install
gitcode version
gitcode doctor install

短命令会继承当前目录和用户的 npm 配置。请仅在确认这些配置(包括 .npmrc)可信时使用。

CI、审计、未知项目目录或自定义 npm registry 环境,使用安全强化命令:

npx --yes --ignore-scripts --registry=https://registry.npmjs.org --@gitcode-cli:registry=https://registry.npmjs.org @gitcode-cli/cli@latest install
gitcode version
gitcode doctor install

固定版本复现同样使用安全强化参数:

npx --yes --ignore-scripts --registry=https://registry.npmjs.org --@gitcode-cli:registry=https://registry.npmjs.org @gitcode-cli/cli@0.11.1 install

不要使用 npm i @gitcode-cli/cli 安装全局 CLI;它只会添加当前项目依赖,不会更新 PATH 中已有的 gitcode。

npm 全局安装

npm install -g --ignore-scripts --registry=https://registry.npmjs.org --@gitcode-cli:registry=https://registry.npmjs.org @gitcode-cli/cli@latest
gitcode version

如果 PATH 中仍优先解析到其他渠道的旧入口,可直接运行 npm 安装目录中的 gitcode doctor install --json 查看精确冲突路径;不需要预先卸载其他包管理器。

Homebrew

brew update
brew upgrade gc

Wheel(pipx 或虚拟环境)

pipx upgrade gitcode-cli

或在已激活的虚拟环境中安装:

python -m pip install https://gitcode.com/gitcode-cli/cli/releases/download/v0.11.1/gitcode_cli-0.11.1-py3-none-any.whl

Debian / Ubuntu

wget https://gitcode.com/gitcode-cli/cli/releases/download/v0.11.1/gc_0.11.1_amd64.deb
sudo dpkg -i gc_0.11.1_amd64.deb

RHEL / CentOS / Fedora

wget https://gitcode.com/gitcode-cli/cli/releases/download/v0.11.1/gc-0.11.1-1.x86_64.rpm
sudo rpm -i gc-0.11.1-1.x86_64.rpm

验证范围

  • Windows npm 全量测试与 Windows 主机契约
  • Linux/WSL 真实符号链接迁移、事务提交、完整回滚及故障注入
  • Linux/macOS 符号链接安全边界与事务回滚
  • GitCode 与 GitHub 双端 CI 的 Linux/macOS/Windows Test、Build、Lint、Package 和 Docker 门禁
  • 独立代码/架构、测试与安全评审

完整安装与命令说明:

GitCode CLI v0.11.0

Choose a tag to compare

@github-actions github-actions released this 10 Aug 14:57
cc9f407

GitCode CLI v0.11.0

v0.11.0 是一次面向安装可靠性、自动化代理和 GitCode 协作能力的功能版本。它统一了多渠道安装与升级诊断,新增 Discussions 和 Actions 工作流能力,并强化了结构化输出、安全边界与跨平台发布链路。

本版本保持向后兼容,没有需要用户迁移的破坏性命令变更。

新功能

  • 安装来源诊断:新增 gitcode doctor install 与稳定 JSON 输出,可识别当前入口、实际二进制、npm/Python/DEB/RPM/Homebrew 等分发来源、PATH 遮蔽及 PowerShell alias 冲突。
  • 统一更新命令:新增 gitcode update --check、gitcode update 和 --json。npm global 与 npm bootstrap 默认每天最多后台检查一次 stable 新版本并仅提示;无人值守自动安装必须显式设置 update.mode auto。
  • Discussions 命令组:支持组织和仓库讨论的 list/view,以及评论与回复的只读查询;文本与 JSON 输出均可用于人工操作和自动化脚本。
  • Actions 工作流增强:新增 gitcode actions yaml validate,通过 GitCode 官方接口校验 workflow YAML;新增 gitcode actions run watch,可轮询运行直到终态并支持 --exit-status、--compact 和 --json。
  • 统一分页参数:主要 list 命令统一提供 --limit 和 --per-page,降低脚本和 AI 代理跨命令调用成本。

安装与更新改进

  • Windows npm bootstrap 同时提供 gc 与 gitcode 入口,并正确处理 PowerShell 的 gc 内置别名。
  • npm 更新保持原安装 prefix,使用精确版本、健康检查、跨进程锁和事务回滚;自定义 prefix 与 Windows 文件占用场景纳入测试。
  • 更新器使用隔离的 npm 配置、官方 generic/scoped registry、最小环境和 --ignore-scripts,不会继承 GitCode、npm、GitHub 或云服务凭证。
  • Release archive、DEB/RPM、wheel、Homebrew 与 npm 统一消费同一组可校验制品;stable 发布到 npm latest,预发布版本发布到 next。
  • Node/Python wrapper 对不支持的平台或架构明确失败,不再错误回退到其他架构。
  • 安装器不会自动卸载其他渠道,也不会静默重写用户 PATH。

修复与安全

  • 修复 pip launcher、npm shim 或系统包之间的 PATH 遮蔽诊断与恢复建议。
  • 修复 debug logger 可能输出敏感 token 的风险,并保持认证信息不进入更新子进程。
  • 修复非交互环境可能触发 Git 凭证提示、确认错误被吞掉、owner/repo 路径未转义等问题。
  • 修复 release 错误链、release 列表排序、fork PR、Docker 帮助退出码和多项跨平台行为。

更新方式

npm(Windows、Node/AI 场景推荐)

npm install -g @gitcode-cli/cli@latest
gitcode update --check
gitcode doctor install

默认只通知。如确实需要无人值守自动安装:

gitcode config set update.mode auto

关闭后台检查:

gitcode config set update.mode off

Homebrew(macOS 推荐)

brew update
brew upgrade gc

Wheel(使用 pipx 或虚拟环境)

pipx upgrade gitcode-cli

或在已激活的虚拟环境中安装正式 wheel:

python -m pip install https://gitcode.com/gitcode-cli/cli/releases/download/v0.11.0/gitcode_cli-0.11.0-py3-none-any.whl

Debian / Ubuntu

wget https://gitcode.com/gitcode-cli/cli/releases/download/v0.11.0/gc_0.11.0_amd64.deb
sudo dpkg -i gc_0.11.0_amd64.deb

RHEL / CentOS / Fedora

wget https://gitcode.com/gitcode-cli/cli/releases/download/v0.11.0/gc-0.11.0-1.x86_64.rpm
sudo rpm -i gc-0.11.0-1.x86_64.rpm

发布验证范围

  • Windows、Linux、macOS 的 Go 构建、单元测试与 npm 真实升级烟测
  • Release archive、DEB、RPM、wheel、sdist、npm tarball 及统一 SHA-256 清单
  • GitCode 与 GitHub tag/main tree/同名资产一致性
  • PyPI、Homebrew、npm global 与 npm bootstrap 安装入口
  • gc、gitcode、version --json、doctor install --json 与显式更新路径

完整安装与命令说明:

GitCode CLI v0.10.3

Choose a tag to compare

@github-actions github-actions released this 04 Aug 12:37

GitCode CLI v0.10.3

v0.10.3 补丁版修复 npm 包的 bin shim并正式以 OIDC Trusted Publishing 从 release workflow 发布 npm。npx @gitcode-cli/cli@latest install 与 npm i -g @gitcode-cli/cli 现可正常使用。

@gitcode-cli/cli@0.10.2 因 bin/gc.js 缺 shebang 导致 npm bin shim 失败,已被 0.10.3 取代(建议对 0.10.2 执行 npm deprecate)。

修复

  • npm bin shebang:npm/bin/gc.js 首行加 #!/usr/bin/env node(并设可执行位)。原缺 shebang 导致 npm 的 node_modules/.bin/gc shim 把 gc.js 当 shell 脚本执行(// 注释报错),npx ... install 与 npm i -g ... && gc 均失败。
  • npm 发布改用 OIDC Trusted Publishing:release workflow npm job 用 permissions: id-token: write + actions/setup-node(Node 24)+ npm publish,npm CLI 自动经 OIDC 短期令牌发布,无 NPM_TOKEN,自动生成 provenance。npm/package.json 的 repository.url 改为 https://github.com/gitcode-cli/cli.git(OIDC 校验)。npm Classic token 已于 2025-11 移除,granular token 无法创建 org 下首个新包,故用 OIDC。

安装

npm(跨平台,本版本首发可用)

npx @gitcode-cli/cli@latest install
# 或
npm install -g @gitcode-cli/cli
gc version

Homebrew (macOS/Linux)

brew install gitcode-cli/homebrew-tap/gc
brew upgrade gc

Wheel(跨平台)

pip install https://gitcode.com/gitcode-cli/cli/releases/download/v0.10.3/gitcode_cli-0.10.3-py3-none-any.whl
gitcode version

Debian / Ubuntu

wget https://gitcode.com/gitcode-cli/cli/releases/download/v0.10.3/gc_0.10.3_amd64.deb
sudo dpkg -i gc_0.10.3_amd64.deb

RHEL / CentOS / Fedora

wget https://gitcode.com/gitcode-cli/cli/releases/download/v0.10.3/gc-0.10.3-1.x86_64.rpm
sudo rpm -i gc-0.10.3-1.x86_64.rpm

完整安装与命令说明:

GitCode CLI v0.10.0

Choose a tag to compare

@github-actions github-actions released this 04 Aug 07:24

GitCode CLI v0.10.0

v0.10.0 新增飞书/Lark 集成(gc lark 命令组),可向飞书群或自己发送通知,面向 AI 代理与脚本自动化。

新增

  • gc lark 命令组:通过官方 lark-cli 子进程委托与飞书/Lark 集成。飞书 OAuth 凭证由 lark-cli 存入操作系统 keychain,gc 不读取、不打印、不日志记录飞书令牌。
    • gc lark send:发送消息,目标三选一(互斥)——--to-self(给自己,自动解析当前用户 open_id,默认 bot 身份,无需群、不受外部群限制)、--user-id ou_xxx(单聊)、--chat-id oc_xxx(群)。内容支持 --text/--markdown/--file/--body-file(- 表示 stdin)。
    • gc lark auth status:查看 lark-cli 登录状态(--json 透传结构化输出)。
    • gc lark install:运行官方安装器 npx @larksuite/cli@latest install(首次运行 lazy 检测)。
    • gc lark doctor:检测 lark-cli 安装 + 登录就绪 + 默认群配置。
    • gc lark config set|get --default-chat:管理默认群(持久化到 ~/.config/gc/lark.json,权限 0600)。
  • 安全:gc lark send 正文经 cmdutil.ScanContentForSecrets 扫描,含当前 GC_TOKEN/GITCODE_TOKEN 值则拒绝发送;lark-cli 子进程不继承 gc 的 stdin,且环境中的 GC_TOKEN/GITCODE_TOKEN 被剥离。
  • 退出码:认证/权限/scope/群成员类失败映射为 exit 4;其余 lark-cli 失败 exit 1;参数错误 exit 2。

文档

  • 新增 docs/LARK.md:飞书通知首次使用指南(安装 lark-cli → 配置应用 → OAuth 登录 → 验证 → 发送 + 令牌刷新/默认群/常见错误/环境变量/安全约束),从 README 与 docs/README.md 可达。

安装

Homebrew (macOS/Linux)

brew install gitcode-cli/homebrew-tap/gc
brew upgrade gc

Wheel(跨平台)

pip install https://gitcode.com/gitcode-cli/cli/releases/download/v0.10.0/gitcode_cli-0.10.0-py3-none-any.whl
gitcode version

Debian / Ubuntu

wget https://gitcode.com/gitcode-cli/cli/releases/download/v0.10.0/gc_0.10.0_amd64.deb
sudo dpkg -i gc_0.10.0_amd64.deb

RHEL / CentOS / Fedora

wget https://gitcode.com/gitcode-cli/cli/releases/download/v0.10.0/gc-0.10.0-1.x86_64.rpm
sudo rpm -i gc-0.10.0-1.x86_64.rpm

飞书通知首次配置(v0.10.0 新增能力)

gc lark install                          # 安装 lark-cli
lark-cli config init --new               # 配置飞书应用(交互,浏览器)
lark-cli auth login --recommend          # OAuth 登录(交互,浏览器)
gc lark doctor                           # 验证安装+登录
gc lark send --to-self --text "hello"    # 给自己发通知

完整指南见 docs/LARK.md。

完整安装与命令说明:

GitCode CLI v0.9.1

Choose a tag to compare

@github-actions github-actions released this 04 Aug 01:58

GitCode CLI v0.9.1

v0.9.1 补丁版新增 Homebrew (macOS/Linux) 安装方式,完善发布安装链路。

新增

  • Homebrew (macOS/Linux) 安装:GoReleaser 生成 formula,发布流程自动推送到 gitcode-cli/homebrew-tap,支持 brew install 与 brew upgrade,shell 补全(bash/zsh/fish)随安装自动配置。

改进与修复

  • 修正 homebrew/gc.rb 模板 URL 与制品命名,对齐 archive 命名规则。
  • 修正 CONTRIBUTING.md Homebrew tap 路径(gitcode-com/tap → gitcode-cli/homebrew-tap)。
  • 发布流程规范同步 Homebrew formula 推送步骤与发布后验证。

安装

Homebrew (macOS/Linux,新增)

brew install gitcode-cli/homebrew-tap/gc
brew upgrade gc

Wheel(跨平台)

pip install https://gitcode.com/gitcode-cli/cli/releases/download/v0.9.1/gitcode_cli-0.9.1-py3-none-any.whl
gitcode version

Debian / Ubuntu

wget https://gitcode.com/gitcode-cli/cli/releases/download/v0.9.1/gc_0.9.1_amd64.deb
sudo dpkg -i gc_0.9.1_amd64.deb

RHEL / CentOS / Fedora

wget https://gitcode.com/gitcode-cli/cli/releases/download/v0.9.1/gc-0.9.1-1.x86_64.rpm
sudo rpm -i gc-0.9.1-1.x86_64.rpm

完整安装与命令说明:

GitCode CLI v0.9.0

Choose a tag to compare

@github-actions github-actions released this 01 Aug 11:24

GitCode CLI v0.9.0

v0.9.0 聚焦可自动化交付、安全门禁和本地开发体验,让人类终端、AI 代理与 CI 使用同一套可验证的 GitCode CLI 工作流。

新增

  • 全局 --no-interactive 模式:非交互环境不会隐式等待输入,需要确认时立即给出可操作错误。
  • 21 个命令新增当前仓库自动识别能力,覆盖更多 Issue、PR、Release、Commit、Label 和 Milestone 场景。
  • 项目级开发环境检查与安装脚本,支持只读检查、主机工具安装和结果汇总。
  • GitCode 原生 Actions CI 流水线,与 GitHub 镜像 CI 共同提供 Linux 和跨平台验证。
  • Issue 支持按 milestone 编号过滤。

改进与修复

  • Issue 创建和编辑按用户名提交负责人,并增加真实读写系统回归。
  • pr edit 保留未指定标签,PR JSON 输出补全最终状态并统一空集合表示。
  • Milestone 详情按实际 Issue 数据计算数量,避免依赖缺失的接口字段。
  • 修复 Web 登录入口、登录模式冲突和 GitCode 域名限制。
  • pre-commit/pre-push 门禁覆盖格式、私钥、敏感信息、工作区和 Git 历史扫描。
  • 系统测试增强临时资源命名、分页清理和残留可观测性。
  • 版本 JSON 输出正确传播写入错误,并统一 API 错误解码。
  • 移除仓库内已废弃的共享 skills,独立 skills 仓库继续作为安装来源。

验证

  • Windows 与 WSL2 Linux amd64:全量 Go UT、integration、race、vet 和 golangci-lint。
  • WSL2 Linux:以 infra-test/gctest1 为唯一对象执行真实只读和写入 system 测试。
  • WSL2 本地打包:Linux amd64/arm64、DEB、RPM、wheel 与 sdist 均构建成功。
  • 全新 Linux venv:gitcode、gc、python -m gc_cli 三个入口均验证通过。
  • pre-commit、pre-push 与 gitleaks 工作区/历史扫描通过。

安全

  • AI 和自动化不得读取、打印或通过命令行参数传递真实 token。
  • 内容写入命令继续执行敏感信息扫描。
  • 本地验证制品不用于正式发布;正式制品由合入后 main 的 release workflow 构建并携带准确 commit SHA。
  • 正式发布将构建与 tag/Release/PyPI 写权限分离,并提供覆盖归档、裸二进制、DEB、RPM、wheel 与 sdist 的 SHA-256 清单。

已知限制

  • GitCode 官方 OpenAPI 当前没有 Release 删除接口;release delete --dry-run 可用于预览,实际删除请使用仓库 Release 页面。

安装

Wheel(推荐,跨平台)

pip install https://gitcode.com/gitcode-cli/cli/releases/download/v0.9.0/gitcode_cli-0.9.0-py3-none-any.whl
gitcode version

Windows 安装后配置

虚拟环境中请先在 PowerShell 运行:

.\.venv\Scripts\Activate.ps1

未使用虚拟环境时,直接安装 GitCode Release 中的 wheel,避免 PyPI 尚未同步新版本时安装到旧版本:

py -m pip install --user --upgrade https://gitcode.com/gitcode-cli/cli/releases/download/v0.9.0/gitcode_cli-0.9.0-py3-none-any.whl
$scripts = py -c "import os, sysconfig; print(sysconfig.get_path('scripts', os.name + '_user'))"
$env:Path = "$scripts;$env:Path"
gitcode version

确认后,将 $scripts 对应目录持久加入 Windows“用户环境变量”的 Path 并重新打开 PowerShell。配置前可直接运行:

py -m gc_cli version

PowerShell 已将 gc 用作 Get-Content 的别名,因此 Windows 推荐使用 gitcode、gc.exe 或 py -m gc_cli。

Debian / Ubuntu

wget https://gitcode.com/gitcode-cli/cli/releases/download/v0.9.0/gc_0.9.0_amd64.deb
sudo dpkg -i gc_0.9.0_amd64.deb

RHEL / CentOS / Fedora

wget https://gitcode.com/gitcode-cli/cli/releases/download/v0.9.0/gc-0.9.0-1.x86_64.rpm
sudo rpm -i gc-0.9.0-1.x86_64.rpm

完整安装与命令说明: