Skip to content

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 与显式更新路径

完整安装与命令说明: