xiaohongshu
xiaohongshu
cua-cloud
Comprehensive guide for building Computer Use Agents with the CUA framework. This skill should be used when automating desktop applications, building vision-based agents, controlling virtual machines (Linux/Windows/macOS), or integrating computer-use models from Anthropic, OpenAI, or other provid...
Full skill instructions
CUA ("koo-ah") is an open-source framework for building Computer Use Agents—AI systems that see, understand, and interact with desktop applications through vision and action. It supports Windows, Linux, and macOS automation.
Key capabilities:
# Computer SDK - desktop control
pip install cua-computer
# Agent SDK - autonomous agents
pip install cua-agent[all]
# MCP Server (optional)
pip install cua-mcp-server
CLI Installation:
# macOS/Linux
curl -LsSf https://cua.ai/cli/install.sh | sh
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://cua.ai/cli/install.ps1 | iex"
from computer import Computer
import os
os.environ["CUA_API_KEY"] = "sk_cua-api01_..."
computer = Computer(
os_type="linux", # "linux" | "macos" | "windows"
provider_type="cloud", # "cloud" | "docker" | "lume" | "windows_sandbox"
name="sandbox-name"
)
try:
await computer.run()
# Use computer.interface methods here
finally:
await computer.close()
Screenshot:
screenshot = await computer.interface.screenshot()
Mouse Actions:
await computer.interface.left_click(x, y) # Left click at coordinates
await computer.interface.right_click(x, y) # Right click
await computer.interface.double_click(x, y) # Double click
await computer.interface.move_cursor(x, y) # Move cursor without clicking
await computer.interface.drag(x1, y1, x2, y2) # Click and drag
Keyboard Actions:
await computer.interface.type_text("Hello!") # Type text
await computer.interface.key_press("enter") # Press single key
await computer.interface.hotkey("ctrl", "c") # Key combination
Scrolling:
await computer.interface.scroll(direction, amount) # Scroll up/down/left/right
File Operations:
content = await computer.interface.read_file("/path/to/file")
await computer.interface.write_file("/path/to/file", "content")
Clipboard:
text = await computer.interface.get_clipboard()
await computer.interface.set_clipboard("text to copy")
OpenAI-style:
ClickAction - button: left/right/wheel/back/forward, x, y coordinatesDoubleClickAction - same parameters as clickDragAction - start and end coordinatesKeyPressAction - key nameMoveAction - x, y coordinatesScreenshotAction - no parametersScrollAction - direction and amountTypeAction - text stringWaitAction - durationAnthropic-style:
LeftMouseDownAction - x, y coordinatesLeftMouseUpAction - x, y coordinatesfrom agent import ComputerAgent
agent = ComputerAgent(
model="anthropic/claude-sonnet-4-5-20250929",
tools=[computer],
max_trajectory_budget=5.0 # Cost limit in USD
)
messages = [{"role": "user", "content": "Open Firefox and go to google.com"}]
async for result in agent.run(messages):
for item in result["output"]:
if item["type"] == "message":
print(item["content"][0]["text"])
{
"output": [AgentMessage, ...], # List of messages
"usage": {
"prompt_tokens": int,
"completion_tokens": int,
"total_tokens": int,
"response_cost": float
}
}
Message Types:
UserMessage - Input from user/systemAssistantMessage - Text output from agentReasoningMessage - Agent thinking/summaryComputerCallMessage - Intent to perform actionComputerCallOutputMessage - Screenshot resultFunctionCallMessage - Python tool invocationFunctionCallOutputMessage - Function resultmodel="cua/anthropic/claude-sonnet-4.5" # Recommended
model="cua/anthropic/claude-haiku-4.5" # Faster, cheaper
Single API key, cost tracking, managed infrastructure.
os.environ["ANTHROPIC_API_KEY"] = "sk-ant-..."
model="anthropic/claude-sonnet-4-5-20250929"
model="anthropic/claude-haiku-4-5-20251001"
model="anthropic/claude-opus-4-20250514"
model="anthropic/claude-3-7-sonnet-20250219"
os.environ["OPENAI_API_KEY"] = "sk-..."
model="openai/computer-use-preview"
model="gemini-2.5-computer-use-preview-10-2025"
model="huggingface-local/ByteDance-Seed/UI-TARS-1.5-7B"
model="ollama_chat/0000/ui-tars-1.5-7b"
Combine grounding models with planning models:
model="huggingface-local/GTA1-7B+openai/gpt-4o"
model="moondream3+openai/gpt-4o"
model="omniparser+anthropic/claude-sonnet-4-5-20250929"
model="omniparser+ollama_chat/mistral-small3.2"
Grounding Models: UI-TARS, GTA, Holo, Moondream, OmniParser, OpenCUA
model="human/human" # Pause for user approval
computer = Computer(
os_type="linux", # linux, windows, macos
provider_type="cloud",
name="sandbox-name",
api_key="sk_cua-api01_..."
)
Get API key from cloud.trycua.com.
computer = Computer(
os_type="linux",
provider_type="docker"
)
Images: trycua/cua-xfce:latest, trycua/cua-ubuntu:latest
computer = Computer(
os_type="linux",
provider_type="lume"
)
Requires Lume CLI installation.
computer = Computer(
os_type="windows",
provider_type="windows_sandbox"
)
Requires pywinsandbox and Windows Sandbox feature enabled.
This project uses the CUA MCP Server for Claude Code integration:
{
"mcpServers": {
"cua": {
"type": "http",
"url": "https://cua-mcp-server.vercel.app/mcp"
}
}
}
Sandbox Management:
mcp__cua__list_sandboxes - List all sandboxesmcp__cua__create_sandbox - Create VM (os, size, region)mcp__cua__start/stop/restart/delete_sandboxTask Execution:
mcp__cua__run_task - Autonomous task executionmcp__cua__describe_screen - Vision analysis without actionmcp__cua__get_task_history - Retrieve task results# Good - specific and sequential
"Open Chrome, navigate to github.com, click the Sign In button"
# Avoid - vague
"Log into GitHub"
async for result in agent.run(messages):
if result.get("error"):
# Take screenshot to understand state
screenshot = await computer.interface.screenshot()
# Retry with more specific instructions
try:
await computer.run()
# ... perform tasks
finally:
await computer.close() # Always cleanup
agent = ComputerAgent(
model="cua/anthropic/claude-sonnet-4.5",
max_trajectory_budget=5.0 # Stop at $5 spent
)
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience