Skip to content

Commit 55ac6ef

Browse files
committed
feat: add cloud-claude binary release pipeline and install script
Release workflow now cross-compiles cloud-claude for linux/darwin × amd64/arm64, uploads .tar.gz + .sha256 to GitHub Release. - Add build-binaries job to release.yml (4-platform matrix) - Add Version variable to cmd/cloud-claude with ldflags injection - Add scripts/install.sh for one-command install via curl - Add build-cli / install-cli targets to Makefile - Update README install section with curl one-liner - Add /cloud-claude to .gitignore Made-with: Cursor
1 parent 8e41091 commit 55ac6ef

7 files changed

Lines changed: 191 additions & 15 deletions

File tree

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,55 @@ jobs:
116116
git commit -m "docs(changelog): update for v${VERSION}"
117117
git push origin "HEAD:${DEFAULT_BRANCH}"
118118
119+
build-binaries:
120+
needs: create-release
121+
runs-on: ubuntu-latest
122+
strategy:
123+
fail-fast: false
124+
matrix:
125+
include:
126+
- goos: linux
127+
goarch: amd64
128+
- goos: linux
129+
goarch: arm64
130+
- goos: darwin
131+
goarch: amd64
132+
- goos: darwin
133+
goarch: arm64
134+
steps:
135+
- uses: actions/checkout@v4
136+
137+
- name: Setup Go
138+
uses: actions/setup-go@v5
139+
with:
140+
go-version-file: go.mod
141+
cache: true
142+
143+
- name: Build cloud-claude
144+
env:
145+
CGO_ENABLED: "0"
146+
GOOS: ${{ matrix.goos }}
147+
GOARCH: ${{ matrix.goarch }}
148+
run: |
149+
VERSION="${{ needs.create-release.outputs.version }}"
150+
LDFLAGS="-s -w -X main.Version=${VERSION}"
151+
BINARY="cloud-claude-${{ matrix.goos }}-${{ matrix.goarch }}"
152+
go build -ldflags "${LDFLAGS}" -trimpath -o "${BINARY}" ./cmd/cloud-claude
153+
154+
- name: Compress binary
155+
run: |
156+
BINARY="cloud-claude-${{ matrix.goos }}-${{ matrix.goarch }}"
157+
ARCHIVE="cloud-claude-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz"
158+
tar czf "${ARCHIVE}" "${BINARY}"
159+
sha256sum "${ARCHIVE}" > "${ARCHIVE}.sha256"
160+
161+
- name: Upload to release
162+
env:
163+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
164+
run: |
165+
ARCHIVE="cloud-claude-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz"
166+
gh release upload "${{ github.ref_name }}" "${ARCHIVE}" "${ARCHIVE}.sha256" --clobber
167+
119168
publish-images:
120169
needs: create-release
121170
uses: ./.github/workflows/build-images.yml

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Compiled binaries
22
bin/
33
/control-plane
4+
/cloud-claude
45
*.exe
56
*.dll
67
*.so

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export
33

44
DEV_COMPOSE := docker compose -f deploy/compose/control-plane.dev.yml
55

6-
.PHONY: dev dev-api dev-web db test test-go test-smoke build clean gateway-image up up-build down logs release
6+
.PHONY: dev dev-api dev-web db test test-go test-smoke build build-cli install-cli clean gateway-image up up-build down logs release
77

88
# ── Development ──────────────────────────────────────────────
99

@@ -67,14 +67,21 @@ gateway-image: ## Build sing-box + iptables sidecar (required for macOS/Windows
6767
build: ## Build all artifacts
6868
go build -o bin/control-plane ./cmd/control-plane
6969
GOOS=linux GOARCH=amd64 go build -o bin/host-agent ./cmd/host-agent
70+
go build -ldflags "-s -w" -trimpath -o bin/cloud-claude ./cmd/cloud-claude
7071
cd web/admin && pnpm build
7172

