From 4a569725dae320a505753359d8edfd8ca79f0fd7 Mon Sep 17 00:00:00 2001 From: simosmik Date: Tue, 14 Apr 2026 17:37:20 +0000 Subject: [PATCH] fix: add latest tag to docker npx command and change the detach mode to work without spawn --- README.de.md | 2 +- README.ja.md | 2 +- README.ko.md | 2 +- README.md | 4 ++-- README.ru.md | 2 +- README.zh-CN.md | 2 +- docker/README.md | 30 ++++++++++++++++++++++-------- server/cli.js | 22 ++++++++++------------ 8 files changed, 39 insertions(+), 27 deletions(-) diff --git a/README.de.md b/README.de.md index 4e354020..461f59a8 100644 --- a/README.de.md +++ b/README.de.md @@ -100,7 +100,7 @@ Die **[Dokumentation →](https://cloudcli.ai/docs)** enthält weitere Konfigura Agents in isolierten Sandboxes mit Hypervisor-Isolation ausführen. Standardmäßig wird Claude Code gestartet. Erfordert die [`sbx` CLI](https://docs.docker.com/ai/sandboxes/get-started/). ``` -npx @cloudcli-ai/cloudcli sandbox ~/my-project +npx @cloudcli-ai/cloudcli@latest sandbox ~/my-project ``` Unterstützt Claude Code, Codex und Gemini CLI. Weitere Details in der [Sandbox-Dokumentation](docker/). diff --git a/README.ja.md b/README.ja.md index dfca8cda..a3c7d04b 100644 --- a/README.ja.md +++ b/README.ja.md @@ -96,7 +96,7 @@ cloudcli ハイパーバイザーレベルの分離でエージェントをサンドボックスで実行します。デフォルトでは Claude Code が起動します。[`sbx` CLI](https://docs.docker.com/ai/sandboxes/get-started/) が必要です。 ``` -npx @cloudcli-ai/cloudcli sandbox ~/my-project +npx @cloudcli-ai/cloudcli@latest sandbox ~/my-project ``` Claude Code、Codex、Gemini CLI に対応。詳細は[サンドボックスのドキュメント](docker/)をご覧ください。 diff --git a/README.ko.md b/README.ko.md index 6cee2adf..f0c17471 100644 --- a/README.ko.md +++ b/README.ko.md @@ -96,7 +96,7 @@ cloudcli 하이퍼바이저 수준 격리로 에이전트를 샌드박스에서 실행합니다. 기본 에이전트는 Claude Code입니다. [`sbx` CLI](https://docs.docker.com/ai/sandboxes/get-started/)가 필요합니다. ``` -npx @cloudcli-ai/cloudcli sandbox ~/my-project +npx @cloudcli-ai/cloudcli@latest sandbox ~/my-project ``` Claude Code, Codex, Gemini CLI를 지원합니다. 자세한 내용은 [샌드박스 문서](docker/)를 참고하세요. diff --git a/README.md b/README.md index 986505b3..b6f2cfb7 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ Visit the **[documentation →](https://cloudcli.ai/docs)** for full configurati Run agents in isolated sandboxes with hypervisor-level isolation. Starts Claude Code by default. Requires the [`sbx` CLI](https://docs.docker.com/ai/sandboxes/get-started/). ``` -npx @cloudcli-ai/cloudcli sandbox ~/my-project +npx @cloudcli-ai/cloudcli@latest sandbox ~/my-project ``` Supports Claude Code, Codex, and Gemini CLI. See the [sandbox docs](docker/) for setup and advanced options. @@ -116,7 +116,7 @@ CloudCLI UI is the open source UI layer that powers CloudCLI Cloud. You can self |---|---|---|---| | **Best for** | Local agent sessions on your own machine | Isolated agents with web/mobile IDE | Teams who want agents in the cloud | | **How you access it** | Browser via `[yourip]:port` | Browser via `localhost:port` | Browser, any IDE, REST API, n8n | -| **Setup** | `npx @cloudcli-ai/cloudcli` | `npx @cloudcli-ai/cloudcli sandbox ~/project` | No setup required | +| **Setup** | `npx @cloudcli-ai/cloudcli` | `npx @cloudcli-ai/cloudcli@latest sandbox ~/project` | No setup required | | **Isolation** | Runs on your host | Hypervisor-level sandbox (microVM) | Full cloud isolation | | **Machine needs to stay on** | Yes | Yes | No | | **Mobile access** | Any browser on your network | Any browser on your network | Any device, native app coming | diff --git a/README.ru.md b/README.ru.md index 55b936a8..a5907b38 100644 --- a/README.ru.md +++ b/README.ru.md @@ -100,7 +100,7 @@ cloudcli Запускайте агентов в изолированных песочницах с гипервизорной изоляцией. По умолчанию запускается Claude Code. Требуется [`sbx` CLI](https://docs.docker.com/ai/sandboxes/get-started/). ``` -npx @cloudcli-ai/cloudcli sandbox ~/my-project +npx @cloudcli-ai/cloudcli@latest sandbox ~/my-project ``` Поддерживаются Claude Code, Codex и Gemini CLI. Подробнее в [документации sandbox](docker/). diff --git a/README.zh-CN.md b/README.zh-CN.md index 3f18d3cd..daf9a1a9 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -96,7 +96,7 @@ cloudcli 在隔离的沙箱中运行代理,具有虚拟机管理程序级别的隔离。默认启动 Claude Code。需要 [`sbx` CLI](https://docs.docker.com/ai/sandboxes/get-started/)。 ``` -npx @cloudcli-ai/cloudcli sandbox ~/my-project +npx @cloudcli-ai/cloudcli@latest sandbox ~/my-project ``` 支持 Claude Code、Codex 和 Gemini CLI。详情请参阅 [沙箱文档](docker/)。 diff --git a/docker/README.md b/docker/README.md index c093eccb..134ebad0 100644 --- a/docker/README.md +++ b/docker/README.md @@ -29,7 +29,7 @@ sbx secret set -g anthropic ### 3. Launch Claude Code ```bash -npx @cloudcli-ai/cloudcli sandbox ~/my-project +npx @cloudcli-ai/cloudcli@latest sandbox ~/my-project ``` Open **http://localhost:3001**. Set a password on first visit. Start building. @@ -41,11 +41,11 @@ Store the matching API key and pass `--agent`: ```bash # OpenAI Codex sbx secret set -g openai -npx @cloudcli-ai/cloudcli sandbox ~/my-project --agent codex +npx @cloudcli-ai/cloudcli@latest sandbox ~/my-project --agent codex # Gemini CLI sbx secret set -g google -npx @cloudcli-ai/cloudcli sandbox ~/my-project --agent gemini +npx @cloudcli-ai/cloudcli@latest sandbox ~/my-project --agent gemini ``` ### Available templates @@ -61,11 +61,19 @@ These are used with `--template` when running `sbx` directly (see [Advanced usag ## Managing sandboxes ```bash -cloudcli sandbox ls # List all sandboxes -cloudcli sandbox stop my-project # Stop (preserves state) +sbx ls # List all sandboxes +sbx stop my-project # Stop (preserves state) +sbx start my-project # Restart a stopped sandbox +sbx rm my-project # Remove everything +sbx exec my-project bash # Open a shell inside the sandbox +``` + +If you install CloudCLI globally (`npm install -g @cloudcli-ai/cloudcli`), you can also use: + +```bash +cloudcli sandbox ls cloudcli sandbox start my-project # Restart and re-launch web UI cloudcli sandbox logs my-project # View server logs -cloudcli sandbox rm my-project # Remove everything ``` ## What you get @@ -84,14 +92,20 @@ Your project directory is mounted bidirectionally — edits propagate in real ti Set variables at creation time with `--env`: ```bash -npx @cloudcli-ai/cloudcli sandbox ~/my-project --env SERVER_PORT=8080 +npx @cloudcli-ai/cloudcli@latest sandbox ~/my-project --env SERVER_PORT=8080 ``` Or inside a running sandbox: ```bash sbx exec my-project bash -c 'echo "export SERVER_PORT=8080" >> /etc/sandbox-persistent.sh' -sbx exec my-project bash -c 'pkill -f "server/index.js"; . ~/.cloudcli-start.sh' +``` + +Restart CloudCLI for changes to take effect: + +```bash +sbx exec my-project bash -c 'pkill -f "server/index.js"' +sbx exec -d my-project cloudcli start --port 3001 ``` | Variable | Default | Description | diff --git a/server/cli.js b/server/cli.js index dad74268..1d847159 100755 --- a/server/cli.js +++ b/server/cli.js @@ -448,7 +448,7 @@ async function sandboxCommand(args) { } catch { /* might already be running */ } console.log(`${c.info('▶')} Launching CloudCLI web server...`); - sbx(['exec', '-d', opts.name, 'bash', '-c', '. ~/.cloudcli-start.sh']); + sbx(['exec', '-d', opts.name, 'cloudcli', 'start', '--port', '3001']); console.log(`${c.info('▶')} Forwarding port ${opts.port} → 3001...`); try { @@ -548,14 +548,11 @@ async function sandboxCommand(args) { } } - // Step 3: Start CloudCLI + // Step 3: Start CloudCLI as a long-running detached exec session. + // Using -d with a long-running command (cloudcli start never exits) + // keeps the exec session alive, which keeps the sandbox running. console.log(`${c.info('▶')} Launching CloudCLI web server...`); - try { - sbx(['exec', '-d', opts.name, 'bash', '-c', '. ~/.cloudcli-start.sh']); - } catch (e) { - console.error(`${c.error('❌')} Failed to start CloudCLI: ${e.message}`); - process.exit(1); - } + sbx(['exec', '-d', opts.name, 'cloudcli', 'start', '--port', '3001']); // Step 4: Forward port console.log(`${c.info('▶')} Forwarding port ${opts.port} → 3001...`); @@ -582,10 +579,11 @@ async function sandboxCommand(args) { console.log(`\n${c.ok('✔')} ${c.bright('CloudCLI is ready!')}`); console.log(` ${c.info('→')} Open ${c.bright(`http://localhost:${opts.port}`)}`); console.log(`\n${c.dim(' Manage with:')}`); - console.log(` ${c.dim('$')} cloudcli sandbox ls`); - console.log(` ${c.dim('$')} cloudcli sandbox stop ${opts.name}`); - console.log(` ${c.dim('$')} cloudcli sandbox start ${opts.name}`); - console.log(` ${c.dim('$')} cloudcli sandbox rm ${opts.name}\n`); + console.log(` ${c.dim('$')} sbx ls`); + console.log(` ${c.dim('$')} sbx stop ${opts.name}`); + console.log(` ${c.dim('$')} sbx start ${opts.name}`); + console.log(` ${c.dim('$')} sbx rm ${opts.name}`); + console.log(`\n${c.dim(' Or install globally:')} npm install -g @cloudcli-ai/cloudcli\n`); break; }