{"id":4919,"library":"cua-auto","title":"CUA Auto","description":"cua-auto is the Python client library for interacting with the CUA computer server, enabling cross-platform automation of mouse, keyboard, screen, window, clipboard, and shell operations. It is currently at version 0.1.2, with the larger CUA ecosystem seeing more frequent updates across its modular components (server, sandbox).","status":"active","version":"0.1.2","language":"en","source_language":"en","source_url":"https://github.com/trycua/cua","tags":["automation","robotics","gui","cross-platform","mouse","keyboard"],"install":[{"cmd":"pip install cua-auto","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"symbol":"CuaClient","correct":"from cua_auto import CuaClient"}],"quickstart":{"code":"import os\nfrom cua_auto import CuaClient\n\n# The CuaClient connects to a running CUA computer server.\n# Ensure 'cua-computer-server' is running on the specified host and port.\n# For local testing, you might need to start it separately.\nhost = os.environ.get(\"CUA_SERVER_HOST\", \"localhost\")\nport = int(os.environ.get(\"CUA_SERVER_PORT\", 1337))\n\ntry:\n    client = CuaClient(host=host, port=port)\n    print(f\"Connected to CUA server at {host}:{port}\")\n\n    # Example: Get screen size\n    screen_size = client.screen.get_size()\n    print(f\"Screen size: {screen_size.width}x{screen_size.height}\")\n\n    # Example: Move mouse relative to current position\n    client.mouse.move_relative(100, 50)\n    print(\"Moved mouse by 100, 50 pixels.\")\n\n    # Example: Type text\n    client.keyboard.type(\"Hello from cua-auto!\")\n    print(\"Typed 'Hello from cua-auto!'.\")\n\nexcept ConnectionRefusedError:\n    print(f\"Error: Connection to CUA server at {host}:{port} refused.\")\n    print(\"Please ensure the 'cua-computer-server' is running and accessible.\")\nexcept Exception as e:\n    print(f\"An unexpected error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates connecting to a CUA computer server and performing basic mouse and keyboard actions. It's crucial to have a `cua-computer-server` instance running on the specified host and port for this client library to function."},"warnings":[{"fix":"Ensure `cua-computer-server` is installed and running on a reachable host and port before attempting to use `cua-auto`. Refer to the CUA project documentation for server setup.","message":"The `cua-auto` library is a client to the `cua-computer-server`. It will not function standalone; you must have a `cua-computer-server` running and accessible from the client for any automation to occur.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consult your operating system's documentation and the CUA project's specific setup guides for enabling necessary permissions (e.g., macOS Accessibility, Linux X11 permissions).","message":"Cross-platform automation libraries often require specific operating system permissions (e.g., accessibility services, screen recording) to function correctly. Without these, certain automation tasks may fail or be limited.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Check the `cua-computer-server` documentation for instructions on how to disable telemetry, which typically involves setting an environment variable or configuration option.","message":"Telemetry might be enabled by default in the CUA ecosystem, which includes the `cua-computer-server` that `cua-auto` connects to. Users concerned about data collection should explicitly opt out.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your development environment uses a supported Python version (`>=3.11, <3.14`). Consider using virtual environments to manage Python versions.","message":"The `cua-auto` library has specific Python version requirements, currently supporting Python 3.11, 3.12, and 3.13. Running it with unsupported versions (e.g., Python 3.10 or 3.14+) may lead to installation errors or unexpected runtime behavior.","severity":"gotcha","affected_versions":"<0.1.3"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}