From 3d93a0a1e812ab026f56aab829c1299c3bdf18c5 Mon Sep 17 00:00:00 2001 From: Dillon DuPont Date: Fri, 14 Nov 2025 16:50:42 -0500 Subject: [PATCH 01/15] Simplify cli publish workflow to cross compile to all targets using the same platform --- .github/workflows/npm-publish-cli.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/npm-publish-cli.yml b/.github/workflows/npm-publish-cli.yml index 025da7a5..e74654f8 100644 --- a/.github/workflows/npm-publish-cli.yml +++ b/.github/workflows/npm-publish-cli.yml @@ -17,26 +17,21 @@ jobs: strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] include: - - os: ubuntu-latest - target: bun-linux-x64 + - target: bun-linux-x64 ext: '' binary_name: cua-linux-x64 - - os: macos-latest - target: bun-darwin-x64 + - target: bun-darwin-x64 ext: '' binary_name: cua-darwin-x64 - - os: macos-latest - target: bun-darwin-arm64 + - target: bun-darwin-arm64 ext: '' binary_name: cua-darwin-arm64 - - os: windows-latest - target: bun-windows-x64 + - target: bun-windows-x64 ext: '.exe' binary_name: cua-windows-x64.exe - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - name: Checkout code @@ -73,7 +68,7 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: cua-binary-${{ matrix.os }} + name: cua-binary-${{ matrix.target }} path: dist/ if-no-files-found: error retention-days: 1 From 84a8481e1e7cd10165b20a34c252d8fc6a29289f Mon Sep 17 00:00:00 2001 From: Dillon DuPont Date: Fri, 14 Nov 2025 16:53:28 -0500 Subject: [PATCH 02/15] Fix duplicate extensions in cli workflow --- .github/workflows/npm-publish-cli.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/npm-publish-cli.yml b/.github/workflows/npm-publish-cli.yml index e74654f8..9f21b435 100644 --- a/.github/workflows/npm-publish-cli.yml +++ b/.github/workflows/npm-publish-cli.yml @@ -29,7 +29,7 @@ jobs: binary_name: cua-darwin-arm64 - target: bun-windows-x64 ext: '.exe' - binary_name: cua-windows-x64.exe + binary_name: cua-windows-x64 runs-on: ubuntu-latest @@ -61,7 +61,7 @@ jobs: - name: Build binary working-directory: ./libs/typescript/cua-cli run: | - bun build --compile --minify --sourcemap --target=${{ matrix.target }} index.ts --outfile ${{ matrix.binary_name }} + bun build --compile --minify --sourcemap --target=${{ matrix.target }} index.ts --outfile ${{ matrix.binary_name }}${{ matrix.ext }} mkdir -p ../../../dist mv ${{ matrix.binary_name }}${{ matrix.ext }}* ../../../dist/ From ffbaee7d3a40ac7842a30861a0bd1abaf09b50e2 Mon Sep 17 00:00:00 2001 From: Dillon DuPont Date: Fri, 14 Nov 2025 16:58:40 -0500 Subject: [PATCH 03/15] Replace npm publish with bun publish in cli workflow --- .github/workflows/npm-publish-cli.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/npm-publish-cli.yml b/.github/workflows/npm-publish-cli.yml index 9f21b435..2c27b705 100644 --- a/.github/workflows/npm-publish-cli.yml +++ b/.github/workflows/npm-publish-cli.yml @@ -90,7 +90,7 @@ jobs: working-directory: ./libs/typescript/cua-cli run: | npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} - npm publish --access public + bun publish create-release: needs: [build-and-publish, publish-npm] From 3ec8016b63a71cf0b2d6e3691bf32d50baabef1e Mon Sep 17 00:00:00 2001 From: Dillon DuPont Date: Fri, 14 Nov 2025 17:02:30 -0500 Subject: [PATCH 04/15] Update bun publish step to install bun dependencies --- .github/workflows/npm-publish-cli.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/npm-publish-cli.yml b/.github/workflows/npm-publish-cli.yml index 2c27b705..b25cad05 100644 --- a/.github/workflows/npm-publish-cli.yml +++ b/.github/workflows/npm-publish-cli.yml @@ -86,11 +86,15 @@ jobs: with: bun-version: latest + - name: Install dependencies + working-directory: ./libs/typescript/cua-cli + run: bun install --frozen-lockfile + - name: Publish to npm working-directory: ./libs/typescript/cua-cli run: | npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} - bun publish + bun publish --tolerate-republish create-release: needs: [build-and-publish, publish-npm] From 087f2869d3877c08bd09f6369cc08c9fbd650c33 Mon Sep 17 00:00:00 2001 From: Dillon DuPont Date: Fri, 14 Nov 2025 17:06:51 -0500 Subject: [PATCH 05/15] Update cli workflow to use NPM_CONFIG_TOKEN env and production flags --- .github/workflows/npm-publish-cli.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/npm-publish-cli.yml b/.github/workflows/npm-publish-cli.yml index b25cad05..af4da91b 100644 --- a/.github/workflows/npm-publish-cli.yml +++ b/.github/workflows/npm-publish-cli.yml @@ -92,9 +92,9 @@ jobs: - name: Publish to npm working-directory: ./libs/typescript/cua-cli - run: | - npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} - bun publish --tolerate-republish + env: + NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }} + run: bun publish --production --access public --tolerate-republish create-release: needs: [build-and-publish, publish-npm] From 5f1983c78ac16d0c10808b5c1390d634df3b5c51 Mon Sep 17 00:00:00 2001 From: Dillon DuPont Date: Fri, 14 Nov 2025 17:09:15 -0500 Subject: [PATCH 06/15] Fix incorrect workflow image name --- .github/workflows/npm-publish-cli.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/npm-publish-cli.yml b/.github/workflows/npm-publish-cli.yml index af4da91b..291de936 100644 --- a/.github/workflows/npm-publish-cli.yml +++ b/.github/workflows/npm-publish-cli.yml @@ -123,7 +123,7 @@ jobs: - name: Create Release id: create_release - uses: actions/create-release@v2 + uses: actions/create-release@v1 with: tag_name: ${{ steps.version.outputs.tag }} release_name: CUA CLI ${{ steps.version.outputs.version }} From 3169ef38016a0b527a3de56dc1002c17c190ad1b Mon Sep 17 00:00:00 2001 From: Dillon DuPont Date: Fri, 14 Nov 2025 17:10:02 -0500 Subject: [PATCH 07/15] Fix incorrect upload-release-assets image name --- .github/workflows/npm-publish-cli.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/npm-publish-cli.yml b/.github/workflows/npm-publish-cli.yml index 291de936..4093130a 100644 --- a/.github/workflows/npm-publish-cli.yml +++ b/.github/workflows/npm-publish-cli.yml @@ -168,7 +168,7 @@ jobs: prerelease: false - name: Upload Release Assets - uses: actions/upload-release-asset@v2 + uses: actions/upload-release-asset@v1 with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./dist/${{ matrix.binary_name }} From 925ebbec4a0d90567376367001d1e6d6ab88f7d2 Mon Sep 17 00:00:00 2001 From: Dillon DuPont Date: Fri, 14 Nov 2025 17:12:59 -0500 Subject: [PATCH 08/15] Fix missing env in create-release action --- .github/workflows/npm-publish-cli.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/npm-publish-cli.yml b/.github/workflows/npm-publish-cli.yml index 4093130a..804b2bb8 100644 --- a/.github/workflows/npm-publish-cli.yml +++ b/.github/workflows/npm-publish-cli.yml @@ -124,6 +124,8 @@ jobs: - name: Create Release id: create_release uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ steps.version.outputs.tag }} release_name: CUA CLI ${{ steps.version.outputs.version }} From d1b12faff890ff410892bb670df0a7739f31aa53 Mon Sep 17 00:00:00 2001 From: Dillon DuPont Date: Fri, 14 Nov 2025 17:18:59 -0500 Subject: [PATCH 09/15] Elevate permissions for cli workflow --- .github/workflows/npm-publish-cli.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/npm-publish-cli.yml b/.github/workflows/npm-publish-cli.yml index 804b2bb8..8d52e642 100644 --- a/.github/workflows/npm-publish-cli.yml +++ b/.github/workflows/npm-publish-cli.yml @@ -99,6 +99,8 @@ jobs: create-release: needs: [build-and-publish, publish-npm] runs-on: ubuntu-latest + permissions: + contents: write steps: - name: Checkout code uses: actions/checkout@v4 From 5a203371a8fbb3a7b0050f039a8082b57bd722d3 Mon Sep 17 00:00:00 2001 From: Dillon DuPont Date: Fri, 14 Nov 2025 17:23:54 -0500 Subject: [PATCH 10/15] Fix CLI publish step to upload each binary --- .github/workflows/npm-publish-cli.yml | 40 +++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/.github/workflows/npm-publish-cli.yml b/.github/workflows/npm-publish-cli.yml index 8d52e642..108e689c 100644 --- a/.github/workflows/npm-publish-cli.yml +++ b/.github/workflows/npm-publish-cli.yml @@ -130,9 +130,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ steps.version.outputs.tag }} - release_name: CUA CLI ${{ steps.version.outputs.version }} + release_name: cua-cli v${{ steps.version.outputs.version }} body: | - # CUA CLI ${{ steps.version.outputs.version }} + # cua-cli v${{ steps.version.outputs.version }} ## Installation @@ -171,12 +171,42 @@ jobs: draft: false prerelease: false - - name: Upload Release Assets + - name: Upload Linux Binary uses: actions/upload-release-asset@v1 with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./dist/${{ matrix.binary_name }} - asset_name: ${{ matrix.binary_name }} + asset_path: ./dist/cua-linux-x64 + asset_name: cua-linux-x64 + asset_content_type: application/octet-stream + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload macOS Intel Binary + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./dist/cua-darwin-x64 + asset_name: cua-darwin-x64 + asset_content_type: application/octet-stream + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload macOS Apple Silicon Binary + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./dist/cua-darwin-arm64 + asset_name: cua-darwin-arm64 + asset_content_type: application/octet-stream + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Windows Binary + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./dist/cua-windows-x64.exe + asset_name: cua-windows-x64.exe asset_content_type: application/octet-stream env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 38caed06d10c650387423e56d3e6556a6823cb71 Mon Sep 17 00:00:00 2001 From: Dillon DuPont Date: Fri, 14 Nov 2025 17:26:52 -0500 Subject: [PATCH 11/15] Fix incorrect install script path in workflow --- .github/workflows/npm-publish-cli.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/npm-publish-cli.yml b/.github/workflows/npm-publish-cli.yml index 108e689c..5ab13168 100644 --- a/.github/workflows/npm-publish-cli.yml +++ b/.github/workflows/npm-publish-cli.yml @@ -139,10 +139,10 @@ jobs: ### Using install script (recommended) ```bash # For Linux/macOS - curl -fsSL https://cua.ai/install.sh | sh + curl -fsSL https://cua.ai/cli/install.sh | sh # For Windows (PowerShell) - irm https://cua.ai/install.ps1 | iex + irm https://cua.ai/cli/install.ps1 | iex ``` ### Using npm/bun From 34f96cc33412bfaf98c5057c073dbc6dd75684eb Mon Sep 17 00:00:00 2001 From: Dillon DuPont Date: Fri, 14 Nov 2025 17:30:10 -0500 Subject: [PATCH 12/15] Fix incorrect usage in cli install script --- scripts/install-cli.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install-cli.ps1 b/scripts/install-cli.ps1 index 29b630ec..7659983c 100644 --- a/scripts/install-cli.ps1 +++ b/scripts/install-cli.ps1 @@ -119,8 +119,8 @@ if (Test-Path $binaryPath) { Write-Host "Success: CUA CLI $version installed successfully to $binaryPath" -ForegroundColor Green Write-Host "" Write-Host "Get started with:" -ForegroundColor Cyan - Write-Host " cua auth login" - Write-Host " cua vm create --os linux --configuration small --region north-america" + Write-Host " cua login" + Write-Host " cua create --os linux --configuration small --region north-america" Write-Host "" Write-Host "For more help, visit: https://docs.cua.ai/libraries/cua-cli" -ForegroundColor Cyan From 7511049ff7730883e511457194270b88a5bc3e34 Mon Sep 17 00:00:00 2001 From: Dillon DuPont Date: Fri, 14 Nov 2025 17:43:49 -0500 Subject: [PATCH 13/15] Disable `cua chat` cli --- docs/content/docs/get-started/quickstart.mdx | 12 ++-- .../docs/libraries/cua-cli/commands.mdx | 19 +----- docs/content/docs/libraries/cua-cli/index.mdx | 3 - libs/typescript/cua-cli/src/commands/vm.ts | 66 +++++++++---------- 4 files changed, 41 insertions(+), 59 deletions(-) diff --git a/docs/content/docs/get-started/quickstart.mdx b/docs/content/docs/get-started/quickstart.mdx index 5b43d075..989d8b4b 100644 --- a/docs/content/docs/get-started/quickstart.mdx +++ b/docs/content/docs/get-started/quickstart.mdx @@ -431,15 +431,15 @@ Host: my-vm-abc123.containers.cloud.trycua.com You can now interact with your sandbox in multiple ways: -#### Option 1: Open the AI Playground (Recommended) + -#### Option 2: Access VNC Desktop +#### Option 1: Access VNC Desktop ```bash cua open my-vm-abc123 @@ -447,7 +447,7 @@ cua open my-vm-abc123 This opens a remote desktop connection to your sandbox. -#### Option 3: List and Manage Sandboxes +#### Option 2: List and Manage Sandboxes ```bash # List all your sandboxes @@ -463,7 +463,7 @@ cua delete my-vm-abc123 - + ### What's Next? diff --git a/docs/content/docs/libraries/cua-cli/commands.mdx b/docs/content/docs/libraries/cua-cli/commands.mdx index 5335f432..ec04f054 100644 --- a/docs/content/docs/libraries/cua-cli/commands.mdx +++ b/docs/content/docs/libraries/cua-cli/commands.mdx @@ -11,7 +11,7 @@ import { Callout } from 'fumadocs-ui/components/callout'; The CUA CLI provides commands for authentication and sandbox management: - **Authentication** - `cua login`, `cua env`, `cua logout` -- **Sandbox Management** - `cua list`, `cua create`, `cua start`, `cua stop`, `cua restart`, `cua delete`, `cua open`, `cua chat` +- **Sandbox Management** - `cua list`, `cua create`, `cua start`, `cua stop`, `cua restart`, `cua delete`, `cua open` ## Authentication Commands @@ -219,21 +219,6 @@ Opening NoVNC: https://my-dev-sandbox.containers.cloud.trycua.com/vnc.html?autoc This command automatically opens your default browser to the VNC interface with the correct password pre-filled. -### `cua chat` - -Open the CUA playground for a sandbox in your browser. - -```bash -cua chat -``` - -**Example:** -```bash -$ cua chat my-dev-sandbox -Opening Playground: https://cua.ai/dashboard/playground?host=... -``` - -This opens the full CUA playground interface where you can interact with your sandbox using AI agents. ## Global Options @@ -310,7 +295,7 @@ cua env ### 3. Quick Sandbox Access ```bash # Create aliases for frequently used sandboxes -alias dev-sandbox="cua chat my-development-sandbox" +alias dev-sandbox="cua open my-development-sandbox" alias prod-sandbox="cua open my-production-sandbox" ``` diff --git a/docs/content/docs/libraries/cua-cli/index.mdx b/docs/content/docs/libraries/cua-cli/index.mdx index 6f0f740a..b2e19a02 100644 --- a/docs/content/docs/libraries/cua-cli/index.mdx +++ b/docs/content/docs/libraries/cua-cli/index.mdx @@ -29,9 +29,6 @@ cua create --os linux --configuration small --region north-america # List your sandboxes cua list - -# Open the playground for your sandbox -cua chat my-sandbox-name ``` ## Use Cases diff --git a/libs/typescript/cua-cli/src/commands/vm.ts b/libs/typescript/cua-cli/src/commands/vm.ts index c54e14e9..39ecb546 100644 --- a/libs/typescript/cua-cli/src/commands/vm.ts +++ b/libs/typescript/cua-cli/src/commands/vm.ts @@ -281,37 +281,37 @@ export function registerVmCommands(y: Argv) { await openInBrowser(url); } ) - .command( - 'chat ', - 'Open CUA playground for a sandbox', - (y) => y.positional('name', { type: 'string', describe: 'Sandbox name' }), - async (argv: Record) => { - const token = await ensureApiKeyInteractive(); - const name = String((argv as any).name); - const listRes = await http('/v1/vms', { token }); - if (listRes.status === 401) { - clearApiKey(); - console.error("Unauthorized. Try 'cua login' again."); - process.exit(1); - } - if (!listRes.ok) { - console.error(`Request failed: ${listRes.status}`); - process.exit(1); - } - const vms = (await listRes.json()) as VmItem[]; - const vm = vms.find((v) => v.name === name); - if (!vm) { - console.error('Sandbox not found'); - process.exit(1); - } - const host = - vm.host && vm.host.length - ? vm.host - : `${vm.name}.containers.cloud.trycua.com`; - const base = WEBSITE_URL.replace(/\/$/, ''); - const url = `${base}/dashboard/playground?host=${encodeURIComponent(host)}&id=${encodeURIComponent(vm.name)}&name=${encodeURIComponent(vm.name)}&vnc_password=${encodeURIComponent(vm.password)}&fullscreen=true`; - console.log(`Opening Playground: ${url}`); - await openInBrowser(url); - } - ); + // .command( + // 'chat ', + // 'Open CUA playground for a sandbox', + // (y) => y.positional('name', { type: 'string', describe: 'Sandbox name' }), + // async (argv: Record) => { + // const token = await ensureApiKeyInteractive(); + // const name = String((argv as any).name); + // const listRes = await http('/v1/vms', { token }); + // if (listRes.status === 401) { + // clearApiKey(); + // console.error("Unauthorized. Try 'cua login' again."); + // process.exit(1); + // } + // if (!listRes.ok) { + // console.error(`Request failed: ${listRes.status}`); + // process.exit(1); + // } + // const vms = (await listRes.json()) as VmItem[]; + // const vm = vms.find((v) => v.name === name); + // if (!vm) { + // console.error('Sandbox not found'); + // process.exit(1); + // } + // const host = + // vm.host && vm.host.length + // ? vm.host + // : `${vm.name}.containers.cloud.trycua.com`; + // const base = WEBSITE_URL.replace(/\/$/, ''); + // const url = `${base}/dashboard/playground?host=${encodeURIComponent(host)}&id=${encodeURIComponent(vm.name)}&name=${encodeURIComponent(vm.name)}&vnc_password=${encodeURIComponent(vm.password)}&fullscreen=true`; + // console.log(`Opening Playground: ${url}`); + // await openInBrowser(url); + // } + // ); } From 40a0723c03471f6fc52aaa1a9d16515ccd90980c Mon Sep 17 00:00:00 2001 From: Dillon DuPont Date: Fri, 14 Nov 2025 17:44:58 -0500 Subject: [PATCH 14/15] Fix quickstart docs --- docs/content/docs/get-started/quickstart.mdx | 24 ++------------------ 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/docs/content/docs/get-started/quickstart.mdx b/docs/content/docs/get-started/quickstart.mdx index 5b43d075..6962b911 100644 --- a/docs/content/docs/get-started/quickstart.mdx +++ b/docs/content/docs/get-started/quickstart.mdx @@ -431,15 +431,9 @@ Host: my-vm-abc123.containers.cloud.trycua.com You can now interact with your sandbox in multiple ways: -#### Option 1: Open the AI Playground (Recommended) -```bash -cua chat my-vm-abc123 -``` -This opens the full CUA playground in your browser where you can chat with AI agents that control your sandbox. - -#### Option 2: Access VNC Desktop +#### Option 1: Access VNC Desktop ```bash cua open my-vm-abc123 @@ -447,7 +441,7 @@ cua open my-vm-abc123 This opens a remote desktop connection to your sandbox. -#### Option 3: List and Manage Sandboxes +#### Option 2: List and Manage Sandboxes ```bash # List all your sandboxes @@ -463,21 +457,7 @@ cua delete my-vm-abc123 - -### Try Some AI Tasks - -Once you have the playground open (`cua chat`), try asking the AI to: - -- "Take a screenshot and tell me what's on the screen" -- "Open Firefox and navigate to github.com" -- "Create a new text file and write 'Hello World' in it" -- "Install Python and run a simple script" -- "Take a screenshot of the desktop" - -The AI agent will automatically control your sandbox to complete these tasks! - - ### What's Next? From f08532059b09ad0bbe9292f2134a4d03190d384c Mon Sep 17 00:00:00 2001 From: ddupont <3820588+ddupont808@users.noreply.github.com> Date: Fri, 14 Nov 2025 17:50:14 -0500 Subject: [PATCH 15/15] Bump cua-cli to v0.1.2 --- libs/typescript/cua-cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/typescript/cua-cli/package.json b/libs/typescript/cua-cli/package.json index 3e399be5..641af50b 100644 --- a/libs/typescript/cua-cli/package.json +++ b/libs/typescript/cua-cli/package.json @@ -1,6 +1,6 @@ { "name": "@trycua/cli", - "version": "0.1.1", + "version": "0.1.2", "packageManager": "bun@1.1.38", "description": "Command-line interface for CUA cloud VMs and authentication", "type": "module",