Skip to content

Commit 3e2a7a5

Browse files
committed
docs: Homebrew 安装与 cloud-claude 建机后连接说明
- README 中英文补充 brew tap/install、网关与 Short ID 说明 - 快速开始文档区分 curl SSH 与 cloud-claude,并更新 sshfs 同名路径、 env check、proxy_commands 说明 Made-with: Cursor
1 parent 867c7de commit 3e2a7a5

4 files changed

Lines changed: 175 additions & 113 deletions

File tree

README.en.md

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Out-of-the-box isolated cloud hosts for Claude Code and dev teams. Pre-installed
2424
## Features
2525

2626
- **One-command access**`curl | bash` to authenticate, create container, and SSH in. Zero user config
27-
- **cloud-claude local CLI**`alias claude=cloud-claude` to transparently run remote Claude Code from your local terminal with real-time directory mapping
27+
- **cloud-claude local CLI**`alias claude=cloud-claude` to run remote Claude Code from your terminal; local cwd is sshfs-mounted at the **same path** in the container; optional local exec for commands like `git`
2828
- **Claude Code ready** — Pre-installed in every container. All API requests auto-routed through designated exit IP
2929
- **Full-tunnel egress** — sing-box tun + Linux netns full-tunnel, nftables default-deny, no DNS/WebRTC leaks
3030
- **Multi-protocol** — 6 proxy protocols (SOCKS5 / VMess / VLESS / Shadowsocks / Trojan / HTTP)
@@ -89,7 +89,7 @@ Log into the admin dashboard, then:
8989
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
92-
4. **Share access command** — Copy the `curl` command from host detail page
92+
4. **Share access info** — Copy the `curl` command from host details; for `cloud-claude` users also share: **gateway HTTPS URL**, **host Short ID**, and **user password**
9393

9494
### User Access
9595

@@ -100,61 +100,77 @@ curl -sSf http://YOUR_HOST/entry/abc123 | bash
100100
# Enter password → wait for boot → auto SSH into cloud host
101101
```
102102

103-
### cloud-claude (Local CLI, Transparent Remote)
103+
### cloud-claude (local CLI, recommended)
104104

105-
Besides SSH access, you can use the `cloud-claude` binary on your local machine to transparently run remote Claude Code with your current directory auto-mapped into the container.
105+
After the admin **creates the host, binds an egress IP**, and the container is ready, give the user three things:
106106

107-
**Install:**
107+
| Field | Meaning |
108+
|-------|---------|
109+
| **Gateway URL** | Public HTTPS base URL of the control plane, e.g. `https://gw.example.com` (same origin you use for the admin UI in the browser; usually **not** the `:3000` admin dev port) |
110+
| **Short ID** | **Host** short ID from the host detail page. If the user configures a **user** short ID instead, they connect to that user’s primary host |
111+
| **Password** | The user’s password from the admin dashboard |
112+
113+
Install the CLI once, run `init`, then from **any project directory** run `cloud-claude` — the cwd is mounted at the **same path** in the container. By default `git` runs locally (tune with `proxy_commands` in `~/.cloud-claude/config.yaml`).
114+
115+
#### Install cloud-claude
116+
117+
**Homebrew (macOS / Linux, recommended):**
118+
119+
```bash
120+
brew tap ZaneL1u/tap
121+
brew install cloud-claude
122+
```
123+
124+
**One-liner (any platform):**
108125

109126
```bash
110127
curl -fsSL https://raw.githubusercontent.com/ZaneL1u/cloud-cli-proxy/main/scripts/install.sh | bash
111128
```
112129

