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.

use host column in cli

Dillon DuPont791c4ddf85f5
diff --git a/libs/typescript/cua-cli/src/commands/vm.ts b/libs/typescript/cua-cli/src/commands/vm.ts
index 843a49dd3c..c9a4548bda 100644
--- a/libs/typescript/cua-cli/src/commands/vm.ts
+++ b/libs/typescript/cua-cli/src/commands/vm.ts
@@ -251,7 +251,9 @@ export function registerVmCommands(y: Argv) {
console.error('VM not found');
process.exit(1);
}
- const url = `https://${vm.name}.containers.cloud.trycua.com/vnc.html?autoconnect=true&password=${encodeURIComponent(vm.password)}`;
+ const host =
+ vm.host && vm.host.length ? vm.host : `${vm.name}.containers.cloud.trycua.com`;
+ const url = `https://${host}/vnc.html?autoconnect=true&password=${encodeURIComponent(vm.password)}`;
console.log(`Opening NoVNC: ${url}`);
await openInBrowser(url);
}
@@ -279,7 +281,8 @@ export function registerVmCommands(y: Argv) {
console.error('VM not found');
process.exit(1);
}
- const host = `${vm.name}.containers.cloud.trycua.com`;
+ 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}`);