必须填 TYPESAFE_API_KEY,否则无法做任何决策;未授予屏幕录制权限时截图为壁纸,未授予辅助功能权限时点击被静默丢弃且 --act 拒绝启动;运行前先清空终端,否则终端文字会被 OCR 读入
typesafe-computer-use
awlevinMIT活跃维护用 OCR 识别屏幕内容,再通过 TypeSafe 分类下一步操作并自动点击,实现每步约 0.0002 美元的 macOS 电脑操作自动化。
Computer use for about $0.0002 a step: OCR the screen, classify the next action with TypeSafe, click. macOS.
git clone https://github.com/awlevin/typesafe-computer-use
cd typesafe-computer-use
uv sync
cp .env.example .env # fill in the keysmacOS 14 或更新版本,Python 3.12+,需在系统设置中授予终端屏幕录制与辅助功能权限;Windows 10/11 为实验性支持;README 未提及显存或 GPU 要求
用 OCR 加分类器驱动 Mac 完成自然语言目标,每步约 0.0002 美元
用 OCR 识别屏幕内容,再通过 TypeSafe 分类下一步操作并自动点击,实现每步约 0.0002 美元的 macOS 电脑操作自动化。
核心能力
- 用 Vision OCR 和辅助功能树确定性读取屏幕
- 单次 TypeSafe 请求同时决定动作类型、目标项和站点
- 代码计算日期、焦点、URL 等事实,模型只做选择
- 分类器停止后由写作模型读屏并给出最终答案
- 每次运行写入 runs 目录,可离线回放排查
容易踩的坑
- v0.2.0v0.2.0 (beta)pre-release最新正式版2026-09-22 · 2026-09-22 22:45 UTC
Beta. This project is under heavy development: expect rough edges, and expect settings and behavior to change between 0.x releases. It drives your real mouse and keyboard, so start with a dry run.
Highlights
- Other models for the writer. Any endpoint that speaks the Anthropic Messages API or OpenAI's Chat Completions API: LM Studio, Ollama, vLLM, LiteLLM, DeepSeek. Keys go only to the endpoint they belong to. See "Other models" in the README.
- Windows support, experimental. One desktop adapter per OS, with UI Automation, SendInput and Windows OCR. It is not yet tested on Windows; reports are welcome.
- A browser backend.
clicker-benchreads the page from the DOM over CDP, with no screenshots or OCR. It never reads password or card values. - Safer runs. The abort corner stops every input, even between typed characters. A failed typing check never empties another field. A writer failure refuses that one step instead of ending the run.
- Better perception in Chrome. Giant off-screen frames no longer become items.
- A simulated computer with graded scenarios, which drove many of the loop changes.
Thank you to everyone who contributed to this release.
What's Changed
- A simulated computer, 39 tasks of rising difficulty, and the loop changes they forced by @awlevin in https://github.com/awlevin/typesafe-computer-use/pull/8
- Send the writer to any Anthropic-compatible endpoint by @dustinsoftware in https://github.com/awlevin/typesafe-computer-use/pull/6
- Chrome's giant off-screen frames no longer become items; thinking off for other endpoints by @xyj404 in https://github.com/awlevin/typesafe-computer-use/pull/7
- The writer speaks OpenAI's Chat Completions API too, and a writer failure refuses its step by @hschvh in https://github.com/awlevin/typesafe-computer-use/pull/9
- Version 0.2.0, marked beta by @awlevin in https://github.com/awlevin/typesafe-computer-use/pull/13
- Tests and agents stay off the machine they run on by @awlevin in https://github.com/awlevin/typesafe-computer-use/pull/14
- A browser backend reads the DOM over CDP: no screenshots, no OCR, no password values by @vasanthsreeram in https://github.com/awlevin/typesafe-computer-use/pull/4
- Windows support, experimental, behind one desktop adapter by @defoxtrotalpha in https://github.com/awlevin/typesafe-computer-use/pull/11
- A corner abort stops every input, and a failed check never empties another field by @koushikvarma37-jpg in https://github.com/awlevin/typesafe-computer-use/pull/10
New Contributors
- @dustinsoftware made their first contribution in https://github.com/awlevin/typesafe-computer-use/pull/6
- @xyj404 made their first contribution in https://github.com/awlevin/typesafe-computer-use/pull/7
- @hschvh made their first contribution in https://github.com/awlevin/typesafe-computer-use/pull/9
- @vasanthsreeram made their first contribution in https://github.com/awlevin/typesafe-computer-use/pull/4
- @defoxtrotalpha made their first contribution in https://github.com/awlevin/typesafe-computer-use/pull/11
- @koushikvarma37-jpg made their first contribution in https://github.com/awlevin/typesafe-computer-use/pull/10
Full Changelog: https://github.com/awlevin/typesafe-computer-use/compare/v0.1.0...v0.2.0
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
typesafe-computer-use (jev for short) drives a Mac toward a goal you type in plain English, for about a fiftieth of a cent per step. It reads the screen deterministically, asks a small classifier which action comes next, and only calls a writing model when a text field genuinely needs free text or the classifier has stopped and the screen needs reading.
One idea runs through it: the classifier picks, code decides facts, and the writer only writes free text. Anything a model would have to work out (a date, whether a field is focused, whether a URL is clean) is computed in code and handed over as state. VISION.md says what it is for in a dozen lines.
clicker "go to techcrunch and take me to the checkout page for the cheapest tickets to their next upcoming event" --act
Beta. This is under heavy development. Expect rough edges, and expect settings and behavior to change between 0.x releases. It drives your real mouse and keyboard, so start with a dry run.
Why a classifier
Frontier-model computer use is capable and expensive: every step ships a screenshot and waits several seconds for a plan. Most steps do not need a plan. They need one choice from a short list, made quickly and cheaply, with a confidence number you can gate on.
TypeSafe sells exactly that: a decision model that answers
a Choice over up to 255 options with a full probability distribution and a calibrated
confidence, in a few hundred milliseconds, with free output tokens. This project is a
computer-use loop built around it.
Measured on the same screenshot and goal, one decision each:
| typesafe (jev) | Claude Opus 5, bare screenshot | multiplier | |
|---|---|---|---|
| input tokens | 4,882 | 4,785 | same |
| cost per decision | $0.0002 | $0.032 | 155x cheaper |
| cost per decision, realistic loop with history | $0.0002 | $0.035 to $0.08 | 170x to 390x cheaper |
| cost per 12-step task | $0.003 | $0.40 to $0.90 | 130x to 300x cheaper |
| model latency | 0.13 to 0.38 s | 5.2 s | 14x to 40x faster |
| end-to-end step, with capture and OCR | about 1.5 s | about 5.5 s | 3.7x faster |
The honest caveat: the big model read the event dates off the pixels and compared them unaided. The classifier needed the date parsing described in how a step works. Every piece of reasoning the frontier model does for free has to be rebuilt here as deterministic state.
Install
macOS 14 or newer, Python 3.12 or newer, uv. Windows 10 and 11 are experimental; see Windows.
git clone https://github.com/awlevin/typesafe-computer-use
cd typesafe-computer-use
uv sync
cp .env.example .env # fill in the keys
| variable | required | purpose |
|---|---|---|
TYPESAFE_API_KEY | yes | every decision |
ANTHROPIC_API_KEY | no | type_text, writer-proposed URLs, and the final answer |
CLICKER_EMAIL | no | enables the type_email action |
CLICKER_BROWSER | no | defaults to Google Chrome |
.env lives at the repo root and is read by every entry point (clicker, clicker-inspect).
To run the writer on another model or endpoint (LM Studio, Ollama, any OpenAI-compatible
server), see writer endpoints.
Grant your terminal Screen Recording and Accessibility in System Settings >
Privacy & Security. Without the first, captures are wallpaper. Without the second,
synthetic clicks are silently dropped, and --act refuses to start.
First run
uv run clicker "open the Playground" # dry run: one step, prints what it would do
uv run clicker "open the Playground" --act # drives the machine, up to 100 steps
uv run clicker "log in" --act --steps 20 --delay 3 # longer and slower
uv run clicker "log in" --act --handoffs 0 # the classifier alone: its first stop ends the run
uv run clicker-inspect "any goal" # 3-2-1, capture, open the annotated screen + payload
Clear the terminal first. It is on screen, so its text is OCR input.
To stop a live run, press Ctrl-C in the terminal or slam the mouse into the top-left corner of
the screen. The loop also stops itself on done, low confidence, a stall, or the step limit,
and the writer then reads the screen and prints the answer. Every run writes
runs/<timestamp>/, so a stall can be replayed offline.
How a step works
- The screen is read deterministically: Vision OCR on a crop of the frontmost window, plus the labelled controls from the accessibility tree, which sees the icons OCR cannot.
- Code adds the facts: the date on any block and how far off it is, the row of a repeated label, the focused field, the app and URL, and the actions already tried on this screen.
- One TypeSafe request answers three
Choices: which kind of action, which item, which site. - The action runs deterministically, the loop waits, and the next capture is the only witness of what it did.
- When the classifier stops, the writer reads the screen and answers, or hands the run back with a focus (one move) or a question for you. It never picks an action.
The full walk, with the OCR cost, the tree walk, the action space, and the stop rules, is in how a step works.
Benchmark
jev runs as an agent in OSWorld, a benchmark of real
desktop tasks, beside OSWorld's own GPT agent on the same task. scripts/osworld setup fetches
OSWorld and installs jev beside it; scripts/osworld run-jev chrome/<task id> --ocr rapidocr
runs one task. It needs a Linux host with KVM; see OSWorld for that and for
a one-command machine in Google Cloud.
Read more
- How a step works: perception, the three-part decision, the action space, stalls, and the hand-off to the writer
- Run folder: what every run writes, the timing line, and offline replay
- Browser backend: DOM perception over Chrome DevTools, no OCR, no screen permission
- Writer endpoints: every writer variable, and other models over the Anthropic or OpenAI API
- Windows: the experimental adapter and how it differs from macOS
- OSWorld: setup, the two run commands, results, and the Google Cloud machine
- Layout: every module and what it owns
- Known limits
- Sandbox: a Linux computer in a container, for running the agent on a screen that is not yours
Contributing
Bug reports with a run folder attached are the most useful thing you can send. Before a pull
request, uv run ruff check . && uv run ruff format --check . and uv run pytest -q must pass.
The ground rules, and how to write a scenario for a task the loop cannot do, are in
CONTRIBUTING.md.