113-
Or download manually from [Releases](https://github.com/ZaneL1u/cloud-cli-proxy/releases), or build from source:
130+
Or download the matching `tar.gz` from [Releases](https://github.com/ZaneL1u/cloud-cli-proxy/releases), or build from source:
114131

115132
```bash
116-
go build -o cloud-claude ./cmd/cloud-claude
133+
go build -ldflags "-s -w" -trimpath -o cloud-claude ./cmd/cloud-claude
117134
```
118135

119-
**Initialize config:**
136+
#### First-time setup
120137

121138
```bash
122139
cloud-claude init
123-
# Interactive prompts:
124-
# Gateway URL (e.g. https://gw.example.com)
125-
# Short ID (host short ID from admin)
126-
# Password
127-
# Saved to ~/.cloud-claude/config.yaml
140+
# Prompts: gateway, Short ID, password → ~/.cloud-claude/config.yaml
128141
```
129142

130-
You can also pass values via flags or environment variables:
143+
Flags or environment variables:
131144

132145
```bash
133-
# Flags
134146
cloud-claude init --gateway https://gw.example.com --short-id abc123 --password your-password
135147

136-
# Environment variables
137148
export CLOUD_CLAUDE_GATEWAY=https://gw.example.com
138149
export CLOUD_CLAUDE_SHORT_ID=abc123
139150
export CLOUD_CLAUDE_PASSWORD=your-password
140151
cloud-claude init
141152
```
142153

143-
**Usage:**
154+
#### Daily use
144155

145156
```bash
146-
# Set alias so `claude` transparently uses the remote host
147-
alias claude=cloud-claude
157+
cd ~/your/project # repo root you want Claude Code to see
148158

149-
# Use exactly like local claude
150-
claude
159+
alias claude=cloud-claude # optional
160+
161+
cloud-claude
162+
cloud-claude -p "refactor this function"
163+
```
151164

152-
# All claude arguments are passed through
153-
claude -p "refactor this function"
154-
claude --model sonnet
165+
**Optional:** verify remote timezone, locale, egress IP, FUSE, etc.:
166+
167+
```bash
168+
cloud-claude env check
155169
```
156170

157-
`cloud-claude` automatically: authenticates → waits for container ready → maps your current directory to `/workspace` via sshfs → launches Claude Code remotely. Terminal resizing, signals, and exit codes are all properly forwarded.
171+
**Optional:** set `proxy_commands` in `~/.cloud-claude/config.yaml` (list of command names to run on the host). Default is `git` only; use an empty list to disable.
172+
173+
`cloud-claude` does: gateway auth → wait for container → sshfs mount at the same path → start Claude Code remotely. Terminal size, signals, and exit codes are forwarded.
158174

159175
### Claude Code (via SSH)
160176

@@ -178,7 +194,7 @@ Containers include KasmVNC + Chromium. Access the browser desktop via admin or u
178194
┌───────────────────────────────────┐
179195
User ──curl──> Control Plane (:8080) ──Docker──> │ User Container │
180196
│ │ SSH + Claude Code + VNC │
181-
PostgreSQL │ sshfs ← /workspace dir mapping
197+
PostgreSQL │ sshfs ← same path as local cwd
182198
│ │ sing-box tun Tunnel │
183199
Admin SPA (:3000) │ ↓ │
184200
│ │ Designated Exit IP │
@@ -193,7 +209,7 @@ User ──cloud-claude──> auth + SSH + sshfs ──────────
193209
| **Control Plane** | Go API — auth, user management, task orchestration, SSH proxy |
194210
| **Host Agent** | Privileged agent — Docker containers, network namespaces, tunnels |
195211
| **User Container** | Ubuntu 24.04 — OpenSSH + Claude Code + sshfs + KasmVNC + Chromium |
196-
| **cloud-claude** | Go CLI — transparent local replacement for `claude`, maps local dir via sshfs |
212+
| **cloud-claude** | Go CLI — transparent `claude`; sshfs same-path mount; optional local command proxy |
197213
| **PostgreSQL** | Persists users, hosts, egress IPs, tasks, and events |
198214
| **Admin SPA** | React 19 + TypeScript + Vite + Tailwind CSS |
199215

README.md

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
## 功能特性
2525

2626
- **一条命令接入**`curl | bash` 自动认证、创建容器、SSH 接入,用户无需任何配置
27-
- **cloud-claude 本地 CLI**`alias claude=cloud-claude`,在本地终端透明运行远端 Claude Code,当前目录实时映射
27+
- **cloud-claude 本地 CLI**`alias claude=cloud-claude`,在本地终端透明运行远端 Claude Code;当前目录经 sshfs 映射到容器内**同名路径**(与本地路径一致),可选将 `git` 等命令代理到本机执行
2828
- **Claude Code 开箱即用** — 容器预装 Claude Code,进入即可使用,所有 API 请求自动走指定出口
2929
- **全流量强制出口** — sing-box tun + Linux netns 全隧道,nftables 默认拒绝策略,杜绝 DNS / WebRTC 泄漏
3030
- **多协议支持** — 出口 IP 支持 6 种代理协议(SOCKS5 / VMess / VLESS / Shadowsocks / Trojan / HTTP)
@@ -123,7 +123,7 @@ docker compose -f docker-compose.yml -f docker-compose.build.yaml up -d --force-
123123
1. **添加出口 IP** — 支持多种代理协议,可一键测试连通性
124124
2. **创建用户** — 设置用户名、密码、到期时间
125125
3. **创建主机** — 为用户创建容器并绑定出口 IP
126-
4. **分发接入命令** — 在主机详情页复制 `curl` 命令发给用户
126+
4. **分发接入信息** — 在主机详情页复制 `curl` 命令;若用户使用 `cloud-claude`,另发:**网关 HTTPS 地址****主机 Short ID****用户密码**
127127

128128
### 用户接入
129129

@@ -134,61 +134,77 @@ curl -sSf http://YOUR_HOST/entry/abc123 | bash
134134
# 输入密码 → 等待启动 → 自动 SSH 进入云主机
135135
```
136136

137-
### cloud-claude(本地 CLI 透明替代
137+
### cloud-claude(本地 CLI,推荐
138138

139-
除了 SSH 接入方式外,还可以在本地使用 `cloud-claude` 命令直接透明运行远端 Claude Code,当前目录自动映射到容器内。
139+
管理员在后台**创建主机并绑定出口 IP**、容器就绪后,把下面三样信息发给用户即可连接:
140140

141-
**安装:**
141+
| 信息 | 说明 |
142+
|------|------|
143+
| **网关地址** | 对外访问控制面的 HTTPS 地址,例如 `https://gw.example.com`(与浏览器打开管理后台同源,一般不含 `:3000` 管理前端端口) |
144+
| **Short ID** | 主机详情页上的**主机短 ID**;若配置里填的是**用户短 ID**,则连到该用户的主主机 |
145+
| **密码** | 该用户在后台的登录密码 |
146+
147+
用户在本机安装 CLI、初始化一次后,在**任意项目目录**执行 `cloud-claude` 即可进入远端 Claude Code;当前目录会映射到容器内**相同路径**,便于与本地工具链配合(默认将 `git` 代理到本机,可在 `~/.cloud-claude/config.yaml``proxy_commands` 调整)。
148+
149+
#### 安装 cloud-claude
150+
151+
**Homebrew(macOS / Linux,推荐):**
152+
153+
```bash
154+
brew tap ZaneL1u/tap
155+
brew install cloud-claude
156+
```
157+
158+
**一行脚本(任意平台):**
142159

143160
```bash
144161
curl -fsSL https://raw.githubusercontent.com/ZaneL1u/cloud-cli-proxy/main/scripts/install.sh | bash
145162
```
146163

147-
也可以从 [Releases](https://github.com/ZaneL1u/cloud-cli-proxy/releases) 手动下载,或从源码构建:
164+
也可以从 [Releases](https://github.com/ZaneL1u/cloud-cli-proxy/releases) 手动下载对应平台的 `tar.gz`,或从源码构建:
148165

149166
```bash
150-
go build -o cloud-claude ./cmd/cloud-claude
167+
go build -ldflags "-s -w" -trimpath -o cloud-claude ./cmd/cloud-claude
151168
```
152169

153-
**初始化配置:**
170+
#### 初始化(只需一次)
154171

155172
```bash
156173
cloud-claude init
157-
# 交互式输入:
158-
# 网关地址 (如 https://gw.example.com)
159-
# Short ID(管理员分配的主机短 ID)
160-
# 密码
161-
# 配置保存到 ~/.cloud-claude/config.yaml
174+
# 交互式输入:网关地址、Short ID、密码 → 写入 ~/.cloud-claude/config.yaml
162175
```
163176

164-
也可以通过 flag 或环境变量传入
177+
或使用 flag / 环境变量
165178

166179
```bash
167-
# flag 方式
168180
cloud-claude init --gateway https://gw.example.com --short-id abc123 --password your-password
169181

170-
# 环境变量方式
171182
export CLOUD_CLAUDE_GATEWAY=https://gw.example.com
172183
export CLOUD_CLAUDE_SHORT_ID=abc123
173184
export CLOUD_CLAUDE_PASSWORD=your-password
174185
cloud-claude init
175186
```
176187

177-
**使用:**
188+
#### 日常使用
178189

179190
```bash
180-
# 设置 alias,之后 claude 命令自动走远端
181-
alias claude=cloud-claude
191+
cd ~/你的项目目录 # 希望 Claude Code 打开的工程根目录
182192

183-
# 直接使用,体验与本地 claude 一致
184-
claude
193+
alias claude=cloud-claude # 可选:与本地 claude 命令习惯一致
185194

186-
# 所有 claude 参数原样透传
187-
claude -p "帮我重构这个函数"
188-
claude --model sonnet
195+
cloud-claude # 或 claude
196+
cloud-claude -p "帮我重构这个函数"
189197
```
190198

191-
`cloud-claude` 会自动完成:认证 → 等待容器就绪 → 将当前目录映射到容器 `/workspace` → 在远端启动 Claude Code。终端窗口大小、信号、退出码都会正确透传。
199+
**可选:** 检查远端容器时区、语言、出口 IP、FUSE 等:
200+
201+
```bash
202+
cloud-claude env check
203+
```
204+
205+
**可选:**`~/.cloud-claude/config.yaml` 中配置 `proxy_commands`(命令名列表),指定在**本机**执行的命令;默认仅 `git`;设为空数组可关闭代理。
206+
207+
`cloud-claude` 会自动完成:向网关认证 → 等待容器就绪 → sshfs 将当前目录挂到容器内同名路径 → 在远端启动 Claude Code。终端大小、信号、退出码会透传。
192208

193209
### Claude Code(SSH 方式)
194210

@@ -212,7 +228,7 @@ claude
212228
┌───────────────────────────────────┐
213229
用户 ──curl──> Control Plane (:8080) ──Docker──> │ 用户容器 │
214230
│ │ SSH + Claude Code + VNC │
215-
PostgreSQL │ sshfs ← /workspace 目录映射
231+
PostgreSQL │ sshfs ← 本地 CWD 同名路径映射
216232
│ │ sing-box tun 隧道 │
217233
Admin SPA (:3000) │ ↓ │
218234
│ │ 指定出口 IP │
@@ -227,7 +243,7 @@ claude
227243
| **Control Plane** | Go API,认证、用户管理、任务编排、SSH 代理 |
228244
| **Host Agent** | 特权代理,管理 Docker 容器、网络命名空间和隧道 |
229245
| **用户容器** | Ubuntu 24.04,预装 OpenSSH + Claude Code + sshfs + KasmVNC + Chromium |
230-
| **cloud-claude** | Go CLI,透明替代本地 claude 命令,本地目录通过 sshfs 映射到容器 |
246+
| **cloud-claude** | Go CLI,透明替代本地 claude;本地目录经 sshfs 映射到容器内同名路径,可选命令本机代理 |
231247
| **PostgreSQL** | 持久化用户、主机、出口 IP、任务和事件 |
232248
| **Admin SPA** | React 19 + TypeScript + Vite + Tailwind CSS |
233249

0 commit comments

Comments
 (0)