Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

installer: say what Cua Spaces is, drop the "Host this machine" row, quieter output (CUA-1862) (#5437)

Francesco Bonacci25250c21cabc
diff --git a/README.md b/README.md
index 87aa02dbd7..1cdbc8ffe9 100644
--- a/README.md
+++ b/README.md
@@ -148,7 +148,7 @@ curl -fsSL https://cua.ai/install.sh | sh
irm https://cua.ai/install.ps1 | iex
```
-In a terminal the script shows a short checklist: the `cua` CLI, the Cua Spaces app (default on macOS), the cua-driver MCP and skill for your agents, and hosting this machine. It then runs `cua auth login`, which signs you in and offers to install cua skills and the cua MCP server into your AI coding agents (Claude Code, Codex, Cursor, and others). Preselect items with `sh -s -- --select cua-driver`, or skip the checklist with `--only cua-driver`. See [the installer options](scripts/install/README.md).
+In a terminal the script first says what Cua Spaces is. The command-line tools (the `cua` program) are always installed; you choose whether to add the Cua Spaces app (on by default) and Cua Driver, which lets AI agents use your apps while you keep working (off by default). It then runs `cua auth login`, which signs you in and offers to set up your AI coding agents (Claude Code, Codex, Cursor, and others). The app asks on its first run whether your other devices may use this computer. Add Cua Driver with `sh -s -- --select cua-driver`, or skip the choice with `--only cua-driver`. See [the installer options](scripts/install/README.md).
```sh
cua sb create ubuntu --name dev # a gVisor container, set up on first use
diff --git a/scripts/install/README.md b/scripts/install/README.md
index ad036d8f56..5cbfdef3ba 100644
--- a/scripts/install/README.md
+++ b/scripts/install/README.md
@@ -14,14 +14,16 @@ The Cua Spaces app is the graphical path. Its first run installs the bundled `cu
## Choose what to install
-In a terminal, install.sh shows a checklist (arrow or number keys to move and toggle, space to toggle, Enter to install; install.ps1 asks for numbers to toggle). The CLI row is locked. Without a terminal, with `--yes`, or with `CUA_INSTALL_NONINTERACTIVE=1`, the defaults plus `--select` are installed without asking. `--only` installs exactly the listed items plus the CLI and never shows the checklist.
+In a terminal, install.sh first says what Cua Spaces is, then lists what to add to the command-line tools (the `cua` CLI; arrow or number keys to move or toggle, space to select, Enter to install; install.ps1 asks for numbers to toggle, with a line under each row). The command-line tools are always installed, so they are not a row. Letting your other devices use this computer (`cua host setup`) is not a row either: the app's first run asks (`--mode host|client` preselects the answer). Without a terminal, with `--yes`, or with `CUA_INSTALL_NONINTERACTIVE=1`, the defaults plus `--select` are installed without asking. `--only` installs exactly the listed items plus the CLI and never shows the list.
-| Item | What it does | Default |
-|---|---|---|
-| `cli` | The `cua` CLI | Always (not with `--app-only`) |
-| `spaces` | The Cua Spaces app | On for macOS (the SwiftUI app) and Linux (the Electron app). On Windows (the Electron app) it is off by default: pick it in the checklist or use `-Select spaces`. `--app-only` and `--mode` imply it |
-| `cua-driver` | Installs cua-driver with its own release installer (`cua.ai/driver/install.sh` / `install.ps1`, which verify SHA256SUMS and the Sigstore bundle), then `cua agents setup --cua-driver --agents all --yes` registers its skill and MCP server for your agents | Off |
-| `host` | Runs `cua host setup` after sign-in so others on your account can reach this machine | Off |
+| Item | What it does | In the list | Default |
+|---|---|---|---|
+| `cli` | The `cua` CLI | No, always installed (not with `--app-only`) | Always |
+| `spaces` | The Cua Spaces app | "Cua Spaces app: lets your AI agents use computers" | On for macOS (the SwiftUI app), Linux (the Electron app) and Windows (the Electron app). `--app-only` and `--mode` imply it |
+| `cua-driver` | Installs Cua Driver with its own release installer (`cua.ai/driver/install.sh` / `install.ps1`, which verify SHA256SUMS and the Sigstore bundle), then `cua agents setup --cua-driver --agents all --yes` registers its skill and MCP server for your agents | "Cua Driver: lets AI agents use your apps while you keep working" | Off |
+| `host` | Runs `cua host setup` after sign-in, so your other devices can use this computer through the relay | No: a script flag (`--select host`, `--only host`, `--pair`). Interactively, the app's first run asks | Off |
+
+The Cua Spaces app registers the cua-driver skill and MCP server with your agents in its first run, but it does not install or update the Cua Driver program yet (CUA-1440). Until it does, the `cua-driver` item is how the installer puts Cua Driver on this computer.
```sh
curl -fsSL https://cua.ai/install.sh | sh -s -- --select cua-driver # checklist with cua-driver ticked
@@ -34,7 +36,7 @@ For cua-driver, `--prefix DIR` becomes `--bin-dir DIR/bin`, `--require-signature
| install.sh | install.ps1 | Effect |
|---|---|---|
-| `--select a,b` | `-Select a,b` | Preselect items (`spaces`, `cua-driver`, `host`); the checklist still shows |
+| `--select a,b` | `-Select a,b` | Preselect items (`spaces`, `cua-driver`, `host`); the list still shows |
| `--only a,b` | `-Only a,b` | Exactly these items plus the CLI, no checklist |
| `--cli-only` | `-CliOnly` | Only the `cua` CLI (same as `--only cli`) |
| `--app-only` | `-AppOnly` | Only the Cua Spaces app, no CLI (cannot be combined with `cua-driver` or `host`) |
@@ -44,6 +46,7 @@ For cua-driver, `--prefix DIR` becomes `--bin-dir DIR/bin`, `--require-signature
| `--modify-path` | `-ModifyPath` | Add the bin dir to your shell profile or user PATH without asking |
| `--no-modify-path` | `-NoModifyPath` | Never edit the profile or user PATH; print the command instead |
| `--no-onboarding` | `-NoOnboarding` | Skip `cua auth login` |
+| `-v`, `--verbose` | `-Verbose` | Print every step: platform, manifest, each download, signature checks. Also `CUA_INSTALL_VERBOSE=1` |
| `--require-signature` | `-RequireSignature` | Fail unless minisign or cosign verifies |
| `--dry-run` | `-DryRun` | Print the plan, change nothing |
| `--yes` | `-Yes` | Accept the current selection and every prompt |
@@ -51,6 +54,14 @@ For cua-driver, `--prefix DIR` becomes `--bin-dir DIR/bin`, `--require-signature
Pass install.sh options through the pipe with `sh -s --`, for example `curl -fsSL https://cua.ai/install.sh | sh -s -- --cli-only --yes`. `--only` and `--select` cannot be combined, nor can `--cli-only` with other items. Set `CUA_INSTALL_NONINTERACTIVE=1` to never prompt.
+## What it prints
+
+One plain line per step ("Installing the command-line tools to ...", "Installing the Cua Spaces app to ..."), then what was installed and what to do next: open Cua Spaces, or sign in and run `cua agents setup` to connect your AI agents. `--verbose` adds `cua-install:` lines with the platform, the manifest, each download and the signature checks.
+
+Every download is checked against its sha256 from the release manifest, and the summary says "(downloads checked)". Signatures are checked as well when `minisign` or `cosign` is installed; without one, a note shows only with `--verbose`, and `--require-signature` turns it into an error.
+
+Questions read from the terminal, never from the script on stdin, so they work under `curl | sh`. With no terminal to ask on, the usual choices apply and the installer says so once. End of input (Ctrl-D, a closed terminal) is never an answer: the install questions take their default, and the PATH question leaves your profile alone.
+
## Where things go
| | CLI | App |
diff --git a/scripts/install/install.ps1 b/scripts/install/install.ps1
index c8654e9855..e31cad9916 100644
--- a/scripts/install/install.ps1
+++ b/scripts/install/install.ps1
@@ -8,12 +8,19 @@ Cua installer for Windows: the `cua` CLI, the Cua Spaces app and agent extras.
& ([scriptblock]::Create((irm https://cua.ai/install.ps1))) -CliOnly -Yes
& ([scriptblock]::Create((irm https://cua.ai/install.ps1))) -Pair K7QM-4XPB-2RHD
-At a console it first shows a numbered checklist of what to install. Items:
- cli the cua CLI (always installed, except with -AppOnly)
+At a console it first says what Cua Spaces is, then shows a numbered list of
+what to add to the command-line tools (the `cua` program: always installed,
+except with -AppOnly). Items:
spaces the Cua Spaces app (the Electron app's setup.exe; on by default)
- cua-driver cua-driver MCP and skill for your agents (off by default)
- host host this machine: `cua host setup` (off by default)
-Set CUA_INSTALL_NONINTERACTIVE=1 to never prompt.
+ cua-driver Cua Driver, which lets AI agents use apps while you keep
+ working: installs it and adds its skill and MCP server to
+ your agents (off by default)
+The list does not offer hosting. The app's first run asks how to use this
+computer (-Mode host|client preselects the answer). For scripts, `-Select host`
+and `-Only host` still run `cua host setup`, which lets your other devices use
+this computer through the relay.
+Set CUA_INSTALL_NONINTERACTIVE=1 to never prompt. Add -Verbose to see every
+step (manifest, downloads, signature checks).
Reads release-artifacts.json (see scripts/install/README.md), downloads the
artifacts for this machine, verifies their sha256 (and a minisign or cosign
@@ -26,7 +33,7 @@ setup.exe for this machine's architecture, run silently (/S) after the sha256
(and cosign, when available) check.
.PARAMETER Select
-Preselect items (comma list: spaces, cua-driver, host); the checklist still shows.
+Preselect items (comma list: spaces, cua-driver, host); the list still shows.
.PARAMETER Only
Install exactly these items plus the CLI, without the checklist.
.PARAMETER CliOnly
@@ -107,6 +114,11 @@ $script:Picked = $false
# (cd-cua-spaces.yml). Set this to $false to skip a selected `spaces` with a note.
$script:SpacesSupported = $true
$script:SigNoted = $false
+$script:DidCli = $null
+$script:DidApp = $false
+$script:DidDriver = $false
+$script:SignedIn = $false
+$script:PathHint = $null
function Get-Sha256Hex([string]$Path) {
# .NET directly: Get-FileHash is missing when the Utility module is not
@@ -117,7 +129,10 @@ function Get-Sha256Hex([string]$Path) {
finally { $stream.Dispose(); $sha.Dispose() }
}
-function Write-Info([string]$Message) { Write-Host "cua-install: $Message" }
+# Write-Step: one plain line per thing the installer does. Write-Info: detail
+# for -Verbose (manifest URLs, file names, signature checks).
+function Write-Step([string]$Message) { Write-Host $Message }
+function Write-Info([string]$Message) { Write-Verbose "cua-install: $Message" }
function Stop-Install([string]$Message) { throw "cua-install: error: $Message" }
function Get-CuaPlatform {
@@ -188,24 +203,38 @@ function Test-WantsChecklist {
$env:CUA_INSTALL_NONINTERACTIVE -ne '1' -and (Test-Interactive))
}
-# Numbered checklist: toggle numbers, Enter to install. The CLI row is locked.
-function Read-CuaSelection($Sel, [scriptblock]$Reader = { Read-Host 'Toggle numbers (e.g. 2 3), Enter to install' }) {
- $rows = @('cli')
+# Numbered list: what Cua Spaces is, what is always installed, then the
+# optional rows. Toggle numbers, Enter to install. `host` is not a row (the
+# app's first run asks how to use this computer; -Select host is for scripts).
+function Read-CuaSelection($Sel, [scriptblock]$Reader = { Read-Host 'Type a number to switch an item on or off. Press Enter to install' }) {
+ $rows = @()
if ($script:SpacesSupported) { $rows += 'spaces' }
- $rows += 'cua-driver', 'host'
- $labels = @{ cli = 'cua CLI (required)'; spaces = 'Cua Spaces app'; 'cua-driver' = 'cua-driver MCP and skill for your agents'; host = 'Host this machine' }
+ $rows += 'cua-driver'
+ $labels = @{ spaces = 'Cua Spaces app: lets your AI agents use computers'; 'cua-driver' = 'Cua Driver: lets AI agents use your apps while you keep working' }
+ $help = @{
+ spaces = 'Open the app to sign in, connect your AI agents and watch them work.'
+ 'cua-driver' = 'For advanced users. Adds it to Claude Code, Codex and other coding agents.'
+ }
+ Write-Host ''
+ Write-Host 'Cua Spaces lets your AI agents use computers, and lets you watch them work.'
+ Write-Host ''
+ Write-Host 'Needed, so always installed:'
+ Write-Host ' Command-line tools: the "cua" program that the app and your AI agents use.'
+ if ($Sel.host) { Write-Host 'Also: your other devices will be able to use this computer (you asked for this with -Select host).' }
+ Write-Host ''
+ Write-Host 'Choose what else to add:'
Write-Host ''
- Write-Host 'Choose what to install:'
while ($true) {
for ($i = 0; $i -lt $rows.Count; $i++) {
$box = if ($Sel[$rows[$i]]) { '[x]' } else { '[ ]' }
Write-Host " $($i + 1) $box $($labels[$rows[$i]])"
+ Write-Host " $($help[$rows[$i]])"
}
$line = & $Reader
if (-not $line) { break }
foreach ($tok in @($line -split '[,\s]+')) {
$n = 0
- if ([int]::TryParse($tok, [ref]$n) -and $n -ge 2 -and $n -le $rows.Count) {
+ if ([int]::TryParse($tok, [ref]$n) -and $n -ge 1 -and $n -le $rows.Count) {
$id = $rows[$n - 1]
$Sel[$id] = -not $Sel[$id]
}
@@ -310,10 +339,11 @@ function Test-Signature([string]$File, $Entry, [string]$ManifestUrl) {
Stop-Install "no verifiable signature for $(Split-Path -Leaf $File) (install minisign or cosign)"
}
if (-not $ok -and ($Entry.PSObject.Properties['minisig'] -or $Entry.PSObject.Properties['cosign_bundle'])) {
- # One quiet line per run: sha256 is checked either way.
+ # sha256 is checked either way; the closing summary says so. The
+ # detail is for -Verbose.
if (-not $script:SigNoted) {
$script:SigNoted = $true
- Write-Info 'checked sha256 (cosign is not installed, so release signatures were not checked; -RequireSignature makes that an error)'
+ Write-Info 'release signatures were not checked: neither minisign nor cosign is installed (-RequireSignature makes that an error)'
}
}
}
@@ -332,7 +362,7 @@ function Get-Artifact($Manifest, [string]$ManifestUrl, [string]$Component, [stri
Get-Remote $url $dest $ManifestUrl
$actual = Get-Sha256Hex $dest
if ($actual -ne $entry.sha256.ToLowerInvariant()) {
- Stop-Install "checksum mismatch for $($entry.name) (expected $($entry.sha256), got $actual); aborting"
+ Stop-Install "checksum mismatch for $($entry.name) (the download is damaged or was changed; expected $($entry.sha256), got $actual); nothing was installed"
}
Test-Signature $dest $entry $ManifestUrl
return $dest
@@ -352,14 +382,15 @@ function Add-UserPath([string]$Dir) {
if (@($env:Path -split ';') -notcontains $Dir) { $env:Path = "$env:Path;$Dir" }
if ($parts -contains $Dir) { return }
[Environment]::SetEnvironmentVariable('Path', (($parts + $Dir) -join ';'), 'User')
- Write-Info "added $Dir to your user PATH (new terminals pick it up)"
+ Write-Step "Added $Dir to your user PATH (open a new terminal window to use cua)"
}
function Install-Cli($Manifest, [string]$ManifestUrl, [string]$Platform, [string]$Tmp) {
$bin = Get-CliBinDir
$target = Join-Path $bin 'cua.exe'
# -CliOnly / -Only already said what to install.
- if (-not ($CliOnly -or $Only) -and -not (Confirm-Step "Install the cua CLI to ${target}?")) { Stop-Install 'cancelled; rerun with -Prefix DIR to choose another location' }
+ if (-not ($CliOnly -or $Only) -and -not (Confirm-Step "Install the command-line tools to ${target}?")) { Stop-Install 'cancelled; rerun with -Prefix DIR to choose another location' }
+ Write-Step "Installing the command-line tools to $target"
$zip = Get-Artifact $Manifest $ManifestUrl 'cli' $Platform 'zip' $Tmp
if ($DryRun) {
Write-Host "[dry-run] install cua.exe -> $target"
@@ -370,15 +401,18 @@ function Install-Cli($Manifest, [string]$ManifestUrl, [string]$Platform, [string
if (-not $exe) { Stop-Install "no cua.exe inside $(Split-Path -Leaf $zip)" }
New-Item -ItemType Directory -Force -Path $bin | Out-Null
Copy-Item -LiteralPath $exe.FullName -Destination $target -Force
- Write-Info "installed $target"
+ $script:DidCli = $target
}
$onPath = @($env:Path -split ';') -contains $bin
if (-not $onPath) {
if (-not $NoModifyPath) { Add-UserPath $bin }
else {
- Write-Host ""
- Write-Host "$bin is not on your PATH. Add it with:"
- Write-Host " [Environment]::SetEnvironmentVariable('Path', `"`$([Environment]::GetEnvironmentVariable('Path','User'));$bin`", 'User')"
+ # Said at the end, after what was installed.
+ $script:PathHint = @(
+ "$bin is not on your PATH, the list of places your terminal looks for programs.",
+ "To use cua, run this, then open a new terminal window:",
+ " [Environment]::SetEnvironmentVariable('Path', `"`$([Environment]::GetEnvironmentVariable('Path','User'));$bin`", 'User')"
+ )
}
}
return $target
@@ -396,7 +430,9 @@ function Get-AppInstallCommand([string]$File, [string]$Kind, [string]$InstallMod
}
function Install-App($Manifest, [string]$ManifestUrl, [string]$Platform, [string]$Tmp) {
- if (-not (Confirm-Step 'Install the Cua Spaces app?')) { Write-Info 'skipping the Cua Spaces app'; return }
+ if (-not (Confirm-Step 'Install the Cua Spaces app?')) { Write-Step 'Skipping the Cua Spaces app'; return }
+ Write-Step 'Installing the Cua Spaces app'
+
$kind = $Installer
if (-not (Find-Artifact $Manifest 'app' $Platform $kind)) {
$kind = if ($kind -eq 'msi') { 'nsis' } else { 'msi' }
@@ -410,7 +446,7 @@ function Install-App($Manifest, [string]$ManifestUrl, [string]$Platform, [string
Write-Info "installing Cua Spaces ($kind, silent)"
$proc = Start-Process -FilePath $cmd.FilePath -ArgumentList $cmd.ArgumentList -Wait -PassThru
if ($proc.ExitCode -ne 0 -and $proc.ExitCode -ne 3010) { Stop-Install "Cua Spaces installer exited with $($proc.ExitCode)" }
- Write-Info 'installed Cua Spaces'
+ $script:DidApp = $true
}
function Get-DriverBinDir {
@@ -447,7 +483,7 @@ function Install-CuaDriver([string]$Cua, [string]$Tmp, [string]$ManifestUrl) {
Write-Host "[dry-run] download $url"
Write-Host "[dry-run] $exe -NoProfile -ExecutionPolicy Bypass -File cua-driver-install.ps1 $($driverArgs -join ' ')"
} else {
- Write-Info 'installing cua-driver'
+ Write-Step 'Installing Cua Driver and adding it to your AI agents'
Get-Remote $url $script $ManifestUrl
$saved = $env:CUA_DRIVER_RS_INSTALL_DIR
if ($Prefix) { $env:CUA_DRIVER_RS_INSTALL_DIR = $binDir }
@@ -461,6 +497,7 @@ function Install-CuaDriver([string]$Cua, [string]$Tmp, [string]$ManifestUrl) {
if ($DryRun) { Write-Host "[dry-run] $Cua $($setup -join ' ')"; return }
& $Cua @setup
if ($LASTEXITCODE -ne 0) { Write-Warning 'agent setup for cua-driver did not finish; rerun: cua agents setup --cua-driver' }
+ $script:DidDriver = $true
}
# Checks -Pair / -Relay: they end up on a command line.
@@ -485,7 +522,7 @@ function Invoke-HostPair([string]$Cua) {
$have = (& $Cua --version 2>&1 | Out-String).Trim()
Stop-Install "the installed cua CLI ($have) cannot add a machine with a code (no 'cua host setup --pair'); install a newer release (-Version) or sign in instead: cua auth login; cua host setup"
}
- Write-Info 'adding this machine to your account (cua host setup --pair)'
+ Write-Step 'Adding this computer to your account (cua host setup --pair)'
$null | & $Cua @pairArgs
if ($LASTEXITCODE -ne 0) { Stop-Install 'adding this machine did not finish; if the code expired or was used, make a new one in Cua Spaces (Add a machine) and run: cua host setup --pair <code>' }
Write-Host ''
@@ -496,7 +533,7 @@ function Invoke-HostPair([string]$Cua) {
function Invoke-HostSetup([string]$Cua) {
if ($Pair) { Invoke-HostPair $Cua; return }
if ($DryRun) { Write-Host "[dry-run] $Cua host setup"; return }
- Write-Info 'setting up this machine as a host (cua host setup)'
+ Write-Step 'Letting your other devices use this computer (cua host setup)'
if (Test-Interactive) { & $Cua host setup } else { $null | & $Cua host setup }
if ($LASTEXITCODE -ne 0) { Write-Warning "host setup did not finish; run 'cua host setup' after 'cua auth login'" }
}
@@ -518,6 +555,42 @@ function Find-ExistingCua {
return $null
}
+# "a, b and c" from a list of phrases.
+function Join-And([string[]]$Items) {
+ if ($Items.Count -le 1) { return ($Items -join '') }
+ if ($Items.Count -eq 2) { return "$($Items[0]) and $($Items[1])" }
+ return (($Items[0..($Items.Count - 2)] -join ', ') + " and $($Items[-1])")
+}
+
+# The closing lines: what was installed, then what to do next, in plain words.
+function Write-CuaSummary($Sel) {
+ if ($DryRun -or $Pair) { return }
+ $did = @()
+ if ($script:DidCli) { $did += 'the command-line tools' }
+ if ($script:DidApp) { $did += 'the Cua Spaces app' }
+ if ($script:DidDriver) { $did += 'Cua Driver' }
+ Write-Host ''
+ if ($did.Count -gt 0) {
+ $checked = if ($script:DidCli -or $script:DidApp) { ' (downloads checked)' } else { '' }
+ Write-Host "Installed $(Join-And $did)$checked."
+ }
+ if ($script:DidApp) {
+ if ($script:SignedIn) { Write-Host 'Next: open Cua Spaces from the Start menu. There you can also let your other devices use this computer.' }
+ else { Write-Host 'Next: open Cua Spaces from the Start menu. It guides you through signing in and connecting your AI agents. You can also let your other devices use this computer.' }
+ if ($Sel.cli) {
+ if ($script:SignedIn) { Write-Host 'To connect more AI agents later, run "cua agents setup" in a terminal.' }
+ else { Write-Host 'Prefer a terminal? Run "cua auth login" to sign in, then "cua agents setup" to connect your AI agents.' }
+ }
+ } elseif ($Sel.cli) {
+ if ($script:SignedIn) { Write-Host 'Next: run "cua agents setup" to connect your AI agents.' }
+ else {
+ Write-Host 'Next: run "cua auth login" to sign in, then "cua agents setup" to connect your AI agents.'
+ Write-Host '(No web browser on this computer? Run "cua auth login --remote" instead.)'
+ }
+ if (-not $Sel.host) { Write-Host 'To let your other devices use this computer, run "cua host setup".' }
+ }
+}
+
function Invoke-CuaInstall {
# Function scope: `irm | iex` runs in the caller's session, so keep these local.
Set-StrictMode -Version 3
@@ -526,20 +599,20 @@ function Invoke-CuaInstall {
Test-PairArgs
$sel = Get-CuaSelection
if ($sel.spaces -and -not $script:SpacesSupported) {
- Write-Info 'Cua Spaces is not available on this platform; skipping the app'
+ Write-Step 'Cua Spaces is not available on this platform; skipping the app'
$sel.spaces = $false
}
if ($Version -and $Version.TrimStart('v') -notmatch '^\d+\.\d+\.\d+') { Stop-Install "-Version must look like 1.2.3, not '$Version'" }
$platform = Get-CuaPlatform
if (Test-WantsChecklist) { $sel = Read-CuaSelection $sel }
- if ($DryRun) { Write-Info 'dry run: nothing will be changed' }
+ if ($DryRun) { Write-Step 'Dry run: nothing will be changed' }
$tmp = Join-Path ([IO.Path]::GetTempPath()) ("cua-install-" + [Guid]::NewGuid().ToString('N'))
New-Item -ItemType Directory -Force -Path $tmp | Out-Null
try {
$cua = $null
$existing = Find-ExistingCua
if ($existing) {
- Write-Info "cua is already installed at $existing; using it (CUA_INSTALL_REINSTALL=1 installs it again)"
+ Write-Step "cua is already installed at $existing; using it (CUA_INSTALL_REINSTALL=1 installs it again)"
$sel.cli = $false
$cua = $existing
}
@@ -579,21 +652,18 @@ function Invoke-CuaInstall {
}
$env:CUA_INSTALL_CHANNEL = 'install_script'
if ($sel['cua-driver']) { Install-CuaDriver $cua $tmp $manifestUrl }
- Write-Info 'done'
if ($cua -and -not $Pair -and -not $CliOnly -and -not $NoOnboarding -and -not $DryRun -and (Test-Interactive)) {
- Write-Info 'signing in (cua auth login)'
- & $cua auth login
- if ($LASTEXITCODE -ne 0) { Write-Warning "sign-in did not finish; run 'cua auth login' later" }
- } elseif (-not $Pair) {
Write-Host ''
- Write-Host 'Next steps:'
- if ($sel.cli) {
- Write-Host ' cua auth login # sign in, then set up your AI coding agents'
- Write-Host ' cua agents setup # (re)configure cua skills and the cua MCP server'
- }
- if ($sel.spaces) { Write-Host ' Start "Cua Spaces" from the Start menu' }
+ Write-Step 'Signing in to Cua'
+ & $cua auth login
+ if ($LASTEXITCODE -ne 0) { Write-Warning 'Sign-in did not finish. Run "cua auth login" later (add --remote if this computer has no web browser).' } else { $script:SignedIn = $true }
}
if ($sel.host) { Invoke-HostSetup $cua }
+ Write-CuaSummary $sel
+ if ($script:PathHint) {
+ Write-Host ''
+ $script:PathHint | ForEach-Object { Write-Host $_ }
+ }
} finally {
Remove-Item -Recurse -Force -LiteralPath $tmp -ErrorAction SilentlyContinue
}
diff --git a/scripts/install/install.sh b/scripts/install/install.sh
index b1d9f654a4..9003505fd3 100755
--- a/scripts/install/install.sh
+++ b/scripts/install/install.sh
@@ -6,14 +6,20 @@
# curl -fsSL https://cua.ai/install.sh | sh -s -- --cli-only --yes
# curl -fsSL https://cua.ai/install.sh | sh -s -- --pair K7QM-4XPB-2RHD
#
-# In a terminal it shows a checklist of what to install. Items:
-# cli the cua CLI (always installed, except with --app-only)
+# In a terminal it first says what Cua Spaces is, then lets you choose what to
+# add to the command-line tools (the `cua` program: always installed, except
+# with --app-only):
# spaces the Cua Spaces app (macOS and Linux; default on both)
-# cua-driver cua-driver MCP and skill for your agents (default off)
-# host host this machine: `cua host setup` (default off)
+# cua-driver Cua Driver, which lets AI agents use apps while you keep
+# working: installs it and adds its skill and MCP server to
+# your agents (default off)
+# The checklist does not offer hosting. The app's first run asks how to use
+# this computer (--mode host|client preselects the answer). For scripts,
+# `--select host` / `--only host` still runs `cua host setup`, which lets
+# your other devices use this computer through the relay.
#
# Options:
-# --select LIST preselect items (comma list, e.g. cua-driver,host)
+# --select LIST preselect items (comma list: spaces, cua-driver, host)
# --only LIST install exactly LIST plus the CLI, no checklist
# --cli-only install only the `cua` CLI (same as --only cli)
# --app-only install only the Cua Spaces app (no CLI)
@@ -30,6 +36,7 @@
# --modify-path add the bin dir to your shell profile without asking
# --no-modify-path never edit your shell profile (print the one-line command)
# --no-onboarding do not run `cua auth login` afterwards
+# -v, --verbose print every step (manifest, downloads, signature checks)
# --require-signature fail unless a signature (minisign/cosign) verifies
# --dry-run print what would happen, change nothing
# -y, --yes accept the selection and every prompt (non-interactive)
@@ -37,6 +44,7 @@
#
# Environment (mostly for testing and mirrors):
# CUA_INSTALL_NONINTERACTIVE=1 never prompt (defaults plus --select)
+# CUA_INSTALL_VERBOSE=1 same as --verbose
# CUA_INSTALL_REINSTALL=1 with --pair, install the CLI and app even if present
# CUA_INSTALL_MANIFEST_URL release-artifacts.json to read
# CUA_INSTALL_BASE_URL release download base (default GitHub releases)
@@ -77,6 +85,10 @@ prefix=""
modify_path=0
no_modify_path=0
sig_noted=0
+path_hint=""
+verbose=0
+no_tty_noted=0
+signed_in=0
onboarding=1
require_sig=0
dry_run=0
@@ -84,9 +96,18 @@ assume_yes=0
tmp=""
mounted=""
existing_cua=""
+# What this run installed, for the closing summary.
+did_cli=""
+did_app=""
+did_driver=""
+
+[ "${CUA_INSTALL_VERBOSE:-}" != 1 ] || verbose=1
say() { printf '%s\n' "$*"; }
-info() { printf 'cua-install: %s\n' "$*"; }
+# step: one plain line per thing the installer does.
+step() { printf '%s\n' "$*"; }
+# info: detail for --verbose (manifest URLs, file names, signature checks).
+info() { [ "$verbose" = 0 ] || printf 'cua-install: %s\n' "$*"; }
warn() { printf 'cua-install: warning: %s\n' "$*" >&2; }
die() {
printf 'cua-install: error: %s\n' "$*" >&2
@@ -168,6 +189,7 @@ parse_args() {
--modify-path) modify_path=1 ;;
--no-modify-path) no_modify_path=1 ;;
--no-onboarding) onboarding=0 ;;
+ -v | --verbose) verbose=1 ;;
--require-signature) require_sig=1 ;;
--dry-run) dry_run=1 ;;
-y | --yes) assume_yes=1 ;;
@@ -241,20 +263,41 @@ tty_ok() {
(: </dev/tty) 2>/dev/null
}
+# ask "prompt": read one answer into $answer from the terminal itself, never
+# from stdin (under `curl | sh` stdin is the script). Returns 1 when nobody
+# can answer: no terminal, or the terminal hit end of input. Running out of
+# input is never an answer.
+ask() {
+ answer=""
+ tty_ok || return 1
+ printf '%s ' "$1" >/dev/tty
+ IFS= read -r answer </dev/tty || {
+ answer=""
+ printf '\n' >/dev/tty
+ return 1
+ }
+}
+
+# Said once, the first time a question is skipped for lack of a terminal.
+note_no_tty() {
+ [ "$no_tty_noted" = 0 ] || return 0
+ no_tty_noted=1
+ [ "$assume_yes" = 1 ] || [ "${CUA_INSTALL_NONINTERACTIVE:-}" = 1 ] ||
+ step "The installer can't ask you questions here, so it is using the usual choices (add --yes to hide this note)."
+}
+
# confirm "question" default(y|n): 0 for yes. Answered once the checklist
-# was confirmed.
+# was confirmed. With nobody to ask, the default applies.
confirm() {
if [ "$assume_yes" = 1 ] || [ "$picked" = 1 ]; then
return 0
fi
- if ! tty_ok; then
+ if [ "$2" = y ]; then hint="[Y/n]"; else hint="[y/N]"; fi
+ if ! ask "$1 $hint"; then
+ note_no_tty
[ "$2" = y ]
return
fi
- if [ "$2" = y ]; then hint="[Y/n]"; else hint="[y/N]"; fi
- printf '%s %s ' "$1" "$hint" >/dev/tty
- answer=""
- read -r answer </dev/tty || answer=""
case "$answer" in
[yY] | [yY][eE][sS]) return 0 ;;
[nN] | [nN][oO]) return 1 ;;
@@ -300,12 +343,20 @@ item_toggle() {
if item_on "$1"; then item_set "$1" 0; else item_set "$1" 1; fi
}
+# What a row is called, and one line on what it does (shown under the row
+# the cursor is on). `host` is not a row: the app's first run asks how to
+# use this computer; `--select host` stays for scripts.
item_label() {
case "$1" in
- cli) printf 'cua CLI (required)' ;;
- spaces) printf 'Cua Spaces app' ;;
- cua-driver) printf 'cua-driver MCP and skill for your agents' ;;
- host) printf 'Host this machine' ;;
+ spaces) printf 'Cua Spaces app: lets your AI agents use computers' ;;
+ cua-driver) printf 'Cua Driver: lets AI agents use your apps while you keep working' ;;
+ esac
+}
+
+item_help() {
+ case "$1" in
+ spaces) printf 'Open the app to sign in, connect your AI agents and watch them work.' ;;
+ cua-driver) printf 'For advanced users. Adds it to Claude Code, Codex and other coding agents.' ;;
esac
}
@@ -324,7 +375,7 @@ init_selection() {
sel_spaces=1
fi
if [ "$sel_spaces" = 1 ] && ! spaces_supported; then
- info "Cua Spaces is not available for $os; skipping the app"
+ step "Cua Spaces is not available for $os; skipping the app"
sel_spaces=0
fi
}
@@ -353,7 +404,7 @@ reuse_installed() {
fi
done
[ -n "$found" ] || return 0
- info "cua is already installed at $found; using it (CUA_INSTALL_REINSTALL=1 installs it again)"
+ step "cua is already installed at $found; using it (CUA_INSTALL_REINSTALL=1 installs it again)"
existing_cua="$found"
want_cli=0
case "$os" in
@@ -364,7 +415,7 @@ reuse_installed() {
if has cua-spaces || [ -x "$HOME/.local/bin/cua-spaces" ]; then sel_spaces=0; fi
;;
esac
- if [ "$sel_spaces" = 0 ] && spaces_supported; then info "Cua Spaces is already installed; keeping it"; fi
+ if [ "$sel_spaces" = 0 ] && spaces_supported; then step "Cua Spaces is already installed; keeping it"; fi
}
# Show the checklist only when a human can answer it.
@@ -388,27 +439,40 @@ draw_rows() { # cursor row, or 0 for the numbered list
if item_on "$r"; then box='[x]'; else box='[ ]'; fi
if [ "$1" = 0 ]; then
printf ' %d %s %s\n' "$i" "$box" "$(item_label "$r")"
+ printf ' %s\n' "$(item_help "$r")"
else
if [ "$i" = "$1" ]; then p='>'; else p=' '; fi
printf '\r\033[K%s %s %s\n' "$p" "$box" "$(item_label "$r")"
fi
done
+ if [ "$1" != 0 ]; then
+ printf '\r\033[K\n\r\033[K %s\n\r\033[K\n' "$(item_help "$(row_id "$1")")"
+ fi
}
-# checklist: pick items with arrows/numbers + space, Enter to install.
+# checklist: what Cua Spaces is, what is always installed, then the optional
+# rows: arrows/numbers + space to toggle, Enter to install.
checklist() {
- rows="cli"
+ rows=""
# Spaces is offered only where it ships (macOS, Linux).
- if spaces_supported; then rows="$rows spaces"; fi
- rows="$rows cua-driver host"
+ if spaces_supported; then rows="spaces"; fi
+ rows="${rows:+$rows }cua-driver"
n=0
for r in $rows; do n=$((n + 1)); done
- printf '\nChoose what to install:\n' >/dev/tty
+ {
+ printf '\nCua Spaces lets your AI agents use computers, and lets you watch them work.\n\n'
+ printf 'Needed, so always installed:\n'
+ printf ' Command-line tools: the "cua" program that the app and your AI agents use.\n'
+ if [ "$sel_host" = 1 ]; then
+ printf 'Also: your other devices will be able to use this computer (you asked for this with --select host).\n'
+ fi
+ printf '\nChoose what else to add:\n\n'
+ } >/dev/tty
if [ "${TERM:-dumb}" = dumb ] || ! tty_saved="$(stty -g </dev/tty 2>/dev/null)"; then
tty_saved=""
while :; do
draw_rows 0 >/dev/tty
- printf 'Toggle numbers (e.g. 2 3), Enter to install: ' >/dev/tty
+ printf 'Type a number to switch an item on or off. Press Enter to install: ' >/dev/tty
line=""
read -r line </dev/tty || line=""
[ -n "$line" ] || break
@@ -423,7 +487,7 @@ checklist() {
cr="$(printf '\r')"
cur=1
draw_rows "$cur" >/dev/tty
- printf 'Up/down or 1-%d to move/toggle, space to toggle, Enter to install\n' "$n" >/dev/tty
+ printf 'Up/down to move, space to select, Enter to install\n' >/dev/tty
while :; do
key="$(dd bs=1 count=1 2>/dev/null </dev/tty)" || key=""
case "$key" in
@@ -445,7 +509,7 @@ checklist() {
fi
;;
esac
- printf '\033[%dA' "$((n + 1))" >/dev/tty
+ printf '\033[%dA' "$((n + 4))" >/dev/tty
draw_rows "$cur" >/dev/tty
printf '\n' >/dev/tty
done
@@ -622,10 +686,11 @@ verify_signature() { # file entry
die "no verifiable signature for ${1##*/} (install minisign or cosign)"
fi
if [ "$sig_ok" = 0 ] && { [ -n "$minisig" ] || [ -n "$bundle" ]; }; then
- # One quiet line per run: sha256 is checked either way.
+ # sha256 is checked either way; the closing summary says so. The
+ # detail is for --verbose.
if [ "$sig_noted" = 0 ]; then
sig_noted=1
- info "checked sha256 (cosign is not installed, so release signatures were not checked; --require-signature makes that an error)"
+ info "release signatures were not checked: neither minisign nor cosign is installed (--require-signature makes that an error)"
fi
fi
}
@@ -651,7 +716,7 @@ download() {
fetch "$url" "$artifact"
actual="$(sha256_of "$artifact")"
if [ "$actual" != "$sum" ]; then
- die "checksum mismatch for $name (expected $sum, got $actual); aborting"
+ die "checksum mismatch for $name (the download is damaged or was changed; expected $sum, got $actual); nothing was installed"
fi
verify_signature "$artifact" "$entry"
}
@@ -703,14 +768,14 @@ ensure_path() { # dir
profile="$(profile_file)"
line="$(path_line "$1" "$profile")"
if [ "$modify_path" = 0 ] && [ "$no_modify_path" = 0 ] && [ "$assume_yes" = 0 ] && [ "$dry_run" = 0 ] && [ "${CUA_INSTALL_NONINTERACTIVE:-0}" != 1 ] && tty_ok; then
- # Interactive default: offer to add it (Enter = yes).
- printf 'Add %s to PATH in %s so cua works in new terminals? [Y/n] ' "$1" "$profile" >/dev/tty
- answer=""
- read -r answer </dev/tty || answer=""
- case "$answer" in
- [nN] | [nN][oO]) ;;
- *) modify_path=1 ;;
- esac
+ # Interactive default: offer to add it (Enter = yes). No answer
+ # (the terminal closed) leaves the profile alone.
+ if ask "Make \"cua\" work in new Terminal windows? This adds $1 to PATH in $profile. [Y/n]"; then
+ case "$answer" in
+ [nN] | [nN][oO]) ;;
+ *) modify_path=1 ;;
+ esac
+ fi
fi
if [ "$modify_path" = 1 ] && [ "$no_modify_path" = 0 ]; then
if [ -f "$profile" ] && grep -qF "$line" "$profile"; then
@@ -722,21 +787,23 @@ ensure_path() { # dir
fi
mkdir -p "$(dirname "$profile")"
printf '\n# Added by the cua installer\n%s\n' "$line" >>"$profile"
- info "added $1 to PATH in $profile (open a new terminal to pick it up)"
+ step "Added $1 to PATH in $profile (open a new Terminal window to use cua)"
else
- say ""
- say "$1 is not on your PATH. Add it with this one line, then open a new terminal:"
- say " echo '$line' >> $profile"
- say "(or rerun the installer with --modify-path)"
+ # Said at the end, after what was installed.
+ path_hint="$1 is not on your PATH, the list of places your Terminal looks for programs.
+To use cua, run this one line, then open a new Terminal window:
+ echo '$line' >> $profile
+(or rerun the installer with --modify-path)"
fi
}
install_cli() {
bindir="$(cli_bin_dir)"
target="$bindir/cua"
- if ! confirm "Install the cua CLI to $target?" y; then
+ if ! confirm "Install the command-line tools to $target?" y; then
die "cancelled; rerun with --prefix DIR to choose another location"
fi
+ step "Installing the command-line tools to $target"
download cli tar.gz
if [ "$dry_run" = 1 ]; then
say "[dry-run] install cua -> $target"
@@ -749,7 +816,7 @@ install_cli() {
cp "$src" "$bindir/.cua.tmp.$$"
chmod 0755 "$bindir/.cua.tmp.$$"
mv -f "$bindir/.cua.tmp.$$" "$target"
- info "installed $target"
+ did_cli="$target"
fi
cua_bin="$target"
ensure_path "$bindir"
@@ -783,10 +850,11 @@ install_app_darwin() {
if [ "$appdir" = /Applications ] && confirm "Install to $HOME/Applications instead?" y; then
appdir="$HOME/Applications"
else
- info "skipping the Cua Spaces app"
+ step "Skipping the Cua Spaces app"
return
fi
fi
+ step "Installing the Cua Spaces app to $appdir"
download app dmg
if [ "$dry_run" = 1 ]; then
say "[dry-run] mount ${artifact##*/} and copy Cua Spaces.app -> $appdir"
@@ -811,7 +879,7 @@ install_app_darwin() {
mv "$app_path.cua-new" "$app_path"
hdiutil detach -quiet "$mounted" >/dev/null 2>&1 || true
mounted=""
- info "installed $app_path"
+ did_app="$app_path"
}
install_app_linux() {
@@ -823,20 +891,23 @@ install_app_linux() {
if [ "$(id -u)" != 0 ]; then
if has sudo && sudo -n true 2>/dev/null; then sudo_cmd="sudo"; else sudo_cmd="none"; fi
fi
- if [ "$sudo_cmd" != none ] && confirm "Install the Cua Spaces .deb with apt-get?" y; then
+ if [ "$sudo_cmd" != none ] && confirm "Install the Cua Spaces app with apt-get?" y; then
+ step "Installing the Cua Spaces app with apt-get"
download app deb
# shellcheck disable=SC2086
run $sudo_cmd apt-get install -y "$artifact"
app_path="cua-spaces"
+ did_app="$app_path"
return
fi
fi
bindir="$(cli_bin_dir)"
target="$bindir/cua-spaces"
- if ! confirm "Install the Cua Spaces AppImage to $target?" y; then
- info "skipping the Cua Spaces app"
+ if ! confirm "Install the Cua Spaces app to $target?" y; then
+ step "Skipping the Cua Spaces app"
return
fi
+ step "Installing the Cua Spaces app to $target"
download app appimage
app_path="$target"
if [ -n "$prefix" ]; then
@@ -853,6 +924,7 @@ install_app_linux() {
cp "$artifact" "$bindir/.cua-spaces.tmp.$$"
chmod 0755 "$bindir/.cua-spaces.tmp.$$"
mv -f "$bindir/.cua-spaces.tmp.$$" "$target"
+ did_app="$target"
cat >"$desktop_dir/cua-spaces.desktop" <<EOF
[Desktop Entry]
Type=Application
@@ -862,7 +934,6 @@ Exec="$target" %U
Terminal=false
Categories=Development;
EOF
- info "installed $target"
}
runtime_ready() {
@@ -889,9 +960,11 @@ linux_runtime() {
say "[dry-run] $cua_bin runtime setup qemu"
return
fi
- if confirm "Cua Spaces on Linux needs QEMU; install it now ($cua_bin runtime setup qemu)?" y &&
- "$cua_bin" runtime setup qemu </dev/null && runtime_ready; then
- return
+ if confirm "Cua Spaces on Linux needs QEMU, a program that runs virtual computers. Install it now?" y; then
+ step "Installing QEMU, which Cua Spaces on Linux uses to run virtual computers"
+ if "$cua_bin" runtime setup qemu </dev/null && runtime_ready; then
+ return
+ fi
fi
die "Cua Spaces on Linux needs QEMU or Docker; install QEMU with: $(qemu_install_command) (or install Docker), then rerun the installer"
}
@@ -940,7 +1013,7 @@ install_driver() {
say "[dry-run] download $driver_url"
say "[dry-run] bash ${script##*/} $*"
else
- info "installing cua-driver"
+ step "Installing Cua Driver and adding it to your AI agents"
fetch "$driver_url" "$script"
bash "$script" "$@" </dev/null || die "the cua-driver installer failed"
fi
@@ -954,6 +1027,7 @@ install_driver() {
elif ! "$@" </dev/null; then
warn "agent setup for cua-driver did not finish; rerun: cua agents setup --cua-driver"
fi
+ did_driver=1
}
# Host this machine: joins the relay as the signed-in account. `cua host
@@ -969,7 +1043,7 @@ host_setup() {
say "[dry-run] $cua_bin host setup"
return
fi
- info "setting up this machine as a host (cua host setup)"
+ step "Letting your other devices use this computer (cua host setup)"
if tty_ok; then
if "$cua_bin" host setup </dev/tty; then
say " cua runtime setup lume # also needed to provide macOS VM Spaces (cua host setup --profile spare --provide-spaces)"
@@ -998,7 +1072,7 @@ host_pair() {
if ! "$cua_bin" host setup --help 2>&1 </dev/null | grep -q -e '--pair'; then
die "the installed cua CLI ($("$cua_bin" --version 2>/dev/null || echo unknown)) cannot add a machine with a code (no 'cua host setup --pair'); update the CLI (cua update, or install a newer release: --version) or sign in instead: cua auth login && cua host setup"
fi
- info "adding this machine to your account (cua host setup --pair)"
+ step "Adding this computer to your account (cua host setup --pair)"
if "$@" </dev/null; then
say ""
say "This machine is added. It shows up in Cua Spaces on your other devices in a few seconds."
@@ -1009,21 +1083,64 @@ host_pair() {
# ---------------------------------------------------------------- onboarding
-next_steps() {
+# "a, b and c" from the arguments.
+join_and() {
+ case $# in
+ 1) printf '%s' "$1" ;;
+ 2) printf '%s and %s' "$1" "$2" ;;
+ *) printf '%s, %s and %s' "$1" "$2" "$3" ;;
+ esac
+}
+
+# Where to open the app from, in plain words.
+app_where() {
+ case "$os" in
+ darwin) printf 'open Cua Spaces from %s' "${app_path%/*}" ;;
+ *)
+ if [ "$app_path" = cua-spaces ]; then
+ printf 'open Cua Spaces from your app menu'
+ else
+ printf 'run %s' "$app_path"
+ fi
+ ;;
+ esac
+}
+
+# The closing lines: what was installed, then what to do next, in plain words.
+summary() {
+ [ "$dry_run" = 0 ] && [ -z "$pair_code" ] || return 0
+ set --
+ [ -z "$did_cli" ] || set -- "$@" "the command-line tools"
+ [ -z "$did_app" ] || set -- "$@" "the Cua Spaces app"
+ [ -z "$did_driver" ] || set -- "$@" "Cua Driver"
say ""
- say "Next steps:"
- if [ "$want_cli" = 1 ]; then
- say " cua auth login # sign in (over ssh / no browser: --remote), then set up your AI coding agents"
- say " cua agents setup # (re)configure cua skills and the cua MCP server"
- fi
- if [ "$sel_host" = 1 ]; then
- say " cua host setup # hosting Spaces needs you signed in first"
- fi
- if [ "$sel_spaces" = 1 ] && [ -n "${app_path:-}" ]; then
- if [ "$os" = darwin ]; then
- say " open \"$app_path\" # start Cua Spaces"
+ if [ $# -gt 0 ]; then
+ checked=""
+ [ -z "$did_cli$did_app" ] || checked=" (downloads checked)"
+ say "Installed $(join_and "$@")$checked."
+ fi
+ if [ -n "$did_app" ]; then
+ if [ "$signed_in" = 1 ]; then
+ say "Next: $(app_where). There you can also let your other devices use this computer."
+ else
+ say "Next: $(app_where). It guides you through signing in and connecting your AI agents. You can also let your other devices use this computer."
+ fi
+ if [ "$want_cli" = 1 ]; then
+ if [ "$signed_in" = 1 ]; then
+ say 'To connect more AI agents later, run "cua agents setup" in the Terminal.'
+ else
+ say 'Prefer the Terminal? Run "cua auth login" to sign in, then "cua agents setup" to connect your AI agents.'
+ fi
+ fi
+ elif [ "$want_cli" = 1 ]; then
+ if [ "$signed_in" = 1 ]; then
+ say 'Next: run "cua agents setup" to connect your AI agents.'
else
- say " $app_path # start Cua Spaces"
+ say 'Next: run "cua auth login" to sign in, then "cua agents setup" to connect your AI agents.'
+ say '(No web browser on this computer? Run "cua auth login --remote" instead.)'
+ fi
+ if [ "$sel_host" = 0 ]; then
+ say 'To let your other devices use this computer, run "cua host setup".'
fi
fi
}
@@ -1032,28 +1149,19 @@ run_onboarding() {
# --pair: the code stands in for the account; nothing to sign in to.
[ -z "$pair_code" ] || return 0
if [ "$want_cli" = 0 ] || [ "$onboarding" = 0 ] || [ "$dry_run" = 1 ]; then
- next_steps
- return
- fi
- if ! tty_ok; then
- # No terminal to sign in on (piped install, -y, or nobody at the
- # console over ssh): `cua auth login` needs one, so it was skipped.
- # Tell the user exactly how to finish instead of leaving this
- # silent; hosting Spaces (`cua host setup`) needs a signed-in
- # account too.
- say ""
- info "not signing in: no terminal to prompt on"
- say "Sign in from here with a device code (works over ssh, no browser needed):"
- say " cua auth login --remote"
- next_steps
return
fi
+ # No terminal to sign in on (piped install, -y, or nobody at the
+ # console over ssh): `cua auth login` needs one, so the summary says
+ # how to finish instead.
+ tty_ok || return 0
say ""
- info "signing in (cua auth login)"
+ step "Signing in to Cua"
# `cua auth login` runs agent onboarding after a successful sign-in.
- if ! "$cua_bin" auth login </dev/tty; then
- warn "sign-in did not finish; run 'cua auth login' later (or 'cua auth login --remote' over ssh)"
- next_steps
+ if "$cua_bin" auth login </dev/tty; then
+ signed_in=1
+ else
+ warn "sign-in did not finish. Run \"cua auth login\" later (add --remote if this computer has no web browser)"
fi
}
@@ -1067,7 +1175,7 @@ main() {
checklist
fi
if [ "$dry_run" = 1 ]; then
- info "dry run: nothing will be changed"
+ step "Dry run: nothing will be changed"
fi
# Nothing to download (--pair on a computer that has Cua): no manifest to read.
if [ "$want_cli" = 1 ] || [ "$sel_spaces" = 1 ] || [ "$sel_driver" = 1 ]; then
@@ -1102,11 +1210,15 @@ main() {
if [ "$sel_driver" = 1 ]; then
install_driver
fi
- info "done"
run_onboarding
if [ "$sel_host" = 1 ]; then
host_setup
fi
+ summary
+ if [ -n "$path_hint" ]; then
+ say ""
+ say "$path_hint"
+ fi
}
main "$@"
diff --git a/scripts/install/tests/install.Tests.ps1 b/scripts/install/tests/install.Tests.ps1
index f619f0e0bb..382b6f8481 100644
--- a/scripts/install/tests/install.Tests.ps1
+++ b/scripts/install/tests/install.Tests.ps1
@@ -106,23 +106,48 @@ Describe 'functions' {
{ Get-CuaSelection -SelectList '' -OnlyList '' -Cli $true -App $true -InstallMode '' } | Should -Throw '*mutually exclusive*'
}
- It 'toggles items in the numbered checklist; the CLI row is locked' {
- $script:answers = [Collections.Generic.Queue[string]]::new([string[]]@('1 3', '4', ''))
+ It 'toggles the Cua Spaces and Cua Driver rows; there is no CLI row and no hosting row' {
+ # 2 turns Cua Driver on, 3 is past the last row, 1 turns the app off.
+ $script:answers = [Collections.Generic.Queue[string]]::new([string[]]@('2 3', '1', ''))
$sel = Get-CuaSelection -SelectList '' -OnlyList '' -Cli $false -App $false -InstallMode ''
$sel = Read-CuaSelection $sel { $script:answers.Dequeue() } 6>$null
- @($sel.cli, $sel.spaces, $sel['cua-driver'], $sel.host) | Should -Be @($true, $true, $true, $true)
+ @($sel.cli, $sel.spaces, $sel['cua-driver'], $sel.host) | Should -Be @($true, $false, $true, $false)
$script:Picked | Should -BeTrue
$script:Picked = $false
}
- It 'shows Spaces in the checklist, where it can be unticked' {
- $script:answers = [Collections.Generic.Queue[string]]::new([string[]]@('2', ''))
+ It 'shows Spaces in the list, where it can be unticked' {
+ $script:answers = [Collections.Generic.Queue[string]]::new([string[]]@('1', ''))
$sel = Get-CuaSelection -SelectList 'spaces' -OnlyList '' -Cli $false -App $false -InstallMode ''
$sel = Read-CuaSelection $sel { $script:answers.Dequeue() } 6>$null
@($sel.spaces, $sel['cua-driver']) | Should -Be @($false, $false)
$script:Picked = $false
}
+ It 'says what Cua Spaces is and what is always installed, and describes each row' {
+ $script:answers = [Collections.Generic.Queue[string]]::new([string[]]@(''))
+ $sel = Get-CuaSelection -SelectList '' -OnlyList '' -Cli $false -App $false -InstallMode ''
+ $shown = @(& { $null = Read-CuaSelection $sel { $script:answers.Dequeue() } } 6>&1 | ForEach-Object { "$($_.MessageData)" })
+ $text = $shown -join "`n"
+ $text | Should -Match 'Cua Spaces lets your AI agents use computers, and lets you watch them work\.'
+ $text | Should -Match 'Needed, so always installed:'
+ $text | Should -Match 'Command-line tools: the "cua" program that the app and your AI agents use\.'
+ $text | Should -Match '1 \[x\] Cua Spaces app: lets your AI agents use computers'
+ $text | Should -Match '2 \[ \] Cua Driver: lets AI agents use your apps while you keep working'
+ $text | Should -Match 'For advanced users\. Adds it to Claude Code, Codex and other coding agents\.'
+ $text | Should -Not -Match 'Host this machine'
+ $text | Should -Not -Match 'cua CLI \(required\)'
+ $script:Picked = $false
+ }
+
+ It 'says a scripted -Select host is on, though the list has no hosting row' {
+ $script:answers = [Collections.Generic.Queue[string]]::new([string[]]@(''))
+ $sel = Get-CuaSelection -SelectList 'host' -OnlyList '' -Cli $false -App $false -InstallMode ''
+ $shown = @(& { $null = Read-CuaSelection $sel { $script:answers.Dequeue() } } 6>&1 | ForEach-Object { "$($_.MessageData)" })
+ ($shown -join "`n") | Should -Match 'Also: your other devices will be able to use this computer'
+ $script:Picked = $false
+ }
+
It 'forwards -RequireSignature and -NoPathUpdate to the cua-driver installer' {
$RequireSignature = $false; $NoModifyPath = $true
Get-DriverInstallArgs | Should -Be @('-NoPathUpdate')
@@ -175,16 +200,28 @@ Describe 'install.ps1' {
$prefix = Join-Path $env:CUA_TEST_ROOT 'p1'
$out = Invoke-Installer @{ CliOnly = $true; Yes = $true; NoOnboarding = $true; NoModifyPath = $true; Prefix = $prefix }
Join-Path $prefix 'bin/cua.exe' | Should -Exist
- $out | Should -Match 'Next steps'
+ $out | Should -Match 'Installed the command-line tools \(downloads checked\)\.'
+ $out | Should -Match 'Next: run "cua auth login" to sign in, then "cua agents setup" to connect your AI agents\.'
+ $out | Should -Match 'To let your other devices use this computer, run "cua host setup"\.'
$out | Should -Match 'is not on your PATH'
}
+ It 'prints one plain line per step by default, and the detail with -Verbose' {
+ $prefix = Join-Path $env:CUA_TEST_ROOT 'p-quiet'
+ $out = Invoke-Installer @{ CliOnly = $true; Yes = $true; NoOnboarding = $true; NoModifyPath = $true; Prefix = $prefix }
+ $out | Should -Match 'Installing the command-line tools to '
+ $out | Should -Not -Match 'cua-install:'
+ $out | Should -Not -Match 'manifest|checksum|sha256'
+ $verbose = Invoke-Installer @{ CliOnly = $true; Yes = $true; NoOnboarding = $true; NoModifyPath = $true; Prefix = (Join-Path $env:CUA_TEST_ROOT 'p-verbose'); Verbose = $true }
+ $verbose | Should -Match 'cua-install: platform windows-x64, manifest '
+ }
+
# CUA-1704: `cua` must work in the next terminal without a manual step.
It 'adds the CLI to the user PATH by default; -CliOnly neither asks nor signs in' {
$out = Invoke-Installer @{ DryRun = $true; CliOnly = $true; Prefix = (Join-Path $env:CUA_TEST_ROOT 'p11') }
$out | Should -Match '\[dry-run\] add .*p11.bin to the user PATH'
$out | Should -Not -Match 'is not on your PATH'
- $out | Should -Not -Match 'Install the cua CLI to'
+ $out | Should -Not -Match 'Install the command-line tools to'
$out | Should -Not -Match 'signing in'
$out | Should -Not -Match 'setup.exe'
}
@@ -207,7 +244,7 @@ Describe 'install.ps1' {
}
# Clean machine: the manifest lists signatures but neither minisign nor
- # cosign is installed. The "checked sha256" note reads $script:SigNoted,
+ # cosign is installed. The signature note reads $script:SigNoted,
# which crashed under Set-StrictMode when it was never initialised.
It 'installs under StrictMode when the manifest has signatures but no verifier is installed' {
$sig = Join-Path $env:CUA_TEST_ROOT 'sig'
@@ -223,8 +260,15 @@ Describe 'install.ps1' {
PATH = ((Get-Command python3).Source | Split-Path)
}
$out | Should -Not -Match 'has not been set'
- $out | Should -Match 'checked sha256'
+ $out | Should -Match 'Installed the command-line tools \(downloads checked\)\.'
+ $out | Should -Not -Match 'cosign|minisign|signatures were not'
Join-Path $prefix 'bin/cua.exe' | Should -Exist
+ # The detail is for -Verbose.
+ $verbose = Invoke-Installer @{ CliOnly = $true; Yes = $true; NoOnboarding = $true; NoModifyPath = $true; Prefix = (Join-Path $env:CUA_TEST_ROOT 'p-sig-v'); Verbose = $true } @{
+ CUA_INSTALL_MANIFEST_URL = (ConvertTo-FileUrl $sigManifest)
+ PATH = ((Get-Command python3).Source | Split-Path)
+ }
+ $verbose | Should -Match 'release signatures were not checked'
}
It 'aborts on a checksum mismatch' {
diff --git a/scripts/install/tests/run.sh b/scripts/install/tests/run.sh
index df25802dc9..cb339f3093 100755
--- a/scripts/install/tests/run.sh
+++ b/scripts/install/tests/run.sh
@@ -172,7 +172,7 @@ absent() { [ ! -e "$1" ]; }
# ------------------------------------------------------------ tests
-inst -- --yes --no-onboarding --prefix "$work/p1"
+inst -- --yes --no-onboarding --verbose --prefix "$work/p1"
check "linux x64: exits 0" [ "$status" = 0 ]
check "linux x64: installs cua under --prefix/bin" exists "$work/p1/bin/cua"
check "linux x64: installed cua runs and is the x64 build" sh -c "'$work/p1/bin/cua' --version | grep -q linux-x64"
@@ -183,9 +183,33 @@ check "linux x64: uses the rolling latest manifest" has_out "cua-install-latest/
check "non-interactive: prints next steps, no login" sh -c "grep -q 'cua auth login' '$work/out' && [ ! -e '$home/cua.log' ]"
check "prefix bin not on PATH: prints a hint" has_out "is not on your PATH"
check "no --modify-path: profile untouched" absent "$home/.profile"
+check "--verbose: shows the platform and manifest" has_out "cua-install: platform linux-x64, manifest "
+check "--verbose: shows each download" has_out "cua-install: downloading cua-cli-$version-linux-x64.tar.gz"
check "VM runtime present: no runtime setup" sh -c "grep -q 'VM runtime ok' '$work/out' && ! grep -q 'runtime setup' '$home/cua.log' 2>/dev/null"
+# The default output: one plain line per step, then what was installed and
+# what to do next. The cua-install: detail lines are --verbose only.
+inst -- --yes --no-onboarding --prefix "$work/q1"
+check "quiet default: no cua-install: lines" sh -c "[ $status = 0 ] && ! grep -q '^cua-install:' '$work/out'"
+check "quiet default: one 'Installing' line per step" sh -c "[ \"\$(grep -c '^Installing ' '$work/out')\" = 2 ] && grep -q '^Installing the command-line tools to ' '$work/out' && grep -q '^Installing the Cua Spaces app to ' '$work/out'"
+check "quiet default: closes with what was installed" has_out "^Installed the command-line tools and the Cua Spaces app (downloads checked)\\.\$"
+check "quiet default: says what to do next" sh -c "grep -q '^Next: run .*cua-spaces. It guides you through signing in and connecting your AI agents.' '$work/out' && grep -q 'Prefer the Terminal? Run \"cua auth login\" to sign in, then \"cua agents setup\"' '$work/out'"
+check "quiet default: no signature, checksum or manifest jargon" sh -c "! grep -qi 'cosign\|minisign\|sha256\|checksum\|manifest' '$work/out'"
+check "quiet default: the PATH hint comes last" sh -c "tail -4 '$work/out' | grep -q 'is not on your PATH'"
+inst CUA_INSTALL_VERBOSE=1 -- --yes --no-onboarding --cli-only --prefix "$work/q2"
+check "CUA_INSTALL_VERBOSE=1 is --verbose" has_out "^cua-install: platform "
+inst -- --yes --no-onboarding --cli-only --prefix "$work/q3"
+check "--cli-only: summary points at sign-in, agents and hosting" sh -c "grep -q '^Installed the command-line tools (downloads checked)' '$work/out' && grep -q '^Next: run \"cua auth login\" to sign in, then \"cua agents setup\" to connect your AI agents.' '$work/out' && grep -q 'No web browser on this computer? Run \"cua auth login --remote\"' '$work/out' && grep -q 'To let your other devices use this computer, run \"cua host setup\".' '$work/out'"
+inst -- --yes --no-onboarding --app-only --prefix "$work/q4"
+check "--app-only: summary names the app, not the CLI" sh -c "grep -q '^Installed the Cua Spaces app (downloads checked)' '$work/out' && ! grep -q 'cua auth login' '$work/out'"
+inst -- --no-onboarding --cli-only --prefix "$work/q5"
+check "no terminal and no --yes: says it uses the defaults, once" sh -c "[ $status = 0 ] && [ \"\$(grep -c 'ask you questions here' '$work/out')\" = 1 ]"
+inst -- --yes --no-onboarding --cli-only --prefix "$work/q6"
+check "--yes: no note about not asking questions" sh -c "! grep -q 'ask you questions' '$work/out'"
+inst CUA_INSTALL_NONINTERACTIVE=1 -- --no-onboarding --cli-only --prefix "$work/q7"
+check "CUA_INSTALL_NONINTERACTIVE=1: no note about not asking questions" sh -c "! grep -q 'ask you questions' '$work/out'"
+
mkdir -p "$work/qemu-r1"
inst PATH="$work/qemu-r1:$host_path" CUA_FAKE_QEMU_DIR="$work/qemu-r1" -- --yes --no-onboarding --prefix "$work/r1"
check "VM runtime missing, setup succeeds: installs the app" sh -c "[ $status = 0 ] && grep -qx 'runtime setup qemu' '$home/cua.log' && [ -x '$work/r1/bin/cua-spaces' ]"
@@ -199,7 +223,7 @@ check "VM runtime missing, --dry-run: prints the setup only" sh -c "[ $status =
# ------------------------------------------------------------ selection
# Cua Spaces ships for macOS and Linux; the manifest also lists Windows.
-inst -- --yes --no-onboarding --select spaces --prefix "$work/s1"
+inst -- --yes --no-onboarding --verbose --select spaces --prefix "$work/s1"
check "--select spaces (Linux): installs the AppImage" sh -c "[ $status = 0 ] && [ -x '$work/s1/bin/cua-spaces' ] && grep -q 'cua-spaces-$version-linux-x64.AppImage' '$work/out'"
check "--select spaces (Linux): desktop entry" exists "$work/s1/share/applications/cua-spaces.desktop"
check "--select spaces (Linux): still installs the CLI" exists "$work/s1/bin/cua"
@@ -207,7 +231,7 @@ check "--select spaces (Linux): still installs the CLI" exists "$work/s1/bin/cua
inst -- --no-onboarding --only spaces --prefix "$work/s2"
check "--only spaces (Linux): installs the CLI and the app" sh -c "[ $status = 0 ] && [ -x '$work/s2/bin/cua-spaces' ] && [ -e '$work/s2/bin/cua' ]"
-inst CUA_INSTALL_ARCH=aarch64 -- --yes --no-onboarding --select spaces --prefix "$work/s2b"
+inst CUA_INSTALL_ARCH=aarch64 -- --yes --no-onboarding --verbose --select spaces --prefix "$work/s2b"
check "--select spaces (Linux arm64): installs the arm64 AppImage" sh -c "[ $status = 0 ] && grep -q 'cua-spaces-$version-linux-arm64.AppImage' '$work/out' && '$work/s2b/bin/cua-spaces' | grep -q 'cua-spaces arm64'"
inst -- --no-onboarding --prefix "$work/s3"
@@ -317,7 +341,7 @@ check "--cli-only with --app-only is an error" sh -c "[ $status != 0 ] && grep -
inst -- --bogus
check "unknown option is an error" sh -c "[ $status != 0 ] && grep -q 'unknown option' '$work/out'"
-inst -- --yes --cli-only --version "v$version" --prefix "$work/p6"
+inst -- --yes --cli-only --verbose --version "v$version" --prefix "$work/p6"
check "--version reads the versioned release manifest" has_out "cua-sdk-v$version/release-artifacts.json"
check "--version resolves relative artifact URLs" exists "$work/p6/bin/cua"
@@ -473,8 +497,10 @@ cp "$tag_dir"/cua-cli-* "$tag_dir"/cua-spaces-"$version"-linux-x64.AppImage "$si
for f in "$sig2"/cua-cli-*.tar.gz "$sig2"/*.AppImage; do printf 'sig\n' >"$f.minisig"; done
python3 "$manifest_tool" --component cli --version "$version" --dir "$sig2" --out "$sig2/cli.json"
python3 "$manifest_tool" --component app --version "$version" --dir "$sig2" --merge "$sig2/cli.json" --out "$sig2/release-artifacts.json"
-inst CUA_INSTALL_MANIFEST_URL="$base/sig2/release-artifacts.json" -- --yes --no-onboarding --select spaces --prefix "$work/sg1"
-check "unverifiable signatures: one info line, no warning" sh -c "[ $status = 0 ] && [ \"\$(grep -c 'release signatures were not checked' '$work/out')\" = 1 ] && ! grep -qi 'warning.*minisign' '$work/out'"
+inst CUA_INSTALL_MANIFEST_URL="$base/sig2/release-artifacts.json" -- --yes --no-onboarding --verbose --select spaces --prefix "$work/sg1"
+check "unverifiable signatures: one --verbose info line, no warning" sh -c "[ $status = 0 ] && [ \"\$(grep -c 'release signatures were not checked' '$work/out')\" = 1 ] && ! grep -qi 'warning.*minisign' '$work/out'"
+inst CUA_INSTALL_MANIFEST_URL="$base/sig2/release-artifacts.json" -- --yes --no-onboarding --select spaces --prefix "$work/sg3"
+check "unverifiable signatures, default output: plain checksum line only" sh -c "[ $status = 0 ] && grep -q '(downloads checked)' '$work/out' && ! grep -qi 'cosign\|minisign\|signatures were not\|checksum' '$work/out'"
inst CUA_INSTALL_MANIFEST_URL="$base/sig2/release-artifacts.json" -- --yes --no-onboarding --select spaces --require-signature --prefix "$work/sg2"
check "--require-signature still fails without minisign or cosign" sh -c "[ $status != 0 ] && grep -q 'no verifiable signature' '$work/out'"
@@ -489,6 +515,7 @@ if script --version 2>/dev/null | grep -q util-linux; then
CUA_INSTALL_ARCH=x86_64 CUA_FAKE_LOG="$home/cua.log" \
script -qec "$sh_bin '$installer' --yes --cli-only --prefix '$work/p14'" /dev/null >"$work/out" 2>&1 </dev/null
check "interactive: runs 'cua auth login'" sh -c "grep -qx 'auth login' '$home/cua.log'"
+ check "interactive: after sign-in, the closing line points at agents setup" sh -c "grep -q 'Signing in to Cua' '$work/out' && grep -q 'Next: run \"cua agents setup\" to connect your AI agents.' '$work/out' && ! grep -q 'Next: run \"cua auth login\"' '$work/out'"
env -i PATH="$PATH" HOME="$home" SHELL=/bin/sh CUA_INSTALL_BASE_URL="$base" CUA_INSTALL_OS=linux \
CUA_INSTALL_ARCH=x86_64 CUA_FAKE_LOG="$home/cua2.log" \
script -qec "$sh_bin '$installer' --yes --cli-only --no-onboarding --prefix '$work/p14'" /dev/null >"$work/out" 2>&1 </dev/null
@@ -512,9 +539,29 @@ if script --version 2>/dev/null | grep -q util-linux; then
status=$?
}
pty_path '\r\r' "$work/pt1"
- check "PATH prompt: Enter adds the bin dir to .zshrc" sh -c "[ $status = 0 ] && grep -q '$work/pt1/bin' '$home/.zshrc' && grep -q 'Add .* to PATH' '$work/out'"
+ check "PATH prompt: Enter adds the bin dir to .zshrc" sh -c "[ $status = 0 ] && grep -q '$work/pt1/bin' '$home/.zshrc' && grep -q 'adds .* to PATH' '$work/out'"
pty_path '\rn\r' "$work/pt2"
check "PATH prompt: n leaves the profile alone and prints the one-liner" sh -c "[ $status = 0 ] && [ ! -e '$home/.zshrc' ] && grep -q 'is not on your PATH' '$work/out'"
+
+ # End of input (Ctrl-D) is not an answer: the install question takes
+ # its default, the PATH question leaves the profile alone.
+ pty_eof() { # PREFIX
+ home="$work/home.pty.$RANDOM_SEQ"
+ RANDOM_SEQ=$((RANDOM_SEQ + 1))
+ mkdir -p "$home"
+ (
+ sleep 2
+ printf '\004'
+ sleep 1
+ printf '\004'
+ sleep 2
+ ) | env -i PATH="$PATH" HOME="$home" SHELL=/bin/sh CUA_HOME="$home/.cua" \
+ CUA_INSTALL_BASE_URL="$base" CUA_INSTALL_OS=linux CUA_INSTALL_ARCH=x86_64 CUA_FAKE_LOG="$home/cua.log" \
+ timeout 60 script -qec "env SHELL=/bin/zsh $sh_bin '$installer' --cli-only --no-onboarding --prefix '$1'" /dev/null >"$work/out" 2>&1
+ status=$?
+ }
+ pty_eof "$work/pt3"
+ check "prompts at end of input: install by default, never edit the profile" sh -c "[ $status = 0 ] && [ -x '$work/pt3/bin/cua' ] && [ ! -e '$home/.zshrc' ] && grep -q 'is not on your PATH' '$work/out' && ! grep -q 'Added .* to PATH' '$work/out'"
fi
# The checklist, driven through a pty. Keys arrive after the prompt shows.
@@ -538,32 +585,38 @@ if script --version 2>/dev/null | grep -q util-linux; then
logged() { grep -q -- "$1" "$home/cua.log" 2>/dev/null; }
if command -v bash >/dev/null 2>&1 && command -v timeout >/dev/null 2>&1; then
tty_inst '\r' --prefix "$work/t1"
- check "checklist: shows the rows, Linux includes Spaces" sh -c "grep -q 'Choose what to install' '$work/out' && grep -q 'cua CLI (required)' '$work/out' && grep -q 'Cua Spaces app' '$work/out' && grep -q 'cua-driver MCP and skill for your agents' '$work/out'"
+ check "checklist: says what Cua Spaces is and what is always installed" sh -c "grep -q 'Cua Spaces lets your AI agents use computers, and lets you watch them work.' '$work/out' && grep -q 'Needed, so always installed:' '$work/out' && grep -q 'Command-line tools: the \"cua\" program that the app and your AI agents use.' '$work/out' && grep -q 'Choose what else to add:' '$work/out'"
+ check "checklist: Cua Spaces app and Cua Driver rows, with a line on the highlighted one" sh -c "grep -q '> \\[x\\] Cua Spaces app: lets your AI agents use computers' '$work/out' && grep -q '\\[ \\] Cua Driver: lets AI agents use your apps while you keep working' '$work/out' && grep -q 'Open the app to sign in, connect your AI agents and watch them work.' '$work/out'"
+ check "checklist: no CLI row, no hosting row, short keyboard help" sh -c "! grep -q 'cua CLI (required)' '$work/out' && ! grep -qi 'host this machine' '$work/out' && grep -q 'Up/down to move, space to select, Enter to install' '$work/out'"
check "checklist: Enter accepts the defaults (CLI and the app)" sh -c "[ $status = 0 ] && [ -e '$work/t1/bin/cua' ] && [ ! -e '$work/t1/bin/cua-driver' ] && [ -x '$work/t1/bin/cua-spaces' ]"
- check "checklist: no per-item prompt afterwards" sh -c "! grep -q 'Install the cua CLI to' '$work/out'"
- tty_inst '3\r' --prefix "$work/t2"
+ check "checklist: no per-item prompt afterwards" sh -c "! grep -q 'Install the command-line tools to' '$work/out'"
+ tty_inst '2\r' --prefix "$work/t2"
check "checklist: number key toggles cua-driver on" sh -c "[ $status = 0 ] && [ -e '$work/t2/bin/cua-driver' ] && grep -q 'agents setup --cua-driver' '$home/cua.log'"
- tty_inst '\033[B\033[B\033[B \r' --prefix "$work/t3"
- check "checklist: arrows + space select host" sh -c "[ $status = 0 ] && grep -qx 'host setup' '$home/cua.log' && [ ! -e '$work/t3/bin/cua-driver' ]"
- tty_inst '1 \033[A\r' --prefix "$work/t4"
- check "checklist: the CLI row is locked" sh -c "[ $status = 0 ] && [ -e '$work/t4/bin/cua' ] && [ ! -e '$work/t4/bin/cua-driver' ]"
+ tty_inst '\033[B \r' --prefix "$work/t3"
+ check "checklist: arrow down + space select cua-driver" sh -c "[ $status = 0 ] && [ -e '$work/t3/bin/cua-driver' ] && ! grep -qx 'host setup' '$home/cua.log'"
+ tty_inst '1\r' --prefix "$work/t4"
+ check "checklist: 1 turns the app off; the CLI is always installed" sh -c "[ $status = 0 ] && [ -e '$work/t4/bin/cua' ] && [ ! -e '$work/t4/bin/cua-spaces' ] && [ ! -e '$work/t4/bin/cua-driver' ]"
+ tty_inst '3\r' --prefix "$work/t4b"
+ check "checklist: a number past the last row does nothing" sh -c "[ $status = 0 ] && [ -x '$work/t4b/bin/cua-spaces' ] && [ ! -e '$work/t4b/bin/cua-driver' ] && ! grep -qx 'host setup' '$home/cua.log'"
tty_inst '\r' --select cua-driver --prefix "$work/t5"
- check "checklist: --select cua-driver is preselected" sh -c "[ $status = 0 ] && [ -e '$work/t5/bin/cua-driver' ] && grep -q '\\[x\\] cua-driver' '$work/out'"
- tty_inst '3\r' --select cua-driver --prefix "$work/t6"
+ check "checklist: --select cua-driver is preselected" sh -c "[ $status = 0 ] && [ -e '$work/t5/bin/cua-driver' ] && grep -q '\\[x\\] Cua Driver' '$work/out'"
+ tty_inst '2\r' --select cua-driver --prefix "$work/t6"
check "checklist: a preselected item can be turned off" sh -c "[ $status = 0 ] && [ -e '$work/t6/bin/cua' ] && [ ! -e '$work/t6/bin/cua-driver' ]"
tty_inst '\r' --select spaces --prefix "$work/t7"
check "checklist: --select spaces on Linux: installed" sh -c "[ $status = 0 ] && grep -q 'Cua Spaces app' '$work/out' && [ -x '$work/t7/bin/cua-spaces' ] && [ -e '$work/t7/bin/cua' ]"
tty_inst '' --prefix "$work/t8"
check "checklist: no input (EOF) accepts defaults, no hang" sh -c "[ $status = 0 ] && [ -e '$work/t8/bin/cua' ]"
+ tty_inst '\r' --select host --prefix "$work/t8b"
+ check "checklist: --select host (a script flag) is not a row, but is said and honoured" sh -c "[ $status = 0 ] && grep -q 'Also: your other devices will be able to use this computer' '$work/out' && ! grep -qi 'host this machine' '$work/out' && grep -qx 'host setup' '$home/cua.log'"
tty_inst '\r' --yes --select host --prefix "$work/t9"
check "checklist: --yes skips it" sh -c "[ $status = 0 ] && ! grep -q 'Choose what to install' '$work/out' && grep -qx 'host setup' '$home/cua.log'"
tty_inst '\r' --only cua-driver --prefix "$work/t10"
check "checklist: --only skips it" sh -c "[ $status = 0 ] && ! grep -q 'Choose what to install' '$work/out' && [ -e '$work/t10/bin/cua-driver' ]"
tty_term=dumb
- tty_inst '4\n\n' --prefix "$work/t11"
+ tty_inst '2\n\n' --prefix "$work/t11"
tty_term=""
- check "checklist (TERM=dumb): numbered prompt toggles host" sh -c "[ $status = 0 ] && grep -q 'Toggle numbers' '$work/out' && grep -qx 'host setup' '$home/cua.log'"
- [ -n "${CUA_INSTALL_TRANSCRIPT:-}" ] && tty_inst '\033[B \033[B \033[B \r' --prefix "$work/t12" && cp "$work/out" "$CUA_INSTALL_TRANSCRIPT"
+ check "checklist (TERM=dumb): numbered prompt with a line per row toggles cua-driver" sh -c "[ $status = 0 ] && grep -q 'Type a number to switch an item on or off' '$work/out' && grep -q 'For advanced users. Adds it to Claude Code, Codex and other coding agents.' '$work/out' && [ -e '$work/t11/bin/cua-driver' ] && ! grep -qx 'host setup' '$home/cua.log'"
+ [ -n "${CUA_INSTALL_TRANSCRIPT:-}" ] && tty_inst '\033[B \r' --prefix "$work/t12" && cp "$work/out" "$CUA_INSTALL_TRANSCRIPT"
else
printf 'skip interactive checklist (needs bash and timeout)\n'
fi