mirror of
https://github.com/trycua/computer.git
synced 2025-12-31 10:29:59 -06:00
cua-cloud-openai Example
This example demonstrates how to control a Cua Cloud Sandbox using the OpenAI computer-use-preview model and the @trycua/computer TypeScript library.
Overview
- Connects to a Cua Cloud Sandbox via the
@trycua/computerlibrary - Sends screenshots and instructions to OpenAI's computer-use model
- Executes AI-generated actions (clicks, typing, etc.) inside the sandbox
- Designed for Linux sandboxes, but can be adapted for other OS types
Getting Started
-
Install dependencies:
npm install -
Set up environment variables: Create a
.envfile with the following variables:OPENAI_API_KEY— your OpenAI API keyCUA_API_KEY— your Cua Cloud API keyCUA_CONTAINER_NAME— the name of your provisioned sandbox
-
Run the example:
npx tsx src/index.ts
Files
src/index.ts— Main example scriptsrc/helpers.ts— Helper for executing actions on the container
If you have questions or issues, please open an issue or contact the maintainers.