diff --git a/docs/content/docs/get-started/quickstart.mdx b/docs/content/docs/get-started/quickstart.mdx index cea2b335..894856a2 100644 --- a/docs/content/docs/get-started/quickstart.mdx +++ b/docs/content/docs/get-started/quickstart.mdx @@ -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. + -### Install Cua +### Install the CUA CLI - - - - -#### Install uv - - - - -```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 -``` - - - - -```powershell -# Use irm to download the script and execute it with iex: -powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" -``` - - + + + ```bash + curl -LsSf https://cua.ai/cli/install.sh | sh + ``` + + + ```powershell + powershell -ExecutionPolicy ByPass -c "irm https://cua.ai/cli/install.ps1 | iex" + ``` + + + ```bash + npm install -g @trycua/cli + ``` + + + ```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 + ``` + -#### Install Python 3.12 - -```bash -uv python install 3.12 -# uv will install Cua dependencies automatically when you use --with "cua-agent[cli]" -``` - - - - - -#### Install conda - - - - -```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 -``` - - - - -```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 -``` - - - - -```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 -``` - - - - -#### 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 -``` - - - - - -#### Install Cua - -```bash -pip install "cua-agent[cli]" cua-computer -``` - - - - - -### Run Cua CLI +### Authenticate with CUA -Choose your preferred AI model: - -#### OpenAI Computer Use Preview - - - +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 ``` - - +If you don't have a CUA account yet, sign up at [cua.ai/signin](https://cua.ai/signin). + + + + + +### 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 ``` - - +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 + - - + +### 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. - - - +#### 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. - - - -#### Omniparser + LLMs - - - - +#### 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 ``` - - + -```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 -``` + - - +### Try Some AI Tasks -#### Local Models - - - - -```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 -``` - - - - -```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 -``` - - - - -#### 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! +### 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).