A Simple Python CUA (Computer Use Agent) Solution
Project description
aiocua
A Simple Python CUA (Computer Use Agent) Solution
Status
This project is in Technical Preview.
- APIs are subject to change.
- Not ready for production use.
Supported Platforms
- Windows
- macOS
Installation
pip install aiocua
Quick Start
import asyncio
from aiocua import CuaOperator
async def main():
operator = CuaOperator()
# Get screen dimensions
width, height = await operator.dimensions()
# Take a screenshot (returns base64-encoded string)
screenshot_base64 = await operator.screenshot()
# Get monitor info
monitors = await operator.monitors()
for m in monitors:
print(f"Monitor {m.id}: {m.width}x{m.height} (scale={m.scale}, primary={m.primary})")
if __name__ == "__main__":
asyncio.run(main())
API Reference
All methods on CuaOperator are async.
Mouse
| Method | Description |
|---|---|
move(x, y) |
Move the cursor to the given coordinates. |
click(button="left", x=None, y=None) |
Click a mouse button. Supported buttons: left, right, wheel, back, forward. If x/y are provided, moves first. |
double_click(x=None, y=None) |
Double-click at the current or given position. |
drag(path) |
Drag along a list of (x, y) coordinates. |
scroll(scroll_x, scroll_y, x=None, y=None) |
Scroll by the given amounts. Optionally move to x/y first. |
Keyboard
| Method | Description |
|---|---|
key_press(keys) |
Press one or more keys simultaneously (e.g. ["CTRL", "C"]). Keys are automatically remapped per platform. |
type_text(text) |
Type a string of text, including Unicode characters. |
Screen
| Method | Description |
|---|---|
screenshot() |
Capture the screen and return it as a base64-encoded PNG string. |
dimensions() |
Return the primary monitor resolution as (width, height). |
monitors() |
Return a list of MonitorMetadata for each connected display. |
Other
| Method | Description |
|---|---|
wait() |
Wait for any pending operations to complete. |
Testing
pip install aiocua[test]
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aiocua-0.0.0a0.tar.gz.
File metadata
- Download URL: aiocua-0.0.0a0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83c102ae9cdd03c32bf4a2d878ad1c6c9d6cd4c513226f453517477838a656f6
|
|
| MD5 |
4920e8dcd84b4a17e2f4db1e5cff8dae
|
|
| BLAKE2b-256 |
b8a1dcffc3a4f95fd28858d954839fd3c78b133e76e6435a312298a367b55426
|
Provenance
The following attestation bundles were made for aiocua-0.0.0a0.tar.gz:
Publisher:
publish.yml on yangyuan/aiocua
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiocua-0.0.0a0.tar.gz -
Subject digest:
83c102ae9cdd03c32bf4a2d878ad1c6c9d6cd4c513226f453517477838a656f6 - Sigstore transparency entry: 929138127
- Sigstore integration time:
-
Permalink:
yangyuan/aiocua@f7f1dbccfcb41072aa65ff46c2bfabe5b569c957 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/yangyuan
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f7f1dbccfcb41072aa65ff46c2bfabe5b569c957 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file aiocua-0.0.0a0-py3-none-any.whl.
File metadata
- Download URL: aiocua-0.0.0a0-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f19b8568e915e7a72d7cf843f222c0c3907f28de7674c99e945504e29fb1dfe
|
|
| MD5 |
2082841bce22425686f3256c917aca5f
|
|
| BLAKE2b-256 |
6604c6f8fe69d8ec074b915b9a4e8aade8c228e0ad7c97a5fbd089d6e17bd21f
|
Provenance
The following attestation bundles were made for aiocua-0.0.0a0-py3-none-any.whl:
Publisher:
publish.yml on yangyuan/aiocua
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiocua-0.0.0a0-py3-none-any.whl -
Subject digest:
7f19b8568e915e7a72d7cf843f222c0c3907f28de7674c99e945504e29fb1dfe - Sigstore transparency entry: 929138135
- Sigstore integration time:
-
Permalink:
yangyuan/aiocua@f7f1dbccfcb41072aa65ff46c2bfabe5b569c957 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/yangyuan
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f7f1dbccfcb41072aa65ff46c2bfabe5b569c957 -
Trigger Event:
workflow_dispatch
-
Statement type: