Revamp docs

This commit is contained in:
f-trycua
2025-11-10 17:42:34 +01:00
parent 4954397f0b
commit ae163fc665
18 changed files with 2500 additions and 4036 deletions

View File

@@ -0,0 +1,62 @@
---
title: Introduction
---
import { Monitor, Code, BookOpen, Zap, Bot, Boxes, Rocket } from 'lucide-react';
<Hero>
Cua is an open-source framework for building **Computer-Use Agents** - AI systems that see, understand, and interact with desktop applications through vision and action, just like humans do.
Go from prototype to production with everything you need: multi-provider LLM support, cross-platform sandboxes, and trajectory tracing. Whether you're running locally or deploying to the cloud, Cua gives you the tools to build reliable computer-use agents.
</Hero>
## Why Cua?
Cua gives you everything you need to automate any desktop application without brittle selectors or APIs.
Some highlights include:
- **Model flexibility** - Connect to 100+ LLM providers through liteLLM's standard interface. Use models from Anthropic, OpenAI, Google, and more - or run them locally with Ollama, Hugging Face, or MLX.
- **Composed agents** - Mix and match grounding models with planning models for optimal performance. Use specialized models like GTA, OpenCUA, or OmniParser for UI element detection paired with powerful reasoning models like Claude or GPT-4.
- **Cross-platform sandboxes** - Run agents safely in isolated environments. Choose from Docker containers, macOS VMs with Lume, Windows Sandbox, or deploy to Cua Cloud with production-ready infrastructure.
- **Computer SDK** - Control any application with a PyAutoGUI-like API. Click, type, scroll, take screenshots, manage windows, read/write files - everything you need for desktop automation.
- **Agent SDK** - Build autonomous agents with trajectory tracing, prompt caching, cost tracking, and budget controls. Test agents on industry-standard benchmarks like OSWorld-Verified with one line of code.
- **Human-in-the-loop** - Pause agent execution and await user input or approval before continuing. Use the `human/human` model string to let humans control the agent directly.
- **Production essentials** - Ship reliable agents with built-in PII anonymization, cost tracking, trajectory logging, and integration with observability platforms like Laminar and HUD.
## What can you build?
- RPA automation that works with any application - even legacy software without APIs.
- Form-filling agents that handle complex multi-step web workflows.
- Testing automation that adapts to UI changes without brittle selectors.
- Data extraction from desktop applications and document processing.
- Cross-application workflows that combine multiple tools and services.
- Research agents that browse, read, and synthesize information from the web.
Explore real-world examples in our [blog posts](https://cua.ai/blog).
## Get started
Follow the [Quickstart guide](/quickstart-devs) for step-by-step setup with Python or TypeScript.
If you're new to computer-use agents, check out our [tutorials](https://cua.ai/blog), [examples](https://github.com/trycua/cua/tree/main/examples), and [notebooks](https://github.com/trycua/cua/tree/main/notebooks) to start building with Cua today.
<div className="grid grid-cols-1 md:grid-cols-2 gap-6 mt-8">
<Card icon={<Rocket />} href="/quickstart-devs" title="Quickstart">
Get up and running in 3 steps with Python or TypeScript.
</Card>
<Card icon={<BookOpen />} href="/agent-sdk/agent-loops" title="Learn Core Concepts">
Understand agent loops, callbacks, and model composition.
</Card>
<Card icon={<Code />} href="/libraries/agent" title="API Reference">
Explore the full Agent SDK and Computer SDK APIs.
</Card>
<Card icon={<Monitor />} href="/example-usecases/form-filling" title="Example Use Cases">
See Cua in action with real-world examples.
</Card>
</div>
We can't wait to see what you build with Cua ✨

View File

@@ -0,0 +1,7 @@
{
"title": "Get Started",
"description": "Get started with Cua",
"defaultOpen": true,
"icon": "Rocket",
"pages": ["introduction", "quickstart", "telemetry"]
}

View File

@@ -1,17 +1,25 @@
---
title: Quickstart
description: Get started with Cua in three steps
icon: Rocket
description: Get started with Cua
---
import { Step, Steps } from 'fumadocs-ui/components/steps';
import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';
import { Code, Terminal } from 'lucide-react';
This quickstart guides you through setting up your [computer environment](#set-up-your-computer-environment), programmatic control with a [Cua computer](#using-computer), and task automation with a [Cua agent](#using-agent):
Choose your quickstart path:
<Steps>
<div className="grid grid-cols-1 md:grid-cols-2 gap-6 mt-8 mb-8">
<Card icon={<Code />} href="#developer-quickstart" title="Developer Quickstart">
Build with Python or TypeScript SDKs - full programmatic control
</Card>
<Card icon={<Terminal />} href="#cli-quickstart" title="CLI Quickstart">
Get started quickly with the command-line interface
</Card>
</div>
<Step>
---
## Set Up Your Computer Environment
@@ -19,22 +27,39 @@ Choose how you want to run your Cua computer. This will be the environment where
You can run your Cua computer in the cloud (recommended for easiest setup), locally on macOS with Lume, locally on Windows with a Windows Sandbox, or in a Docker container on any platform. Choose the option that matches your system and needs.
<Tabs items={['☁️ Cloud', '🐳 Docker', '🍎 Lume', '🪟 Windows Sandbox']}>
<Tab value="☁️ Cloud">
<Tabs items={['Cloud Sandbox', 'Linux on Docker', 'macOS VM', 'Windows Sandbox']}>
<Tab value="Cloud Sandbox">
Cua Cloud Sandbox provides virtual machines that run Ubuntu.
Cua Cloud Sandbox provides virtual machines that run Linux (Ubuntu) or Windows.
1. Go to [cua.ai/signin](https://cua.ai/signin)
2. Navigate to **Dashboard > Containers > Create Instance**
3. Create a **Medium, Ubuntu 22** sandbox
3. Create a **Small** sandbox, choosing either **Linux** or **Windows**
4. Note your sandbox name and API key
Your Cloud Sandbox will be automatically configured and ready to use.
</Tab>
<Tab value="🍎 Lume">
<Tab value="Linux on Docker">
Lume containers are macOS virtual machines that run on a macOS host machine.
Run Linux desktop locally on macOS, Windows, or Linux hosts.
1. Install Docker Desktop or Docker Engine
2. Pull a CUA Docker image:
```bash
# XFCE (Lightweight) - recommended for most use cases
docker pull --platform=linux/amd64 trycua/cua-xfce:latest
# OR KASM (Full-Featured) - full Ubuntu desktop
docker pull --platform=linux/amd64 trycua/cua-ubuntu:latest
```
</Tab>
<Tab value="macOS VM">
macOS hosts only - requires Lume CLI.
1. Install the Lume CLI:
@@ -49,11 +74,11 @@ You can run your Cua computer in the cloud (recommended for easiest setup), loca
```
</Tab>
<Tab value="🪟 Windows Sandbox">
<Tab value="Windows Sandbox">
Windows Sandbox provides Windows virtual environments that run on a Windows host machine.
Windows hosts only - requires Windows 10 Pro/Enterprise or Windows 11.
1. Enable [Windows Sandbox](https://learn.microsoft.com/en-us/windows/security/application-security/application-isolation/windows-sandbox/windows-sandbox-install) (requires Windows 10 Pro/Enterprise or Windows 11)
1. Enable [Windows Sandbox](https://learn.microsoft.com/en-us/windows/security/application-security/application-isolation/windows-sandbox/windows-sandbox-install)
2. Install the `pywinsandbox` dependency:
```bash
@@ -63,26 +88,17 @@ Windows Sandbox provides Windows virtual environments that run on a Windows host
3. Windows Sandbox will be automatically configured when you run the CLI
</Tab>
<Tab value="🐳 Docker">
Docker provides a way to run Ubuntu containers on any host machine.
1. Install Docker Desktop or Docker Engine:
2. Pull the CUA Ubuntu sandbox:
```bash
docker pull --platform=linux/amd64 trycua/cua-ubuntu:latest
```
</Tab>
</Tabs>
</Step>
---
## Developer Quickstart
<Steps>
<Step>
## Using Computer
### Using Computer
Connect to your Cua computer and perform basic interactions, such as taking screenshots or simulating user input.
@@ -95,8 +111,8 @@ Connect to your Cua computer and perform basic interactions, such as taking scre
Then, connect to your desired computer environment:
<Tabs items={['☁️ Cloud', '🐳 Docker', '🍎 Lume', '🪟 Windows Sandbox', '🖥️ Host Desktop']}>
<Tab value="☁️ Cloud">
<Tabs items={['Cloud Sandbox', 'Linux on Docker', 'macOS VM', 'Windows Sandbox', 'Your host desktop']}>
<Tab value="Cloud Sandbox">
```python
from computer import Computer
@@ -109,7 +125,19 @@ Connect to your Cua computer and perform basic interactions, such as taking scre
await computer.run() # Connect to the sandbox
```
</Tab>
<Tab value="🍎 Lume">
<Tab value="Linux on Docker">
```python
from computer import Computer
computer = Computer(
os_type="linux",
provider_type="docker",
image="trycua/cua-xfce:latest" # or "trycua/cua-ubuntu:latest"
)
await computer.run() # Launch & connect to the container
```
</Tab>
<Tab value="macOS VM">
```python
from computer import Computer
@@ -121,7 +149,7 @@ Connect to your Cua computer and perform basic interactions, such as taking scre
await computer.run() # Launch & connect to the container
```
</Tab>
<Tab value="🪟 Windows Sandbox">
<Tab value="Windows Sandbox">
```python
from computer import Computer
@@ -132,19 +160,7 @@ Connect to your Cua computer and perform basic interactions, such as taking scre
await computer.run() # Launch & connect to the container
```
</Tab>
<Tab value="🐳 Docker">
```python
from computer import Computer
computer = Computer(
os_type="linux",
provider_type="docker",
name="trycua/cua-ubuntu:latest"
)
await computer.run() # Launch & connect to the container
```
</Tab>
<Tab value="🖥️ Host Desktop">
<Tab value="Your host desktop">
Install and run `cua-computer-server`:
```bash
pip install cua-computer-server
@@ -183,8 +199,8 @@ Connect to your Cua computer and perform basic interactions, such as taking scre
Then, connect to your desired computer environment:
<Tabs items={['☁️ Cloud','🐳 Docker', '🍎 Lume', '🪟 Windows Sandbox', '🖥️ Host Desktop']}>
<Tab value="☁️ Cloud">
<Tabs items={['Cloud Sandbox', 'Linux on Docker', 'macOS VM', 'Windows Sandbox', 'Your host desktop']}>
<Tab value="Cloud Sandbox">
```typescript
import { Computer, OSType } from '@trycua/computer';
@@ -196,7 +212,19 @@ Connect to your Cua computer and perform basic interactions, such as taking scre
await computer.run(); // Connect to the sandbox
```
</Tab>
<Tab value="🍎 Lume">
<Tab value="Linux on Docker">
```typescript
import { Computer, OSType, ProviderType } from '@trycua/computer';
const computer = new Computer({
osType: OSType.LINUX,
providerType: ProviderType.DOCKER,
image: "trycua/cua-xfce:latest" // or "trycua/cua-ubuntu:latest"
});
await computer.run(); // Launch & connect to the container
```
</Tab>
<Tab value="macOS VM">
```typescript
import { Computer, OSType, ProviderType } from '@trycua/computer';
@@ -208,7 +236,7 @@ Connect to your Cua computer and perform basic interactions, such as taking scre
await computer.run(); // Launch & connect to the container
```
</Tab>
<Tab value="🪟 Windows Sandbox">
<Tab value="Windows Sandbox">
```typescript
import { Computer, OSType, ProviderType } from '@trycua/computer';
@@ -219,19 +247,7 @@ Connect to your Cua computer and perform basic interactions, such as taking scre
await computer.run(); // Launch & connect to the container
```
</Tab>
<Tab value="🐳 Docker">
```typescript
import { Computer, OSType, ProviderType } from '@trycua/computer';
const computer = new Computer({
osType: OSType.LINUX,
providerType: ProviderType.DOCKER,
name: "trycua/cua-ubuntu:latest"
});
await computer.run(); // Launch & connect to the container
```
</Tab>
<Tab value="🖥️ Host Desktop">
<Tab value="Your host desktop">
First, install and run `cua-computer-server`:
```bash
pip install cua-computer-server
@@ -271,7 +287,7 @@ Learn more about computers in the [Cua computers documentation](/computer-sdk/co
<Step>
## Using Agent
### Using Agent
Utilize an Agent to automate complex tasks by providing it with a goal and allowing it to interact with the computer environment.
@@ -305,9 +321,264 @@ Learn more about agents in [Agent Loops](/agent-sdk/agent-loops) and available m
</Step>
</Steps>
## Next Steps
### Next Steps
- Learn more about [Cua computers](/computer-sdk/computers) and [computer commands](/computer-sdk/commands)
- Read about [Agent loops](/agent-sdk/agent-loops), [tools](/agent-sdk/custom-tools), and [supported model providers](/agent-sdk/supported-model-providers/)
- Join our [Discord community](https://discord.com/invite/mVnXXpdE85) for help
- Try out [Form Filling](/example-usecases/form-filling) preset usecase
---
## CLI Quickstart
<Steps>
<Step>
### Install Cua
<Accordions type="single" defaultValue="uv">
<Accordion title="uv (Recommended)" value="uv">
#### Install uv
<Tabs items={['macOS / Linux', 'Windows']} persist>
<Tab value="macOS / Linux">
```bash
# Use curl to download the script and execute it with sh:
curl -LsSf https://astral.sh/uv/install.sh | sh
# If your system doesn't have curl, you can use wget:
# wget -qO- https://astral.sh/uv/install.sh | sh
```
</Tab>
<Tab value="Windows">
```powershell
# Use irm to download the script and execute it with iex:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```
</Tab>
</Tabs>
#### Install Python 3.12
```bash
uv python install 3.12
# uv will install Cua dependencies automatically when you use --with "cua-agent[cli]"
```
</Accordion>
<Accordion title="conda" value="conda">
#### Install conda
<Tabs items={['macOS', 'Linux', 'Windows']} persist>
<Tab value="macOS">
```bash
mkdir -p ~/miniconda3
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm ~/miniconda3/miniconda.sh
source ~/miniconda3/bin/activate
```
</Tab>
<Tab value="Linux">
```bash
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm ~/miniconda3/miniconda.sh
source ~/miniconda3/bin/activate
```
</Tab>
<Tab value="Windows">
```powershell
wget "https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe" -outfile ".\miniconda.exe"
Start-Process -FilePath ".\miniconda.exe" -ArgumentList "/S" -Wait
del .\miniconda.exe
```
</Tab>
</Tabs>
#### Create and activate Python 3.12 environment
```bash
conda create -n cua python=3.12
conda activate cua
```
#### Install Cua
```bash
pip install "cua-agent[cli]" cua-computer
```
</Accordion>
<Accordion title="pip" value="pip">
#### Install Cua
```bash
pip install "cua-agent[cli]" cua-computer
```
</Accordion>
</Accordions>
</Step>
<Step>
### Run Cua CLI
Choose your preferred AI model:
#### OpenAI Computer Use Preview
<Tabs items={['uv', 'conda/pip']} persist>
<Tab value="uv">
```bash
uv run --with "cua-agent[cli]" -m agent.cli openai/computer-use-preview
```
</Tab>
<Tab value="conda/pip">
```bash
python -m agent.cli openai/computer-use-preview
```
</Tab>
</Tabs>
#### Anthropic Claude
<Tabs items={['uv', 'conda/pip']} persist>
<Tab value="uv">
```bash
uv run --with "cua-agent[cli]" -m agent.cli anthropic/claude-sonnet-4-5-20250929
uv run --with "cua-agent[cli]" -m agent.cli anthropic/claude-opus-4-20250514
uv run --with "cua-agent[cli]" -m agent.cli anthropic/claude-opus-4-1-20250805
uv run --with "cua-agent[cli]" -m agent.cli anthropic/claude-sonnet-4-20250514
uv run --with "cua-agent[cli]" -m agent.cli anthropic/claude-3-5-sonnet-20241022
```
</Tab>
<Tab value="conda/pip">
```bash
python -m agent.cli anthropic/claude-sonnet-4-5-20250929
python -m agent.cli anthropic/claude-opus-4-1-20250805
python -m agent.cli anthropic/claude-opus-4-20250514
python -m agent.cli anthropic/claude-sonnet-4-20250514
python -m agent.cli anthropic/claude-3-5-sonnet-20241022
```
</Tab>
</Tabs>
#### Omniparser + LLMs
<Tabs items={['uv', 'conda/pip']} persist>
<Tab value="uv">
```bash
uv run --with "cua-agent[cli]" -m agent.cli omniparser+anthropic/claude-3-5-sonnet-20241022
uv run --with "cua-agent[cli]" -m agent.cli omniparser+openai/gpt-4o
uv run --with "cua-agent[cli]" -m agent.cli omniparser+vertex_ai/gemini-pro
```
</Tab>
<Tab value="conda/pip">
```bash
python -m agent.cli omniparser+anthropic/claude-3-5-sonnet-20241022
python -m agent.cli omniparser+openai/gpt-4o
python -m agent.cli omniparser+vertex_ai/gemini-pro
```
</Tab>
</Tabs>
#### Local Models
<Tabs items={['uv', 'conda/pip']} persist>
<Tab value="uv">
```bash
# Hugging Face models (local)
uv run --with "cua-agent[cli]" -m agent.cli huggingface-local/ByteDance-Seed/UI-TARS-1.5-7B
# MLX models (Apple Silicon)
uv run --with "cua-agent[cli]" -m agent.cli mlx/mlx-community/UI-TARS-1.5-7B-6bit
# Ollama models
uv run --with "cua-agent[cli]" -m agent.cli omniparser+ollama_chat/llama3.2:latest
```
</Tab>
<Tab value="conda/pip">
```bash
# Hugging Face models (local)
python -m agent.cli huggingface-local/ByteDance-Seed/UI-TARS-1.5-7B
# MLX models (Apple Silicon)
python -m agent.cli mlx/mlx-community/UI-TARS-1.5-7B-6bit
# Ollama models
python -m agent.cli omniparser+ollama_chat/llama3.2:latest
```
</Tab>
</Tabs>
#### Interactive Setup
If you haven't set up environment variables, the CLI will guide you through the setup:
1. **Sandbox Name**: Enter your Cua sandbox name (or get one at [cua.ai](https://cua.ai/))
2. **CUA API Key**: Enter your Cua API key
3. **Provider API Key**: Enter your AI provider API key (OpenAI, Anthropic, etc.)
#### Start Chatting
Once connected, you'll see:
```
💻 Connected to your-container-name (model, agent_loop)
Type 'exit' to quit.
>
```
You can ask your agent to perform actions like:
- "Take a screenshot and tell me what's on the screen"
- "Open Firefox and go to github.com"
- "Type 'Hello world' into the terminal"
- "Close the current window"
- "Click on the search button"
</Step>
</Steps>
---
For running models locally, see [Running Models Locally](/agent-sdk/supported-model-providers/local-models).

View File

@@ -1,135 +1,103 @@
---
title: Telemetry
description: This document explains how telemetry works in CUA libraries and how you can control it.
icon: RadioTower
description: How telemetry works in Cua and how to control it
---
# Telemetry in CUA
# Telemetry
CUA tracks anonymized usage and error report statistics; we ascribe to Posthog's approach as detailed [here](https://posthog.com/blog/open-source-telemetry-ethical). If you would like to opt out of sending anonymized info, you can set `telemetry_enabled` to false.
Cua collects anonymized usage and error statistics. We follow [Posthog's ethical telemetry approach](https://posthog.com/blog/open-source-telemetry-ethical). To opt out, set `telemetry_enabled` to false.
## What telemetry data we collect
## What we collect
CUA libraries collect usage data to help improve our software. We have two categories of telemetry:
### Enabled by default (opt-out)
### Opt-Out Telemetry (Enabled by Default)
- System info: OS, OS version, Python version
- Module initialization: When modules are imported and their versions
- Performance: Agent run durations, step counts, token usage, API costs
- Session tracking: Anonymous session IDs and run IDs
Basic performance metrics and system information that help us understand usage patterns:
- **System Information**: Operating system, OS version, Python version
- **Module Initialization**: When modules are imported and their versions
- **Performance Metrics**: Agent run durations, step counts, token usage, and API costs
- **Session Tracking**: Anonymous session IDs and run IDs for performance analysis
### Opt-In Telemetry (Disabled by Default)
**Conversation Trajectory Logging**: Full conversation history including:
### Disabled by default (opt-in)
**Trajectory logging** captures full conversation history:
- User messages and agent responses
- Computer actions and their outputs
- Reasoning traces from the agent
- Computer actions and outputs
- Agent reasoning traces
**Important**: Trajectory logging is **opt-in only** and must be explicitly enabled.
Must be explicitly enabled.
### We do NOT collect:
### We don't collect
- Personal information or user identifiers
- API keys or credentials
- File contents or application data
- Information about files being accessed
- Actual screenshots or screen contents (unless trajectory logging is enabled)
- Specific text being typed, including user inputs, model outputs, computer outputs, or tool call outputs (unless trajectory logging is enabled)
- Files being accessed
- Screenshots or screen contents (unless trajectory logging is enabled)
- Text being typed, user inputs, model outputs, computer outputs, or tool call outputs (unless trajectory logging is enabled)
## Controlling Telemetry
## How to disable
We are committed to transparency and user control over telemetry. There are two ways to control telemetry:
### Environment variable (global)
### 1. Environment Variable (Global Control)
Telemetry is enabled by default. To disable telemetry, set the `CUA_TELEMETRY_ENABLED` environment variable to a falsy value (`0`, `false`, `no`, or `off`):
Set `CUA_TELEMETRY_ENABLED` to a falsy value (`0`, `false`, `no`, or `off`):
```bash
# Disable telemetry before running your script
export CUA_TELEMETRY_ENABLED=false
# Or as part of the command
CUA_TELEMETRY_ENABLED=1 python your_script.py
```
Or from Python:
Or in Python:
```python
import os
os.environ["CUA_TELEMETRY_ENABLED"] = "false"
```
### 2. Instance-Level Control
### Per instance
#### Computer SDK
**Computer SDK:**
```python
from computer import Computer
# Enable telemetry (default)
computer = Computer(telemetry_enabled=True)
# Disable telemetry
computer = Computer(telemetry_enabled=False)
```
#### Agent SDK
**Agent SDK:**
```python
from agent import ComputerAgent
import os
# Basic telemetry - performance metrics only (opt-out, enabled by default)
agent = ComputerAgent(
model="claude-3-5-sonnet-20241022",
telemetry_enabled=True # Default is True
)
# Enable telemetry with full conversation trajectory logging (opt-in)
agent = ComputerAgent(
model="claude-3-5-sonnet-20241022",
telemetry_enabled={
"log_trajectory": True # Logs full conversation items
}
)
# Disable telemetry completely
# Disable completely
agent = ComputerAgent(
model="claude-3-5-sonnet-20241022",
telemetry_enabled=False
)
# Disable telemetry completely using environment variables
os.environ["CUA_TELEMETRY_ENABLED"] = "false"
# Enable trajectory logging (opt-in)
agent = ComputerAgent(
model="claude-3-5-sonnet-20241022"
model="claude-3-5-sonnet-20241022",
telemetry_enabled={"log_trajectory": True}
)
```
You can check if telemetry is enabled for an instance:
Check status:
```python
print(computer.telemetry_enabled) # Will print True or False
print(agent.telemetry_enabled) # Will print True, False, or dict
print(computer.telemetry_enabled) # True or False
print(agent.telemetry_enabled) # True, False, or dict
```
Note that telemetry settings must be configured during initialization and cannot be changed after the object is created.
Telemetry settings are configured at initialization and can't be changed afterward.
## Detailed Telemetry Events
## Events collected
### Computer SDK Events
### Computer SDK
| Event Name | Data Collected | Trigger Notes |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| **computer_initialized** | • `os`: Operating system (e.g., 'windows', 'darwin', 'linux')<br />• `os_version`: OS version<br />• `python_version`: Python version | Triggered when a Computer instance is created |
| **module_init** | • `module`: "computer"<br />• `version`: Package version<br />• `python_version`: Full Python version string | Triggered once when the computer package is imported for the first time |
### Agent SDK Events
### Agent SDK
| Event Name | Data Collected | Trigger Notes |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
@@ -140,6 +108,6 @@ Note that telemetry settings must be configured during initialization and cannot
| **agent_step** | • `session_id`: Agent session UUID<br />• `run_id`: Run UUID<br />• `step`: Step number (incremental)<br />• `timestamp`: Unix timestamp<br />• `duration_seconds`: Duration of previous step | Triggered on each agent response/step during a run |
| **agent_usage** | • `session_id`: Agent session UUID<br />• `run_id`: Run UUID<br />• `step`: Current step number<br />• `prompt_tokens`: Tokens in prompt<br />• `completion_tokens`: Tokens in response<br />• `total_tokens`: Total tokens used<br />• `response_cost`: Cost of this API call | Triggered whenever usage information is received from LLM API |
## Transparency
## Questions
We believe in being transparent about the data we collect. If you have any questions about our telemetry practices, please open an issue on our GitHub repository.
Questions about telemetry? Open an issue on our [GitHub repository](https://github.com/trycua/cua).

View File

@@ -1,25 +0,0 @@
---
title: Home
icon: House
---
import { Monitor, Code, BookOpen } from 'lucide-react';
# Welcome!
Cua is a framework for automating Windows, Mac, and Linux apps powered by computer-using agents (CUAs).
Cua makes every stage of computer-using agent development simple:
- **Development**: Use any LLM provider with liteLLM. The agent SDK makes multiple agent loop providers, trajectory tracing, caching, and budget management easy
- **Containerization**: Cua offers Docker containers pre-installed with everything needed for AI-powered RPA
- **Deployment**: Cua cloud gives you a production-ready cloud environment for your assistants
<div className="grid grid-cols-1 md:grid-cols-2 gap-6 mt-8">
<Card icon={<Monitor />} href="/quickstart-devs" title="Quickstart (Developers)">
Build with Python—full SDK and agent code examples.
</Card>
<Card icon={<BookOpen />} href="/libraries/agent" title="API Reference">
Explore the agent SDK and APIs
</Card>
</div>

View File

@@ -4,10 +4,8 @@
"root": true,
"defaultOpen": true,
"pages": [
"index",
"quickstart-devs",
"quickstart-cli",
"telemetry",
"---[Rocket]Get Started---",
"...get-started",
"---[ChefHat]Cookbook---",
"...example-usecases",
"---[BookCopy]Computer Playbook---",

View File

@@ -1,343 +0,0 @@
---
title: Quickstart (CLI)
description: Get started with the Cua Agent CLI in 4 steps
icon: Rocket
---
import { Step, Steps } from 'fumadocs-ui/components/steps';
import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';
Get up and running with the Cua Agent CLI in 4 simple steps.
<Steps>
<Step>
## Introduction
Cua combines Computer (interface) + Agent (AI) for automating desktop apps. The Agent CLI provides a clean terminal interface to control your remote computer using natural language commands.
</Step>
<Step>
## Set Up Your Computer Environment
Choose how you want to run your Cua computer. **Cloud Sandbox is recommended** for the easiest setup:
<Tabs items={['☁️ Cloud Sandbox (Recommended)', 'Linux on Docker', 'Windows Sandbox', 'macOS VM']}>
<Tab value="☁️ Cloud Sandbox (Recommended)">
**Easiest & safest way to get started - works on any host OS**
1. Go to [cua.ai/signin](https://cua.ai/signin)
2. Navigate to **Dashboard > Containers > Create Instance**
3. Create a **Medium, Ubuntu 22** container
4. Note your container name and API key
Your cloud container will be automatically configured and ready to use.
</Tab>
<Tab value="Linux on Docker">
**Run Linux desktop locally on macOS, Windows, or Linux hosts**
1. Install Docker Desktop or Docker Engine
2. Pull the CUA XFCE container (lightweight desktop)
```bash
docker pull --platform=linux/amd64 trycua/cua-xfce:latest
```
Or use KASM for a full-featured desktop:
```bash
docker pull --platform=linux/amd64 trycua/cua-ubuntu:latest
```
</Tab>
<Tab value="Windows Sandbox">
**Windows hosts only - requires Windows 10 Pro/Enterprise or Windows 11**
1. Enable Windows Sandbox
2. Install pywinsandbox dependency
```bash
pip install -U git+git://github.com/karkason/pywinsandbox.git
```
3. Windows Sandbox will be automatically configured when you run the CLI
</Tab>
<Tab value="macOS VM">
**macOS hosts only - requires Lume CLI**
1. Install lume cli
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh)"
```
2. Start a local Cua macOS VM
```bash
lume run macos-sequoia-cua:latest
```
</Tab>
</Tabs>
</Step>
<Step>
## Install Cua
<Accordions type="single" defaultValue="uv">
<Accordion title="uv (Recommended)" value="uv">
### Install uv
<Tabs items={['macOS / Linux', 'Windows']} persist>
<Tab value="macOS / Linux">
```bash
# Use curl to download the script and execute it with sh:
curl -LsSf https://astral.sh/uv/install.sh | sh
# If your system doesn't have curl, you can use wget:
# wget -qO- https://astral.sh/uv/install.sh | sh
```
</Tab>
<Tab value="Windows">
```powershell
# Use irm to download the script and execute it with iex:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```
</Tab>
</Tabs>
### Install Python 3.12
```bash
uv python install 3.12
# uv will install Cua dependencies automatically when you use --with "cua-agent[cli]"
```
</Accordion>
<Accordion title="conda" value="conda">
### Install conda
<Tabs items={['macOS', 'Linux', 'Windows']} persist>
<Tab value="macOS">
```bash
mkdir -p ~/miniconda3
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm ~/miniconda3/miniconda.sh
source ~/miniconda3/bin/activate
```
</Tab>
<Tab value="Linux">
```bash
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm ~/miniconda3/miniconda.sh
source ~/miniconda3/bin/activate
```
</Tab>
<Tab value="Windows">
```powershell
wget "https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe" -outfile ".\miniconda.exe"
Start-Process -FilePath ".\miniconda.exe" -ArgumentList "/S" -Wait
del .\miniconda.exe
```
</Tab>
</Tabs>
### Create and activate Python 3.12 environment
```bash
conda create -n cua python=3.12
conda activate cua
```
### Install Cua
```bash
pip install "cua-agent[cli]" cua-computer
```
</Accordion>
<Accordion title="pip" value="pip">
### Install Cua
```bash
pip install "cua-agent[cli]" cua-computer
```
</Accordion>
</Accordions>
</Step>
<Step>
## Run Cua CLI
Choose your preferred AI model:
### OpenAI Computer Use Preview
<Tabs items={['uv', 'conda/pip']} persist>
<Tab value="uv">
```bash
uv run --with "cua-agent[cli]" -m agent.cli openai/computer-use-preview
```
</Tab>
<Tab value="conda/pip">
```bash
python -m agent.cli openai/computer-use-preview
```
</Tab>
</Tabs>
### Anthropic Claude
<Tabs items={['uv', 'conda/pip']} persist>
<Tab value="uv">
```bash
uv run --with "cua-agent[cli]" -m agent.cli anthropic/claude-sonnet-4-5-20250929
uv run --with "cua-agent[cli]" -m agent.cli anthropic/claude-opus-4-20250514
uv run --with "cua-agent[cli]" -m agent.cli anthropic/claude-opus-4-1-20250805
uv run --with "cua-agent[cli]" -m agent.cli anthropic/claude-sonnet-4-20250514
uv run --with "cua-agent[cli]" -m agent.cli anthropic/claude-3-5-sonnet-20241022
```
</Tab>
<Tab value="conda/pip">
```bash
python -m agent.cli anthropic/claude-sonnet-4-5-20250929
python -m agent.cli anthropic/claude-opus-4-1-20250805
python -m agent.cli anthropic/claude-opus-4-20250514
python -m agent.cli anthropic/claude-sonnet-4-20250514
python -m agent.cli anthropic/claude-3-5-sonnet-20241022
```
</Tab>
</Tabs>
### Omniparser + LLMs
<Tabs items={['uv', 'conda/pip']} persist>
<Tab value="uv">
```bash
uv run --with "cua-agent[cli]" -m agent.cli omniparser+anthropic/claude-3-5-sonnet-20241022
uv run --with "cua-agent[cli]" -m agent.cli omniparser+openai/gpt-4o
uv run --with "cua-agent[cli]" -m agent.cli omniparser+vertex_ai/gemini-pro
```
</Tab>
<Tab value="conda/pip">
```bash
python -m agent.cli omniparser+anthropic/claude-3-5-sonnet-20241022
python -m agent.cli omniparser+openai/gpt-4o
python -m agent.cli omniparser+vertex_ai/gemini-pro
```
</Tab>
</Tabs>
### Local Models
<Tabs items={['uv', 'conda/pip']} persist>
<Tab value="uv">
```bash
# Hugging Face models (local)
uv run --with "cua-agent[cli]" -m agent.cli huggingface-local/ByteDance-Seed/UI-TARS-1.5-7B
# MLX models (Apple Silicon)
uv run --with "cua-agent[cli]" -m agent.cli mlx/mlx-community/UI-TARS-1.5-7B-6bit
# Ollama models
uv run --with "cua-agent[cli]" -m agent.cli omniparser+ollama_chat/llama3.2:latest
```
</Tab>
<Tab value="conda/pip">
```bash
# Hugging Face models (local)
python -m agent.cli huggingface-local/ByteDance-Seed/UI-TARS-1.5-7B
# MLX models (Apple Silicon)
python -m agent.cli mlx/mlx-community/UI-TARS-1.5-7B-6bit
# Ollama models
python -m agent.cli omniparser+ollama_chat/llama3.2:latest
```
</Tab>
</Tabs>
### Interactive Setup
If you haven't set up environment variables, the CLI will guide you through the setup:
1. **Sandbox Name**: Enter your Cua sandbox name (or get one at [cua.ai](https://cua.ai/))
2. **CUA API Key**: Enter your Cua API key
3. **Provider API Key**: Enter your AI provider API key (OpenAI, Anthropic, etc.)
### Start Chatting
Once connected, you'll see:
```
💻 Connected to your-container-name (model, agent_loop)
Type 'exit' to quit.
>
```
You can ask your agent to perform actions like:
- "Take a screenshot and tell me what's on the screen"
- "Open Firefox and go to github.com"
- "Type 'Hello world' into the terminal"
- "Close the current window"
- "Click on the search button"
</Step>
</Steps>
---
For running models locally, see [Running Models Locally](/agent-sdk/supported-model-providers/local-models).

View File

@@ -9,22 +9,22 @@
"postinstall": "fumadocs-mdx"
},
"dependencies": {
"fumadocs-core": "15.5.1",
"fumadocs-mdx": "11.6.7",
"fumadocs-ui": "15.5.1",
"fumadocs-core": "16.0.8",
"fumadocs-mdx": "13.0.5",
"fumadocs-ui": "16.0.8",
"lucide-react": "^0.525.0",
"mermaid": "^11.8.1",
"next": "15.3.3",
"next": "16.0.1",
"next-themes": "^0.4.6",
"posthog-js": "^1.276.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"react-icons": "^5.5.0",
"remark": "^15.0.1",
"remark-gfm": "^4.0.1",
"remark-mdx": "^3.1.0",
"tailwind-merge": "^3.3.1",
"zod": "^3.25.76"
"zod": "^4.1.12"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.1.8",

5444
docs/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -5,14 +5,7 @@ import { z } from 'zod';
// see https://fumadocs.vercel.app/docs/mdx/collections#define-docs
export const docs = defineDocs({
docs: {
schema: frontmatterSchema.extend({
pypi: z.string().optional(),
npm: z.string().optional(),
github: z.array(z.string()).optional(),
macos: z.boolean().default(false),
windows: z.boolean().default(false),
linux: z.boolean().default(false),
}),
schema: frontmatterSchema,
},
meta: {
schema: metaSchema,

View File

@@ -15,8 +15,14 @@ import { DocActionsMenu } from '@/components/doc-actions-menu';
export default async function Page(props: { params: Promise<{ slug?: string[] }> }) {
const params = await props.params;
const slug = params.slug || [];
// Redirect root to get-started/introduction
if (slug.length === 0) {
redirect('/get-started/introduction');
}
const page = source.getPage(slug);
if (!page) notFound(); //redirect('/docs');
if (!page) notFound();
// Detect if this is an API reference page: /api/[section] or /api/[section]/[version]
let apiSection: string | null = null;
@@ -181,7 +187,7 @@ export default async function Page(props: { params: Promise<{ slug?: string[] }>
const tocFooter = () => {
return (
<div className="mt-4">
<DocActionsMenu pageUrl={page.url} pageTitle={page.data.title} filePath={page.file.path} />
<DocActionsMenu pageUrl={page.url} pageTitle={page.data.title} filePath={page.file?.path} />
</div>
);
};
@@ -282,9 +288,9 @@ export async function generateMetadata(props: {
const page = source.getPage(params.slug);
if (!page) notFound();
let title = `${page.data.title} | Cua Docs`;
if (page.url.includes('api')) title = `${page.data.title} | Cua API Docs`;
if (page.url.includes('guide')) title = ` Guide: ${page.data.title} | Cua Docs`;
let title = `${page.data.title} | Cua`;
if (page.url.includes('api')) title = `${page.data.title} | Cua API`;
if (page.url.includes('guide')) title = ` Guide: ${page.data.title} | Cua`;
// Canonical URL points to cua.ai to consolidate all SEO authority on main domain
const canonicalUrl = `https://cua.ai${page.url}`;
@@ -368,7 +374,7 @@ export async function generateMetadata(props: {
title,
description: page.data.description,
type: 'article',
siteName: 'Cua Docs',
siteName: 'Cua',
url: canonicalUrl,
},
twitter: {

View File

@@ -34,7 +34,7 @@ export const baseOptions: BaseLayoutProps = {
className="hidden dark:block"
alt="Logo"
/>
Cua Documentation
Cua
</>
),
},

View File

@@ -0,0 +1,41 @@
export function Hero({ children }: { children: React.ReactNode }) {
return (
<div className="not-prose relative mb-12 overflow-hidden rounded-xl border border-fd-border bg-gradient-to-br from-fd-background via-fd-muted/30 to-fd-muted/50 p-8 shadow-lg md:p-12 lg:p-16">
{/* Background Pattern */}
<div className="pointer-events-none absolute inset-0">
{/* Grid */}
<svg
className="absolute h-full w-full text-fd-foreground"
xmlns="http://www.w3.org/2000/svg"
>
<defs>
<pattern
id="hero-grid"
width="40"
height="40"
patternUnits="userSpaceOnUse"
>
<path
d="M 40 0 L 0 0 0 40"
fill="none"
stroke="currentColor"
strokeWidth="0.5"
opacity="0.1"
/>
</pattern>
</defs>
<rect width="100%" height="100%" fill="url(#hero-grid)" />
</svg>
{/* Subtle glow effects */}
<div className="absolute -right-20 -top-20 h-96 w-96 rounded-full bg-fd-primary/5 blur-3xl" />
<div className="absolute -bottom-32 -left-20 h-96 w-96 rounded-full bg-fd-primary/5 blur-3xl" />
</div>
{/* Content */}
<div className="relative z-10">
{children}
</div>
</div>
);
}

View File

@@ -9,6 +9,7 @@ import {
EditableForm,
EditableInput,
} from './components/editable-code-block';
import { Hero } from './components/hero';
// use this function to get MDX components, you will need it for rendering MDX
export function getMDXComponents(components?: MDXComponents): MDXComponents {
@@ -20,6 +21,7 @@ export function getMDXComponents(components?: MDXComponents): MDXComponents {
EditableValue,
EditableForm,
EditableInput,
Hero,
...TabsComponents,
...components,
};

View File

@@ -6,13 +6,19 @@ import { useEffect } from 'react';
import { usePathname, useSearchParams } from 'next/navigation';
if (typeof window !== 'undefined') {
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_API_KEY!, {
api_host: '/docs/api/posthog',
ui_host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
person_profiles: 'always',
capture_pageview: false,
capture_pageleave: true,
});
const apiKey = process.env.NEXT_PUBLIC_POSTHOG_API_KEY;
if (apiKey) {
posthog.init(apiKey, {
api_host: '/docs/api/posthog',
ui_host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
person_profiles: 'always',
capture_pageview: false,
capture_pageleave: true,
});
} else {
console.warn('[PostHog] API key not configured. Analytics will be disabled.');
}
}
export function PHProvider({ children }: { children: React.ReactNode }) {

View File

@@ -2,7 +2,11 @@
"compilerOptions": {
"baseUrl": ".",
"target": "ESNext",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
@@ -13,11 +17,15 @@
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"jsx": "react-jsx",
"incremental": true,
"paths": {
"@/.source": ["./.source/index.ts"],
"@/*": ["./src/*"]
"@/.source": [
"./.source/index.ts"
],
"@/*": [
"./src/*"
]
},
"plugins": [
{
@@ -25,6 +33,14 @@
}
]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}