7273
build-api: ## Build Go backend only
7374
go build -o bin/control-plane ./cmd/control-plane
7475

76+
build-cli: ## Build cloud-claude CLI
77+
go build -ldflags "-s -w" -trimpath -o bin/cloud-claude ./cmd/cloud-claude
78+
7579
build-web: ## Build frontend only
7680
cd web/admin && pnpm build
7781

82+
install-cli: ## Install cloud-claude to /usr/local/bin
83+
go build -ldflags "-s -w" -trimpath -o /usr/local/bin/cloud-claude ./cmd/cloud-claude
84+
7885
# ── Production ───────────────────────────────────────────────
7986

8087
up: ## Start production stack (prefer prebuilt latest images)

README.en.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Out-of-the-box isolated cloud hosts for Claude Code and dev teams. Pre-installed
1515

1616
[中文](README.md) | [Documentation](https://zanel1u.github.io/cloud-cli-proxy/en/)
1717

18-
**Go · React · PostgreSQL · Docker · WireGuard**
18+
**Go · React · PostgreSQL · Docker · sing-box**
1919

2020
</div>
2121

@@ -26,8 +26,8 @@ Out-of-the-box isolated cloud hosts for Claude Code and dev teams. Pre-installed
2626
- **One-command access**`curl | bash` to authenticate, create container, and SSH in. Zero user config
2727
- **cloud-claude local CLI**`alias claude=cloud-claude` to transparently run remote Claude Code from your local terminal with real-time directory mapping
2828
- **Claude Code ready** — Pre-installed in every container. All API requests auto-routed through designated exit IP
29-
- **Full-tunnel egress**WireGuard + Linux netns / sing-box tun dual-channel, nftables default-deny, no DNS/WebRTC leaks
30-
- **Multi-protocol**WireGuard and 5 proxy protocols (SOCKS5 / VMess / Shadowsocks / Trojan / HTTP)
29+
- **Full-tunnel egress**sing-box tun + Linux netns full-tunnel, nftables default-deny, no DNS/WebRTC leaks
30+
- **Multi-protocol**6 proxy protocols (SOCKS5 / VMess / VLESS / Shadowsocks / Trojan / HTTP)
3131
- **Per-user isolation** — Dedicated Docker containers with KasmVNC remote desktop + Chromium
3232
- **Admin dashboard** — React SPA for users, hosts, egress IPs, events, and stats
3333
- **User self-service** — View host status, rebuild hosts, access VNC desktop
@@ -86,7 +86,7 @@ docker compose -f docker-compose.yml -f docker-compose.build.yaml up -d --force-
8686

8787
Log into the admin dashboard, then:
8888

89-
1. **Add egress IPs**WireGuard config or proxy protocol, with one-click connectivity test
89+
1. **Add egress IPs**Multiple proxy protocols, with one-click connectivity test
9090
2. **Create users** — Set username, password, expiration
9191
3. **Create hosts** — Create container for user and bind egress IP
9292
4. **Share access command** — Copy the `curl` command from host detail page
@@ -106,7 +106,11 @@ Besides SSH access, you can use the `cloud-claude` binary on your local machine
106106

107107
**Install:**
108108

109-
Download from [Releases](https://github.com/ZaneL1u/cloud-cli-proxy/releases), or build from source:
109+
```bash
110+
curl -fsSL https://raw.githubusercontent.com/ZaneL1u/cloud-cli-proxy/main/scripts/install.sh | bash
111+
```
112+
113+
Or download manually from [Releases](https://github.com/ZaneL1u/cloud-cli-proxy/releases), or build from source:
110114

111115
```bash
112116
go build -o cloud-claude ./cmd/cloud-claude
@@ -175,7 +179,7 @@ Containers include KasmVNC + Chromium. Access the browser desktop via admin or u
175179
User ──curl──> Control Plane (:8080) ──Docker──> │ User Container │
176180
│ │ SSH + Claude Code + VNC │
177181
PostgreSQL │ sshfs ← /workspace dir mapping │
178-
│ │ WireGuard / sing-box Tunnel │
182+
│ │ sing-box tun Tunnel
179183
Admin SPA (:3000) │ ↓ │
180184
│ │ Designated Exit IP │
181185
SSH Proxy (:2222) └───────────────────────────────────┘
@@ -238,7 +242,7 @@ Full docs on [GitHub Pages](https://zanel1u.github.io/cloud-cli-proxy/en/):
238242

239243
- [Quick Start](https://zanel1u.github.io/cloud-cli-proxy/en/guide/quickstart) — Deploy and first use
240244
- [Deployment](https://zanel1u.github.io/cloud-cli-proxy/en/guide/deployment) — systemd native deployment
241-
- [Configuration](https://zanel1u.github.io/cloud-cli-proxy/en/guide/configuration) — Environment variables and WireGuard setup
245+
- [Configuration](https://zanel1u.github.io/cloud-cli-proxy/en/guide/configuration) — Environment variables and egress proxy setup
242246
- [Architecture](https://zanel1u.github.io/cloud-cli-proxy/en/guide/architecture) — System design and project structure
243247
- [API Reference](https://zanel1u.github.io/cloud-cli-proxy/en/reference/api) — Full Admin API
244248
- [FAQ & Recovery](https://zanel1u.github.io/cloud-cli-proxy/en/reference/faq) — Troubleshooting and disaster recovery

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
[English](README.en.md) | [Documentation](https://zanel1u.github.io/cloud-cli-proxy/)
1717

18-
**Go · React · PostgreSQL · Docker · WireGuard**
18+
**Go · React · PostgreSQL · Docker · sing-box**
1919

2020
</div>
2121

@@ -26,8 +26,8 @@
2626
- **一条命令接入**`curl | bash` 自动认证、创建容器、SSH 接入,用户无需任何配置
2727
- **cloud-claude 本地 CLI**`alias claude=cloud-claude`,在本地终端透明运行远端 Claude Code,当前目录实时映射
2828
- **Claude Code 开箱即用** — 容器预装 Claude Code,进入即可使用,所有 API 请求自动走指定出口
29-
- **全流量强制出口**WireGuard + Linux netns / sing-box tun 双通道,nftables 默认拒绝策略,杜绝 DNS / WebRTC 泄漏
30-
- **多协议支持** — 出口 IP 支持 WireGuard 和 5 种代理协议(SOCKS5 / VMess / Shadowsocks / Trojan / HTTP)
29+
- **全流量强制出口**sing-box tun + Linux netns 全隧道,nftables 默认拒绝策略,杜绝 DNS / WebRTC 泄漏
30+
- **多协议支持** — 出口 IP 支持 6 种代理协议(SOCKS5 / VMess / VLESS / Shadowsocks / Trojan / HTTP)
3131
- **每用户隔离** — 独立 Docker 容器,预装 KasmVNC 远程桌面 + Chromium 浏览器
3232
- **管理后台** — React SPA 仪表盘,用户、主机、出口 IP、事件日志一站式管理
3333
- **用户自助面板** — 用户可查看主机状态、重建主机、访问 VNC 桌面
@@ -120,7 +120,7 @@ docker compose -f docker-compose.yml -f docker-compose.build.yaml up -d --force-
120120

121121
登录管理后台,依次完成:
122122

123-
1. **添加出口 IP**支持 WireGuard 配置或代理协议,可一键测试连通性
123+
1. **添加出口 IP**支持多种代理协议,可一键测试连通性
124124
2. **创建用户** — 设置用户名、密码、到期时间
125125
3. **创建主机** — 为用户创建容器并绑定出口 IP
126126
4. **分发接入命令** — 在主机详情页复制 `curl` 命令发给用户
@@ -140,7 +140,11 @@ curl -sSf http://YOUR_HOST/entry/abc123 | bash
140140

141141
**安装:**
142142

143-
[Releases](https://github.com/ZaneL1u/cloud-cli-proxy/releases) 下载对应平台的二进制文件,或从源码构建:
143+
```bash
144+
curl -fsSL https://raw.githubusercontent.com/ZaneL1u/cloud-cli-proxy/main/scripts/install.sh | bash
145+
```
146+
147+
也可以从 [Releases](https://github.com/ZaneL1u/cloud-cli-proxy/releases) 手动下载,或从源码构建:
144148

145149
```bash
146150
go build -o cloud-claude ./cmd/cloud-claude
@@ -209,7 +213,7 @@ claude
209213
用户 ──curl──> Control Plane (:8080) ──Docker──> │ 用户容器 │
210214
│ │ SSH + Claude Code + VNC │
211215
PostgreSQL │ sshfs ← /workspace 目录映射 │
212-
│ │ WireGuard / sing-box 隧道
216+
│ │ sing-box tun 隧道
213217
Admin SPA (:3000) │ ↓ │
214218
│ │ 指定出口 IP │
215219
SSH Proxy (:2222) └───────────────────────────────────┘
@@ -327,7 +331,7 @@ make release VERSION=1.5.0
327331

328332
- [快速开始](https://zanel1u.github.io/cloud-cli-proxy/zh/guide/quickstart) — 部署和首次使用
329333
- [部署指南](https://zanel1u.github.io/cloud-cli-proxy/zh/guide/deployment) — systemd 原生部署
330-
- [配置参考](https://zanel1u.github.io/cloud-cli-proxy/zh/guide/configuration)环境变量和 WireGuard 配置
334+
- [配置参考](https://zanel1u.github.io/cloud-cli-proxy/zh/guide/configuration)环境变量和出口代理配置
331335
- [架构说明](https://zanel1u.github.io/cloud-cli-proxy/zh/guide/architecture) — 系统设计和项目结构
332336
- [API 参考](https://zanel1u.github.io/cloud-cli-proxy/zh/reference/api) — 完整 Admin API
333337
- [故障排查](https://zanel1u.github.io/cloud-cli-proxy/zh/reference/faq) — 常见问题和灾难恢复

cmd/cloud-claude/main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import (
1111
"github.com/zanel1u/cloud-cli-proxy/internal/cloudclaude"
1212
)
1313

14+
var Version = "dev"
15+
1416
const (
1517
exitOK = 0
1618
exitAuthFailed = 1
@@ -25,6 +27,7 @@ func main() {
2527
Use: "cloud-claude",
2628
Short: "透明远程 Claude Code CLI",
2729
Long: "连接远端云主机并启动 Claude Code 交互会话。\n首次使用请先运行 cloud-claude init 配置网关与凭证。",
30+
Version: Version,
2831
SilenceUsage: true,
2932
SilenceErrors: true,
3033
DisableFlagParsing: true,
@@ -108,6 +111,10 @@ func runInit(cmd *cobra.Command, args []string) error {
108111
}
109112

110113
func runRoot(cmd *cobra.Command, args []string) error {
114+
if len(args) > 0 && (args[0] == "--version" || args[0] == "-v" || args[0] == "version") {
115+
fmt.Printf("cloud-claude %s\n", Version)
116+
return nil
117+
}
111118
if len(args) > 0 && args[0] == "--" {
112119
args = args[1:]
113120
}

scripts/install.sh

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
REPO="ZaneL1u/cloud-cli-proxy"
5+
BINARY="cloud-claude"
6+
INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}"
7+
8+
info() { printf '\033[1;34m==>\033[0m %s\n' "$*"; }
9+
warn() { printf '\033[1;33m警告:\033[0m %s\n' "$*"; }
10+
error() { printf '\033[1;31m错误:\033[0m %s\n' "$*" >&2; exit 1; }
11+
12+
detect_platform() {
13+
local os arch
14+
os="$(uname -s | tr '[:upper:]' '[:lower:]')"
15+
arch="$(uname -m)"
16+
17+
case "${os}" in
18+
linux) OS="linux" ;;
19+
darwin) OS="darwin" ;;
20+
*) error "不支持的操作系统: ${os}" ;;
21+
esac
22+
23+
case "${arch}" in
24+
x86_64|amd64) ARCH="amd64" ;;
25+
aarch64|arm64) ARCH="arm64" ;;
26+
*) error "不支持的架构: ${arch}" ;;
27+
esac
28+
}
29+
30+
get_latest_version() {
31+
local url="https://api.github.com/repos/${REPO}/releases/latest"
32+
VERSION="$(curl -fsSL "${url}" | grep '"tag_name"' | head -1 | sed 's/.*"tag_name": *"//;s/".*//')"
33+
if [ -z "${VERSION}" ]; then
34+
error "无法获取最新版本号,请检查网络连接"
35+
fi
36+
}
37+
38+
download_and_install() {
39+
local archive="${BINARY}-${OS}-${ARCH}.tar.gz"
40+
local url="https://github.com/${REPO}/releases/download/${VERSION}/${archive}"
41+
local tmpdir
42+
tmpdir="$(mktemp -d)"
43+
trap 'rm -rf "${tmpdir}"' EXIT
44+
45+
info "下载 ${BINARY} ${VERSION} (${OS}/${ARCH})..."
46+
curl -fsSL -o "${tmpdir}/${archive}" "${url}" \
47+
|| error "下载失败: ${url}\n请确认该版本存在: https://github.com/${REPO}/releases"
48+
49+
info "校验完整性..."
50+
local sha_url="${url}.sha256"
51+
if curl -fsSL -o "${tmpdir}/${archive}.sha256" "${sha_url}" 2>/dev/null; then
52+
(cd "${tmpdir}" && sha256sum -c "${archive}.sha256" --quiet 2>/dev/null) \
53+
|| (cd "${tmpdir}" && shasum -a 256 -c "${archive}.sha256" --quiet 2>/dev/null) \
54+
|| warn "sha256 校验失败,继续安装"
55+
fi
56+
57+
info "解压..."
58+
tar xzf "${tmpdir}/${archive}" -C "${tmpdir}"
59+
60+
local src="${tmpdir}/${BINARY}-${OS}-${ARCH}"
61+
chmod +x "${src}"
62+
63+
info "安装到 ${INSTALL_DIR}/${BINARY}..."
64+
if [ -w "${INSTALL_DIR}" ]; then
65+
mv "${src}" "${INSTALL_DIR}/${BINARY}"
66+
else
67+
sudo mv "${src}" "${INSTALL_DIR}/${BINARY}"
68+
fi
69+
}
70+
71+
verify_install() {
72+
if command -v "${BINARY}" &>/dev/null; then
73+
local installed_version
74+
installed_version="$("${BINARY}" --version 2>/dev/null || echo "unknown")"
75+
info "安装成功! ${installed_version}"
76+
else
77+
warn "${BINARY} 已安装到 ${INSTALL_DIR}/${BINARY},但不在 PATH 中"
78+
warn "请将 ${INSTALL_DIR} 加入 PATH,或运行: export PATH=\"${INSTALL_DIR}:\$PATH\""
79+
fi
80+
}
81+
82+
main() {
83+
info "Cloud CLI Proxy — cloud-claude 安装脚本"
84+
echo ""
85+
86+
detect_platform
87+
88+
if [ -n "${1:-}" ]; then
89+
VERSION="$1"
90+
else
91+
get_latest_version
92+
fi
93+
94+
download_and_install
95+
verify_install
96+
97+
echo ""
98+
info "快速开始:"
99+
echo " cloud-claude init # 配置网关地址与凭证"
100+
echo " alias claude=cloud-claude"
101+
echo " claude # 像本地一样使用 Claude Code"
102+
}
103+
104+
main "$@"

0 commit comments

Comments
 (0)