cli-anything-macrocli
Skill này làm gì
Skill này cho phép agent AI liệt kê, kiểm tra và chạy các GUI macro, tức là workflow đã lưu với đầu vào có thể đặt. Nó dành cho người muốn các tác vụ ứng dụng thường lệ được thực hiện bằng một lệnh đáng tin cậy.
Khi nào nên dùng
- ✓Khi bạn muốn agent chạy một workflow desktop đã lưu với cài đặt cụ thể.
- ✓Khi bạn cần kiểm tra macro nào tồn tại và mỗi macro nhận đầu vào nào.
- ✓Khi bạn muốn chạy thử trước để xem một workflow sẽ làm gì mà không thay đổi gì.
Liên kết skill
https://github.com/HKUDS/CLI-Anything/blob/main/macrocli/agent-harness/cli_anything/macrocli/skills/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
“Tôi muốn chạy macro xuất của mình trên báo cáo Q3 và lưu kết quả vào thư mục Documents.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent gọi một lệnh với tên macro và đầu vào của nó, và hệ thống chọn cách tốt nhất để thực hiện từng bước. Chạy thử có thể hiển thị các bước trước.
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.
MacroCLI CLI
What It Is
The MacroCLI converts valuable GUI workflows into parameterized, CLI-callable macros. Agents never touch the GUI directly — they call macros through this stable CLI, and the runtime routes execution to the best available backend (native plugin/API, file transformation, semantic UI control, or precompiled GUI macro replay).
Installation
cd macrocli/agent-harness
pip install -e .
Requirements: Python 3.10+, PyYAML, click, prompt-toolkit.
Quick Start (for agents)
# 1. See what macros are available
cli-anything-macrocli macro list --json
# 2. Inspect a macro's parameters
cli-anything-macrocli macro info export_file --json
# 3. Dry-run to check params without side effects
cli-anything-macrocli --dry-run macro run export_file \
--param output=/tmp/test.txt --json
# 4. Execute a macro
cli-anything-macrocli macro run export_file \
--param output=/tmp/result.txt --json
# 5. See what backends are available
cli-anything-macrocli backends --json
Command Reference
Global Flags
| Flag | Description |
|---|---|
--json |
Machine-readable JSON output on stdout |
--dry-run |
Simulate all steps, skip side effects |
--session-id <id> |
Resume or create a named session |
macro group
| Command | Description |
|---|---|
macro list |
List all available macros |
macro info <name> |
Show macro schema (parameters, steps, conditions) |
macro run <name> --param k=v |
Execute a macro |
macro dry-run <name> --param k=v |
Simulate without side effects |
macro validate [name] |
Structural validation |
macro define <name> |
Scaffold a new macro YAML |
session group
| Command | Description |
|---|---|
session status |
Show session statistics |
session history |
Show recent run history |
session save |
Persist session to disk |
session list |
List all saved sessions |
backends
cli-anything-macrocli backends --json
# Shows: native_api, file_transform, semantic_ui, gui_macro, recovery
# and whether each is available in the current environment.
Macro Parameters
Pass parameters with --param key=value. Repeat for multiple:
cli-anything-macrocli macro run transform_json \
--param file=/path/to/data.json \
--param key=settings.theme \
--param value=dark \
--json
Output Format (--json)
All commands output JSON when --json is set:
{
"success": true,
"macro_name": "export_file",
"output": {
"exported_file": "/tmp/result.txt"
},
"error": "",
"telemetry": {
"duration_ms": 312,
"steps_total": 2,
"steps_run": 2,
"backends_used": ["native_api"],
"dry_run": false
}
}
On failure ("success": false), read the "error" field for the reason.
Exit code is 1 on failure.
Execution Backends
Backends are selected automatically based on the macro step definition:
| Backend | Triggered by | Use case |
|---|---|---|
native_api |
backend: native_api |
Subprocess / shell command |
file_transform |
backend: file_transform |
XML, JSON, text file editing |
semantic_ui |
backend: semantic_ui |
Accessibility / keyboard shortcuts |
gui_macro |
backend: gui_macro |
Precompiled coordinate replay |
recovery |
backend: recovery |
Retry / fallback orchestration |
Writing Macros
Macros are YAML files in cli_anything/macrocli/macro_definitions/.
Scaffold one with:
cli-anything-macrocli macro define my_macro --output \
cli_anything/macrocli/macro_definitions/examples/my_macro.yaml
Minimal schema:
name: my_macro
version: "1.0"
description: What this macro does.
parameters:
output:
type: string
required: true
description: Where to write results.
example: /tmp/result.txt
preconditions:
- file_exists: /path/to/input
steps:
- id: step1
backend: native_api
action: run_command
params:
command: [my-app, --export, "${output}"]
timeout_ms: 30000
on_failure: fail # or: skip, continue
postconditions:
- file_exists: ${output}
- file_size_gt: [${output}, 100]
outputs:
- name: result_file
path: ${output}
agent_hints:
danger_level: safe # safe | moderate | dangerous
side_effects: [creates_file]
reversible: true
Agent Usage Rules
- Always use
--jsonfor programmatic output. - Use
--dry-runto validate params
Câu hỏi thường gặp
Agent có tự bấm qua màn hình ứng dụng không?
Không. Skill cho biết agent gọi macro qua một dòng lệnh ổn định, còn runtime chọn cách thực hiện từng bước.
Tôi có thể kiểm tra macro trước khi nó thay đổi gì không?
Có. Skill mô tả tùy chọn dry-run mô phỏng các bước và bỏ qua tác dụng phụ.
Tôi cần cài gì để dùng nó?
Skill cần Python 3.10 trở lên và một vài gói Python hỗ trợ, cài từ thư mục harness.
Chi tiết
Mô tả gốc của tác giả
Use when the agent wants to define, list, inspect, or execute GUI macros via the MacroCLI CLI. Macros are parameterized, CLI-callable workflows — the agent invokes `macro run <name>` and the system handles backend routing (plugin, file transform, accessibility, compiled GUI replay).
repo: HKUDS/CLI-Anything
Độ phổ biến
- Sao GitHub
- 58k
- Vị trí xếp hạng
- #3221
- Giấy phép
- Apache-2.0
- Cập nhật
- 21/9/2026
Bình luận
- …
Thêm skill từ kho mã này
cli-anything-3mf
58kCho phép agent của bạn kiểm tra và sửa file in 3D, gồm tìm lỗ tròn, đổi kích thước chúng, sửa lưới và so sánh hai file.
cli-anything-qgis
58kCho phép agent của bạn mở, sửa và xuất dự án bản đồ QGIS từ terminal, gồm các lớp, đối tượng, bố cục in và công cụ xử lý.
cli-anything-adguardhome
58kCho phép agent của bạn quản lý AdGuard Home, một bộ chặn quảng cáo toàn mạng, gồm bộ lọc, DNS rewrite, thiết bị và nhật ký truy vấn.
cli-anything-anygen
58kCho phép agent của bạn tạo slide, tài liệu, website và sơ đồ từ một prompt bằng dịch vụ AnyGen.
Skill tương tự
knowledge-automation
394kGiúp agent của bạn thiết lập tác vụ định kỳ đưa nội dung mới vào kho Knowledge theo lịch, rồi kiểm tra tác vụ có chạy không.
knowledge-source-ingest
394kGiúp agent của bạn cập nhật Knowledge vault với các mục mới từ kênh chat, nguồn tin hoặc hộp thư, mà không thêm lại những gì đã có.
benchmark
280kGiúp agent của bạn đo tốc độ và hiệu suất của code, hữu ích để đảm bảo mọi thứ nhanh và tìm ra những chỗ chậm.