@josancamon19/use-computer
v0.1.0
Published
TypeScript SDK for use.computer — rent dedicated VMs (macOS, iOS/visionOS/tvOS simulators, Windows, Ubuntu) built for computer-use agents.
Downloads
76
Maintainers
Readme
use-computer — TypeScript SDK
TypeScript/JavaScript client for use.computer — rent dedicated VMs (macOS, iOS/visionOS/tvOS simulators, Windows, Ubuntu) built for computer-use agents. Parity with the Python SDK; async-native.
npm install @josancamon19/use-computer
export USE_COMPUTER_API_KEY=mk_live_...import { Computer } from "@josancamon19/use-computer";
const computer = new Computer(); // baseUrl + apiKey from env, or pass {baseUrl, apiKey}
// macOS (default)
const mac = await computer.create({ type: "macos" });
await mac.execSsh("open -a TextEdit");
await mac.keyboard.type("hello");
const png = await mac.screenshot.takeFullScreen();
await mac.close();
// Windows (Beta) — no SSH; exec runs in-guest via PowerShell/cmd
const win = await computer.create({ type: "windows", version: "windows-11" });
try {
console.log((await win.run("$env:COMPUTERNAME")).stdout);
await win.mouse.click(400, 300);
await win.keyboard.type("hello from use.computer");
const tree = await win.uiTree(); // native Windows UIAutomation tree
} finally {
await win.close();
}
// iOS simulator
const ios = await computer.create({ type: "ios", family: "iphone" });
await ios.tap(120, 300);
// Ubuntu
const ubuntu = await computer.create({ type: "ubuntu", version: "ubuntu-24.04" });
try {
console.log((await ubuntu.run("uname -a")).stdout);
} finally {
await ubuntu.close();
}Surface
Computer.create({ type, version?, host?, family?, deviceType?, runtime?, resources? })→ typed sandbox. KVM CPU/RAM/diskresourcesselects the matching baked Windows/Ubuntu image profile.Computer.platforms()→ discover available platforms. Admin keys includewindows.imagesandubuntu.imageswith selectableversion,resources, anddisplaymetadata.- All sandboxes:
screenshot.takeFullScreen()/takeCompressed(),recording.start()/stop()/listAll()/download(),uiTree(),displayInfo(),upload(bytes, path),download(path),keepalive(),close(). - macOS / Windows / Ubuntu:
mouse.move/click/doubleClick/scroll/drag/position,keyboard.type/press/hotkey. - macOS:
execSsh(cmd). Windows:run(cmd, "powershell"|"cmd")(no SSH). Ubuntu:run(cmd, "bash"|"sh")(no SSH;execis an alias). - iOS:
tap,pressButton,pressRemote,launch(no axe-schemauiTree).
KVM Images
Use platforms() to list the currently deployed Windows/Ubuntu image options:
const platforms = await computer.platforms();
console.log(platforms.windows.images);
console.log(platforms.ubuntu.images);
const win = await computer.create({
type: "windows",
version: "windows-11",
resources: { cpus: 4, memory_mb: 4096, disk_gb: 40 },
});
await win.close();Current profiles include 4 CPU / 4 GB RAM / 80 GB disk, 4 CPU / 4 GB RAM /
40 GB disk, and 2 CPU / 4 GB RAM / 40 GB disk for both Windows 11 and Ubuntu
24.04. Explicit image IDs such as windows-11-4c4g40g still work, but new code
should prefer version: "windows-11" plus resources.
Docs: docs.use.computer. Windows and Ubuntu are Beta (admin-only).
