screenagent
Control any macOS app with Claude — Python SDK + CLI.
Browser Use and Skyvern only work inside the browser. screenagent uses macOS Accessibility API + CGEvent for native input, so it works with System Settings, Finder, Notes, Calculator, and any app.
Install
pip install screenagent-ai
This installs both the Python SDK (from screenagent import ...) and the screenagent CLI command.
Requires macOS and Python 3.11+.
Setup
1. Anthropic API Key
Get your key at console.anthropic.com and set it:
export ANTHROPIC_API_KEY="sk-ant-..."
2. Accessibility Permission
macOS requires you to grant accessibility access to your terminal app:
System Settings → Privacy & Security → Accessibility → add your terminal (Terminal.app, iTerm2, VS Code, etc.)
Without this, screenagent cannot read UI elements or send keyboard/mouse events.
Usage 1: CLI
Run directly from the terminal. Works with Claude Code out of the box.
# Control native apps (finds and launches via Spotlight automatically)
screenagent run "Open Calculator and compute 42 * 17"
screenagent run "Open System Settings and switch to Dark Mode"
# Browser automation
screenagent run "Open Chrome, go to youtube.com, search for ycombinator"
screenagent run --app "Google Chrome" "Go to google.com and search for AI news"
# Individual actions (no API key needed)
screenagent screenshot --file screen.png
screenagent ax-tree "Google Chrome"
screenagent click 640 400
screenagent type "hello world"
screenagent key return --modifiers command
Usage 2: Python SDK
3-line agent
from screenagent import Agent
agent = Agent()
result = agent.run("Open System Settings and switch to Dark Mode")
print(result.summary)
print(result.success)
Component functions (no API key needed)
from screenagent import screenshot, click, type_text, key_press, get_ui_tree
png_bytes = screenshot()
click(640, 400)
type_text("hello world")
key_press("return")
tree = get_ui_tree("Google Chrome")
print(tree.to_text())
Configuration
| Environment Variable | Default | Description |
|---|---|---|
ANTHROPIC_API_KEY |
— | Claude API key (required for agent) |
AGENT_MODEL |
claude-sonnet-4-6 |
Model to use |
AGENT_MAX_STEPS |
20 |
Maximum agent loop iterations |
AGENT_COMPUTER_USE |
true |
Use Claude computer-use tool |
CDP_PORT |
9222 |
Chrome DevTools Protocol port |
Also supports .env files.
License
MIT
Metadata
Release files for screenagent-ai 0.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| screenagent_ai-0.3.4.tar.gz | 106.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| screenagent_ai-0.3.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 147.4 kB
Release files / screenagent_ai-0.3.4.tar.gz
| Download URL | screenagent_ai-0.3.4.tar.gz |
|---|---|
| Size | 106.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5cc4eba56320a68de686d381a8af5931d253f176f768e7d90d8ad6b54c6eb7e8
|
|
BLAKE2b-256 checksum How to use checksums |
8b7b23a6bf8a9318a80fe1e93a86676f163d8967880ed6b9ed6af4257cc41629
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.10
|
Release files / screenagent_ai-0.3.4-py3-none-any.whl
| Download URL | screenagent_ai-0.3.4-py3-none-any.whl |
|---|---|
| Size | 41.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
68e7782f9edd8ed508dc9c2a84963ac3d07b500dbd2c332f4300e585e6142bc2
|
|
BLAKE2b-256 checksum How to use checksums |
6f2bf532ac637b6d9e50b8543e9767c144de9963dfe5d606d877259097f6d003
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.10
|
Security for screenagent-ai 0.3.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.