agent-desktop
Skill này làm gì
Cho phép trợ lý vận hành các chương trình desktop bằng cách đọc cấu trúc màn hình của chúng và thao tác trên nút, ô nhập và menu. Dành cho người muốn AI dùng ứng dụng thay mình.
Khi nào nên dùng
- ✓Khi bạn muốn trợ lý điền form hoặc bấm nút trong một ứng dụng desktop.
- ✓Khi bạn cần nó đọc những gì trên màn hình của một chương trình.
- ✓Khi bạn muốn nó chụp ảnh màn hình, chuyển cửa sổ hoặc mở một ứng dụng.
Liên kết skill
https://github.com/NanmiCoder/cc-haha/blob/main/native/agent-desktop/skills/agent-desktop/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Mở ứng dụng Ghi chú, tạo một ghi chú mới có tiêu đề Danh sách đi chợ, rồi gõ danh sách của tôi vào đó.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Trợ lý chạy một công cụ dòng lệnh đọc cây trợ năng của ứng dụng và trả về một kết quả JSON. Nó thao tác trên một phần tử, rồi đọc lại vùng đó để kiểm tra thay đổi.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
agent-desktop
agent-desktop is a CLI that lets an AI agent observe and operate desktop apps through the OS accessibility tree. It is a tool, not an agent. Every command prints one JSON envelope (ok, data or error). The observe, act and verify loop runs in you.
Shell syntax
Examples use a POSIX shell. In PowerShell, quote every ref ('@s8f3k2p9:e1'), because a bare @token is the splatting operator. Use $env:NAME = 'value' instead of export, and | ConvertFrom-Json instead of $(...) and jq. The Windows skill has the PowerShell forms.
First run
- Run
agent-desktop status. It reports the platform, permissions andsupported_surfaces. - Run
agent-desktop skills get platform. It loads the skill for the OS the binary runs on (macOS, Windows or Linux). - For flags and syntax, run
agent-desktop <command> --help. This skill does not repeat flag lists.
The loop
Use find when you know the role or exact name. Otherwise map the app first and drill into one region.
agent-desktop snapshot --skeleton --app "Notes" -i --compact # shallow map, children_count on cut branches
agent-desktop snapshot --root @s8f3k2p9:e3 -i --compact # drill into one region
agent-desktop click @s8f3k2p9:e12 # act on a qualified ref
agent-desktop snapshot --root @s8f3k2p9:e3 -i --compact # verify: re-read the same region
- A small app needs no skeleton. Take a full
snapshot -i. - Never skeleton a surface (
--surface menu,sheet,alert). A surface is already focused. - An action that opens a menu, sheet or alert lists it in
data.surfaces. Target that overlay next. - After an async step, use
wait(seecommands-system.md). A fixed sleep is a race.
Refs
- Output refs are qualified:
@<snapshot_id>:e<N>, for example@s8f3k2p9:e1. Pass them to later commands as they are. - Refs are valid for one snapshot. After any UI change, re-drill the affected region or take a new snapshot.
- Only addressable elements get refs. Static text and inert containers do not.
STALE_REF: the ref no longer matches the live UI. Take a fresh snapshot and use the new ref.AMBIGUOUS_TARGET: more than one live element matches. Narrow the target withfind --role --name --exactor--root, then use the new ref.SNAPSHOT_NOT_FOUND: the snapshot id expired. Snapshot again.
Delivery and retry
Action results carry data.disposition and errors carry error.disposition, each with delivery and retry. Observation commands such as snapshot have none on success; their errors, and every INVALID_ARGS refusal, carry not_delivered and retry: safe.
- Retry or substitute an action only when
disposition.retryissafe. Onlynot_deliveredis safe. - Any other delivery value means the action may have landed. A repeat can click, type or submit twice, and
togglecan undo itself. - On a result that is not safe, read the live state (
get,is, or a fresh snapshot) and decide from that.details.post_statehelps when present. - Branch on
error.codeanderror.disposition. Message and suggestion text can change. details.retryable: falsemeans waiting cannot change the outcome. Try a different approach.
Headless and headed
Ref actions are headless by default. They use semantic accessibility calls and do not take focus, move the cursor, synthesize keys or use the clipboard. If no semantic path exists, the action fails closed. Use the global --headed flag only when the user explicitly permits physical input, such as double-click, hover, drag, or focus. Never switch to headed mode to recover from a headless failure. Raw coordinates (--xy) never imply focus. Which actions need --headed differs by OS: read the platform skill.
References
Load one only when you need it: agent-desktop skills get desktop <reference>.
| Reference | Open it when |
|---|---|
commands-observation |
You need snapshot, find, get, is, screenshot, list-surfaces semantics, partial trees, or the --root rules |
commands-interaction |
You choose between click, type, set-value, select, toggle, scroll, press and mouse commands, or you debug an action error |
commands-system |
You launch or close apps, manage windows, use the clipboard, wait, batch, sessions, multi-agent cursors, tracing, or load skills |
workflows |
You want worked patterns (forms, menus, dialogs, waiting for a new window, scroll-find, drag) and th |
Câu hỏi thường gặp
Công cụ trả về gì?
Mỗi lệnh in ra một kết quả JSON cho biết nó có thành công hay không, kèm dữ liệu hoặc lỗi.
Agent có kiểm tra máy tính trước không?
Có. Nó chạy một lệnh trạng thái để xem nền tảng, quyền và tính năng được hỗ trợ.
Trích dẫn có quan trọng trong PowerShell không?
Có. Tham chiếu phần tử nên đặt trong dấu nháy đơn, vì dấu @ không có dấu ngoặc có ý nghĩa đặc biệt trong PowerShell.
Chi tiết
Mô tả gốc của tác giả
Operate desktop applications on macOS, Windows and Linux through native accessibility trees, using the agent-desktop CLI. Use when an AI agent must see or act on a desktop GUI: click buttons, fill forms, read UI state, navigate menus, toggle checkboxes, scroll, drag, type text, press shortcuts, take screenshots, manage windows, use the clipboard, launch or close apps, read notifications. Triggers on: "click button", "fill form", "open app", "read UI", "computer use", "operate desktop", "accessibility tree", "snapshot app", "type into field", "navigate menu", "toggle checkbox", "take screenshot
repo: NanmiCoder/cc-haha
Độ phổ biến
- Sao GitHub
- 15k
- Vị trí xếp hạng
- #10917
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
agent-desktop-ffi
15kGiúp lập trình viên gọi thư viện tự động hóa agent-desktop trực tiếp từ Python, Swift, Node, Go hoặc C++, không cần chạy dòng lệnh cho mỗi thao tác.
agent-desktop-linux
15kDạy agent cách điều khiển ứng dụng desktop Linux bằng agent-desktop, gồm những gì chạy trên X11 và Wayland và cách sửa lỗi chạy lần đầu thường gặp.
agent-desktop-macos
15kChỉ cho agent cách tự động hóa ứng dụng Mac, gồm cấp quyền cần thiết và làm việc với menu, hộp thoại cùng ứng dụng Chromium hoặc Electron.
agent-desktop-windows
15kChỉ cho agent cách tự động hóa ứng dụng Windows: những gì hoạt động, trích dẫn trong PowerShell, cửa sổ thu nhỏ và giới hạn với ứng dụng nâng quyền.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.