Skip to main content

CUA (Computer Use) Agent for AI-driven computer interaction

Project description

Shows my svg

Python macOS Discord PyPI

cua-agent is a general Computer-Use framework with liteLLM integration for running agentic workflows on macOS, Windows, and Linux sandboxes. It provides a unified interface for computer-use agents across multiple LLM providers with advanced callback system for extensibility.

Features

  • Safe Computer-Use/Tool-Use: Using Computer SDK for sandboxed desktops
  • Multi-Agent Support: Anthropic Claude, OpenAI computer-use-preview, UI-TARS, Omniparser + any LLM
  • Multi-API Support: Take advantage of liteLLM supporting 100+ LLMs / model APIs, including local models (huggingface-local/, ollama_chat/, mlx/)
  • Cross-Platform: Works on Windows, macOS, and Linux with cloud and local computer instances
  • Extensible Callbacks: Built-in support for image retention, cache control, PII anonymization, budget limits, and trajectory tracking

Install

pip install "cua-agent[all]"

Quick Start

import asyncio
import os
from agent import ComputerAgent
from computer import Computer

async def main():
    # Set up computer instance
    async with Computer(
        os_type="linux",
        provider_type="cloud",
        name=os.getenv("CUA_CONTAINER_NAME"),
        api_key=os.getenv("CUA_API_KEY")
    ) as computer:

        # Create agent
        agent = ComputerAgent(
            model="anthropic/claude-sonnet-4-5-20250929",
            tools=[computer],
            only_n_most_recent_images=3,
            trajectory_dir="trajectories",
            max_trajectory_budget=5.0  # $5 budget limit
        )

        # Run agent
        messages = [{"role": "user", "content": "Take a screenshot and tell me what you see"}]

        async for result in agent.run(messages):
            for item in result["output"]:
                if item["type"] == "message":
                    print(item["content"][0]["text"])

if __name__ == "__main__":
    asyncio.run(main())

Docs

License

MIT License - see LICENSE file for details.

Project details


Release history Release notifications | RSS feed

This version

0.5.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cua_agent-0.5.2.tar.gz (141.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cua_agent-0.5.2-py3-none-any.whl (177.4 kB view details)

Uploaded Python 3

File details

Details for the file cua_agent-0.5.2.tar.gz.

File metadata

  • Download URL: cua_agent-0.5.2.tar.gz
  • Upload date:
  • Size: 141.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for cua_agent-0.5.2.tar.gz
Algorithm Hash digest
SHA256 af38a7db2c4fecc0d46fbbf160d3efbcf53f823f8f7b6978a3cbd16e8bee952c
MD5 6269238af9de5ca13d3b49eda6b28c0a
BLAKE2b-256 f71b7df2614a6d9b2dc5672a59a6add0ff1b6d08a8b7048674fbb7e5381bdb39

See more details on using hashes here.

File details

Details for the file cua_agent-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: cua_agent-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 177.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for cua_agent-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c83dbc90906d048ad75c09b5cfce431f8923a2c501d8b6a88a20c440bb7c7ee6
MD5 8649f7fa1e460093d40d4e7047e99fb3
BLAKE2b-256 c2ed07b9d8cc66e2901104afbda164c1592f6cc6a677436229ae494e8608b4df

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page