mirror of
https://github.com/trycua/computer.git
synced 2026-01-06 05:20:02 -06:00
updated quickstart with cli installation
This commit is contained in:
@@ -332,253 +332,151 @@ Learn more about agents in [Agent Loops](/agent-sdk/agent-loops) and available m
|
||||
|
||||
## CLI Quickstart
|
||||
|
||||
Get started quickly with the CUA CLI - the easiest way to manage cloud VMs and run AI agents.
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
|
||||
### Install Cua
|
||||
### Install the CUA CLI
|
||||
|
||||
<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 items={['macOS / Linux', 'Windows', 'npm (Alternative)', 'From Source']}>
|
||||
<Tab value="macOS / Linux">
|
||||
```bash
|
||||
curl -LsSf https://cua.ai/cli/install.sh | sh
|
||||
```
|
||||
</Tab>
|
||||
<Tab value="Windows">
|
||||
```powershell
|
||||
powershell -ExecutionPolicy ByPass -c "irm https://cua.ai/cli/install.ps1 | iex"
|
||||
```
|
||||
</Tab>
|
||||
<Tab value="npm (Alternative)">
|
||||
```bash
|
||||
npm install -g @trycua/cli
|
||||
```
|
||||
</Tab>
|
||||
<Tab value="From Source">
|
||||
```bash
|
||||
# Install Bun (macOS/Linux)
|
||||
curl -fsSL https://bun.sh/install | bash
|
||||
|
||||
# Install Bun (Windows)
|
||||
# powershell -c "irm bun.sh/install.ps1|iex"
|
||||
|
||||
# Clone the repo
|
||||
git clone https://github.com/trycua/cua
|
||||
cd cua/libs/typescript/cua-cli
|
||||
|
||||
# Install the CLI
|
||||
bun install
|
||||
bun link
|
||||
bun link cua-cli
|
||||
```
|
||||
</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
|
||||
### Authenticate with CUA
|
||||
|
||||
Choose your preferred AI model:
|
||||
|
||||
#### OpenAI Computer Use Preview
|
||||
|
||||
<Tabs items={['uv', 'conda/pip']} persist>
|
||||
<Tab value="uv">
|
||||
Login to your CUA account:
|
||||
|
||||
```bash
|
||||
uv run --with "cua-agent[cli]" -m agent.cli openai/computer-use-preview
|
||||
# Interactive browser login (recommended)
|
||||
cua auth login
|
||||
|
||||
# Or provide your API key directly
|
||||
cua auth login --api-key sk-your-api-key-here
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="conda/pip">
|
||||
If you don't have a CUA account yet, sign up at [cua.ai/signin](https://cua.ai/signin).
|
||||
|
||||
</Step>
|
||||
|
||||
<Step>
|
||||
|
||||
### Create Your First VM
|
||||
|
||||
Create a cloud sandbox where your AI agents will run:
|
||||
|
||||
```bash
|
||||
python -m agent.cli openai/computer-use-preview
|
||||
# Create a Linux VM (recommended for most use cases)
|
||||
cua vm create --os linux --configuration small --region north-america
|
||||
|
||||
# Or create a Windows VM
|
||||
cua vm create --os windows --configuration small --region north-america
|
||||
|
||||
# Or create a macOS VM
|
||||
cua vm create --os macos --configuration small --region north-america
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
Your VM will be created and you'll see output like:
|
||||
```
|
||||
VM created and ready: my-vm-abc123
|
||||
Password: secure-password-here
|
||||
Host: my-vm-abc123.containers.cloud.trycua.com
|
||||
```
|
||||
|
||||
#### Anthropic Claude
|
||||
</Step>
|
||||
|
||||
<Tabs items={['uv', 'conda/pip']} persist>
|
||||
<Tab value="uv">
|
||||
<Step>
|
||||
|
||||
### Start Using Your VM
|
||||
|
||||
You can now interact with your VM in multiple ways:
|
||||
|
||||
#### Option 1: Open the AI Playground (Recommended)
|
||||
```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
|
||||
cua vm chat my-vm-abc123
|
||||
```
|
||||
This opens the full CUA playground in your browser where you can chat with AI agents that control your VM.
|
||||
|
||||
</Tab>
|
||||
<Tab value="conda/pip">
|
||||
|
||||
#### Option 2: Access VNC Desktop
|
||||
```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
|
||||
cua vm vnc my-vm-abc123
|
||||
```
|
||||
This opens a remote desktop connection to your VM.
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
#### Omniparser + LLMs
|
||||
|
||||
<Tabs items={['uv', 'conda/pip']} persist>
|
||||
<Tab value="uv">
|
||||
|
||||
#### Option 3: List and Manage VMs
|
||||
```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
|
||||
# List all your VMs
|
||||
cua vm list
|
||||
|
||||
# Start/stop VMs as needed
|
||||
cua vm stop my-vm-abc123
|
||||
cua vm start my-vm-abc123
|
||||
|
||||
# Delete VMs when done
|
||||
cua vm delete my-vm-abc123
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="conda/pip">
|
||||
</Step>
|
||||
|
||||
```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
|
||||
```
|
||||
<Step>
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
### Try Some AI Tasks
|
||||
|
||||
#### 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:
|
||||
Once you have the playground open (`cua vm chat`), try asking the AI to:
|
||||
|
||||
- "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"
|
||||
- "Open Firefox and navigate to github.com"
|
||||
- "Create a new text file and write 'Hello World' in it"
|
||||
- "Install Python and run a simple script"
|
||||
- "Take a screenshot of the desktop"
|
||||
|
||||
The AI agent will automatically control your VM to complete these tasks!
|
||||
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
### What's Next?
|
||||
|
||||
- **Explore more commands**: Check out the [complete CLI reference](/libraries/cua-cli/commands)
|
||||
- **Learn about programming**: Try the [Developer Quickstart](#developer-quickstart) to build custom automations
|
||||
- **Join the community**: Get help in our [Discord community](https://discord.com/invite/mVnXXpdE85)
|
||||
|
||||
---
|
||||
|
||||
For running models locally, see [Running Models Locally](/agent-sdk/supported-model-providers/local-models).
|
||||
|
||||
Reference in New Issue
Block a user