Files
computer/libs/computer
Ikko Eltociear Ashimine 92861ce14b docs: update computer/README.md
HuggingFace -> Hugging Face
2025-04-23 14:30:00 -04:00
..
2025-04-18 13:09:25 -04:00
2025-03-16 16:06:32 +01:00
2025-04-23 14:30:00 -04:00

Shows my svg

Python macOS Discord PyPI

cua-computer is a Computer-Use Interface (CUI) framework powering Cua for interacting with local macOS and Linux sandboxes, PyAutoGUI-compatible, and pluggable with any AI agent systems (Cua, Langchain, CrewAI, AutoGen). Computer relies on Lume for creating and managing sandbox environments.

Get started with Computer

from computer import Computer

computer = Computer(os="macos", display="1024x768", memory="8GB", cpu="4")
try:
    await computer.run()
    
    screenshot = await computer.interface.screenshot()
    with open("screenshot.png", "wb") as f:
        f.write(screenshot)
    
    await computer.interface.move_cursor(100, 100)
    await computer.interface.left_click()
    await computer.interface.right_click(300, 300)
    await computer.interface.double_click(400, 400)

    await computer.interface.type("Hello, World!")
    await computer.interface.press_key("enter")

    await computer.interface.set_clipboard("Test clipboard")
    content = await computer.interface.copy_to_clipboard()
    print(f"Clipboard content: {content}")
finally:
    await computer.stop()

Install

To install the Computer-Use Interface (CUI):

pip install cua-computer

The cua-computer PyPi package pulls automatically the latest executable version of Lume through pylume.

Run

Refer to this notebook for a step-by-step guide on how to use the Computer-Use Interface (CUI):

Using the Gradio Computer UI

The computer module includes a Gradio UI for creating and sharing demonstration data. The UI provides built-in integration with Hugging Face Datasets for sharing demonstrations and incorporating them into CUA ML pipelines.

# Install with UI support
pip install "cua-computer[ui]"
View demonstration video

Note: For precise control of the computer, we recommend using VNC or Screen Sharing instead of the Computer Gradio UI.

Launch the UI

# launch_ui.py
from computer.ui.gradio.app import create_gradio_ui

app = create_gradio_ui()
app.launch(share=False)

For examples, see Computer UI Examples