General Introduction
Cua is an open source project called Computer-Use Agent, pronounced "koo-ah". It is designed for Apple Silicon devices, can create and run high-performance macOS and Linux virtual machines, speed close to the native device of 90%. Cua uses Apple's Virtualization.Framework technology, while supporting AI agents in the virtual environment to perform tasks such as browsing the Web, writing code. The project emphasizes secure isolation to protect the user's primary system. It is available on GitHub under the MIT license for developers, tech enthusiasts, and AI researchers.
Function List
- Create and run macOS and Linux virtual machines on Apple Silicon.
- Provides high-performance virtualization at up to 90% native speeds.
- Supports AI agent control of virtual machines for complex operations such as browsing and encoding.
- Ensure that virtual machines are completely isolated from the main system for security.
- Command line tools (Lume CLI) and Python libraries are provided for easy management of VMs and AI agents.
- Support for multiple language model (LLM) integrations such as OpenAI, Anthropic.
- Open source framework that allows users to customize virtual machine images and features.
Using Help
The installation and use of Cua is divided into two parts: virtual machine management (Lume CLI) and full AI agent functionality. Below are the detailed steps.
system requirements
- Device: Mac with Apple Silicon (M1/M2/M3/M4).
- System: macOS 14 (Sonoma) or later.
- Python: 3.10 or higher (AI agent functionality only).
- Disk space: 40GB or more is recommended for storing virtual machine images.
Installation process
Option 1: Install Lume CLI (Virtual Machine Management) only
- Open the terminal and make sure the network is open.
- Enter the command Install Lume:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh)"
- After the installation is complete, enter
lume --version
Check the version to make sure the installation was successful.
Option 2: Install full AI Agent functionality
- Install the Lume CLI first (as in the steps above).
- Install the Python library:
pip install cua-computer cua-agent
- If you need more functionality, you can install other libraries such as:
pip install cua-core cua-computer-server cua-som pylume
Main Functions
Creating and running virtual machines
- Enter it in the terminal:
lume run macos-sequoia-vanilla:latest
This will download and launch the macOS Sequoia virtual machine.
2. When the virtual machine starts, you will see a separate desktop.
3. Press Ctrl+C
Stop the virtual machine.
Using the AI Agent
- Configuration environment
After installing the AI agent library, create.env
file, add the model key. Example:
OPENAI_API_KEY=你的密钥
- running example
In GitHub'snotebooks
Find the sample code in the folder, e.g:
- Open a terminal and run it:
python -m cua_agent.examples.basic_agent
- The AI agent recognizes the VM interface from the screenshot and performs the task.
- Customized tasks
Edit the Python script to define specific actions of the agent, such as browsing a web page or clicking a button.
Managing Virtual Machines
- List mirrors::
lume images
- Delete Mirror Image::
lume rm macos-sequoia-vanilla:latest
Featured Function Operation
High Performance Virtualization
Cua uses Apple's Virtualization.Framework to achieve near-native performance with no additional configuration. Running Geekbench tests shows that the virtual machine can perform up to 90% natively.
secure isolation
Each virtual machine runs in a separate sandbox. the operation of the AI agent does not affect the main system, making it suitable for testing insecure code or applications.
LLM Integration
Cua supports connecting multiple language models. Users only need to install the corresponding library and configure the key. Example:
- Use Anthropic:
pip install "cua-agent[anthropic]"
export ANTHROPIC_API_KEY=你的密钥
Advanced Use
- View Document
Visit GitHub'sdocs/Getting-Started.md
maybelibs/*/README.md
, for details on usage. - Run the Notebook example
downloadingnotebooks
folder in the Jupyter Notebook to experience a demo of the AI agent fixing a GitHub issue or cloning an app. - Contribute code
consultationCONTRIBUTING.md
, submit new features or fix issues.
caveat
- Supports Apple Silicon only, not compatible with Intel Macs.
- Larger virtual machine images (e.g. macOS requires 20-30GB), make sure you have enough disk space.
- AI agents require a stable network and a valid API key.
application scenario
- Software Development and Testing
Developers use Cua to create multiple virtual machines to test applications on macOS and Linux. - AI Automated Work
Configure an AI agent to automate web data crawling or file organizing tasks. - Education and experimentation
Students or researchers run code in isolated environments to learn virtualization or AI techniques.
QA
- Which operating systems does Cua support?
macOS and Linux are supported, Windows is not. - How fast does the virtual machine run?
Near-native 90%, guaranteed by Apple Silicon and Virtualization. - How do I join the community?
Visit Discord (https://discord.com/invite/mVnXXpdE85) to share ideas or ask for help.