Skip to content

feat(cli): 一键安装脚本 + CLI↔server 版本兼容门控 + 版本源统一 - #173

Merged
huhamhire merged 6 commits into
devfrom
feat/cli-install-script
Jul 2, 2026
Merged

feat(cli): 一键安装脚本 + CLI↔server 版本兼容门控 + 版本源统一#173
huhamhire merged 6 commits into
devfrom
feat/cli-install-script

Conversation

@huhamhire

Copy link
Copy Markdown
Owner

概述

围绕 meebox CLI 的分发与版本治理补三块能力。

变更

1. macOS / Linux 一键安装脚本 · tools/cli/install.sh

  • curl -fsSL …/tools/cli/install.sh | bash:探测系统/架构 → 解析最新 Release(或 MEEBOX_VERSION/--version)→ 下载 → 校验 SHA-256 → 装入 PATH(默认 /usr/local/bin,不可写回退 ~/.local/binMEEBOX_BIN_DIR/--bin-dir 可覆盖)。
  • 覆盖 Linux + macOS arm64(与已发布产物一致),Windows 走手动下载。不落地 SKILL.md(已内嵌、meebox skill 可导出)。

2. CLI ↔ server 版本兼容门控

  • CLI 每次请求带 X-Meebox-CLI-Version 头。
  • 服务端集中管理最低可兼容版本,请求中间件对所有 API 调用统一门控:版本可解析且低于下限 → 426 Upgrade Required + SV_CLIENT_TOO_OLDESV0005,meta 带 minVersion/clientVersion)。
  • 默认宽松:缺头 / 不可解析(dev 构建)放行,保证既有 CLI 可用;不做按端点差异化。
  • CLI 收到该码即输出「过旧、请升级」提示(含双方版本),不裸报 HTTP 错误。

3. CLI 发布版本号与 app 同源

  • release 版本不再独立取 git tag,改从 apps/desktop/package.json(app 运行期版本的唯一真相源)读取并注入 cmd.version;发布前置已校验 tag 与之一致,故二者一致但只有一个来源。

文档

arch(service-api「版本兼容门控」+ 426、cli 分发/版本源/兼容说明)、guide(安装/升级提示)、AGENTS(版本源)、cli/README / SKILL.md(安装、skill 命令、fallback)全部对齐。

验证

CLI go vet / go test / go build 全过(新增版本头、空版本省略、426→友好错误、安装脚本 bash -n/--help);desktop + shared typecheck / lint / build 全过。

🤖 Generated with Claude Code

huhamhire and others added 6 commits July 2, 2026 13:33
curl … | bash 一条命令完成安装:探测系统/架构 → 解析最新 Release(或 MEEBOX_VERSION/--version)
→ 下载匹配压缩包 → 校验 SHA-256 → 解出 meebox 装入 PATH(默认 /usr/local/bin,不可写回退
~/.local/bin;MEEBOX_BIN_DIR/--bin-dir 可覆盖)。刻意不落地 SKILL.md(已内嵌、meebox skill 可导出)。
仅覆盖 Linux 与 macOS arm64(与已发布产物一致),Windows 走手动下载。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
guide §2 增一键安装 + 手动下载回退;cli/README 增 Install 节;arch 02-cli 分发段补安装脚本说明。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CLI 请求带 X-Meebox-CLI-Version 头声明版本;服务端据集中管理的最低可兼容版本(MIN_CLI_VERSION)
对所有 API 调用统一门控:版本可解析且低于下限 → 426 + SV_CLIENT_TOO_OLD(meta 带 minVersion /
clientVersion)。默认宽松:缺头 / 不可解析(dev 构建)放行,保证既有 CLI 可用;不做按端点差异化。
新增错误码 ESV0005。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
apiclient 每次请求带 X-Meebox-CLI-Version(版本经 New 注入,空则省略);收到 ESV0005
(HTTP 426)时 APIError.Error() 输出「CLI 过旧、请升级」提示,含双方版本与升级指引。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CLI release 版本不再独立取 git tag,改从 apps/desktop/package.json(app 运行期版本的唯一真相源)
读取并注入 cmd.version;发布前置已校验 tag == 该版本,故二者一致但只有一个来源。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
arch service-api 增「CLI 版本兼容门控」一节 + 426 状态;arch cli 与 AGENTS 记版本取自
apps/desktop/package.json(与 app 同源)+ 版本头门控;guide 增版本过旧升级提示说明。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@huhamhire huhamhire added enhancement New feature or request documentation Improvements or additions to documentation labels Jul 2, 2026
@huhamhire
huhamhire merged commit be09b20 into dev Jul 2, 2026
2 checks passed
@huhamhire
huhamhire deleted the feat/cli-install-script branch July 2, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant