cli-anything
它能做什么
这个技能指导 AI 智能体为原本通过按钮和窗口运行的程序创建命令行接口。适合希望让智能体构建此类工具的开发者。
适用场景
- ✓当你想让智能体为你使用的桌面应用制作一个命令行版本的时候。
- ✓当你有一个源代码项目,想为它构建命令工具的时候。
- ✓当你想测试和检查智能体构建的命令行工具的时候。
技能链接
https://github.com/HKUDS/CLI-Anything/blob/main/reasonix-skill/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我为 GIMP 图片编辑器构建一个命令行工具,好让我的智能体使用它。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体读取方法指南,研究应用或代码仓库,并为该工具编写 Python 代码,包括测试。然后它会检查工具是否正常工作。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
CLI-Anything for Reasonix
Use this skill when the user wants Reasonix to act like the CLI-Anything builder.
Before implementation, use the full methodology source of truth when available:
- If the current workspace is the
CLI-Anythingrepository, readcli-anything-plugin/HARNESS.md. - If Reasonix is running from this adapter directory, also check
../cli-anything-plugin/HARNESS.md. - If neither local file is available, clone or download
cli-anything-pluginfromhttps://github.com/HKUDS/CLI-Anything/tree/main/cli-anything-plugin, then useHARNESS.mdand the resources around it from that folder. - Only if local and network retrieval both fail, follow the condensed rules below.
Inputs
Accept either:
- A local source path such as
./gimpor/path/to/software - A GitHub repository URL
Derive the software name from the local directory name after cloning if needed.
Reasonix Tool Bindings
Reasonix agents build harnesses by combining these built-in tools:
| Reasonix Tool | Role in Harness Workflow |
|---|---|
bash |
Run shell commands, install packages, execute CLI tools, run tests, clone repos |
write_file |
Generate Python files (Click CLI, backend modules, tests, setup.py) |
edit_file |
Make targeted edits to generated code (single replacement) |
multi_edit |
Apply multiple atomic edits to a single file in one pass |
read_file |
Read target software source files, existing harness code, test results |
grep |
Search for patterns across the target software codebase (APIs, CLI tools, data models) |
glob |
Find files matching patterns in the source tree (*.py, *.xml, *.json, etc.) |
ls |
List directory contents to understand project structure |
mcp__codegraph__search / mcp__codegraph__context |
Optional code graph analysis when CodeGraph is enabled (Reasonix strips the codegraph_ raw prefix, so the model-visible names omit it) |
web_fetch |
Fetch documentation, API references, or remote files from the web |
Recommended Workflow with Reasonix Tools
Phase 1 (Analysis) — Use ls + glob to survey the source tree, grep to find API surfaces and CLI entry points, and read_file to inspect key files. When CodeGraph is enabled and its tools are available, use mcp__codegraph__search and mcp__codegraph__context for deeper symbol and architecture analysis.
Phase 2-3 (Design & Implementation) — Use write_file to create new harness files, edit_file / multi_edit to refine generated code, and bash to run pip install -e . for installation.
Phase 4-6 (Testing) — Use bash to run pytest and capture results, read_file to inspect test output, and write_file to update TEST.md.
Phase 7 (Packaging) — Use write_file for setup.py, bash for pip install -e . and which cli-anything-<software> verification.
Step Budget
A full harness build typically requires 25–40 tool-call rounds (architecture inspection, 10+ file writes, installation, and multiple test runs). When invoked via run_skill, the subagent inherits a step budget derived from the parent agent's agent.max_steps setting in reasonix.toml:
- If
max_steps = 0(the default, meaning unlimited), the subagent also runs with no step cap — this is the recommended configuration for the CLI-Anything workflow. - If
max_stepsis set to a finite value, the subagent receives half that budget (minimum 5), which may truncate a complex build before completion.
Users who have configured a finite max_steps should ensure it is set to 0 or a sufficiently high value (e.g., 64 or more) before running a CLI-Anything build, so the subagent has enough rounds to complete all seven phases.
Modes
Build
Use when the user wants a new harness.
Produce this structure:
<repo-root>/
├── skills/
│ └── cli-anything-<software>/
│ └── SKILL.md
└── <software>/
└── agent-harness/
├── <SOFTWARE>.md
├── setup.py
└── cli_anything/
└── <software>/
├── README.md
├── __init__.py
├── __main__.py
├── <software>_cli.py
├── core/
├── utils/
├── tests/
└── skills/
└── SKILL.md
Implement a stateful Click CLI with:
- one-shot subcommands
- REPL mode as the default when no subcommand is given
--jsonmachine-readable output- session state
常见问题
这套方法从哪里来?
该技能指向 CLI-Anything 项目中的 HARNESS.md 指南,可以来自本地副本或 GitHub。
它需要 Reasonix 才能运行吗?
该技能是为 Reasonix 编写的适配器,而 Reasonix 是它运行所在的智能体环境。
它只适用于图形应用吗?
不是。它的输入可以是本地源代码路径或 GitHub 仓库,因此也适用于代码项目。
详情
作者的原始描述
Use when the user wants Reasonix to build, refine, test, or validate a CLI-Anything harness for a GUI application or source repository. Adapts the CLI-Anything methodology to Reasonix without changing the generated Python harness format.
repo: HKUDS/CLI-Anything
热度
- GitHub 星标
- 58k
- 排名
- #3239
- 许可证
- Apache-2.0
- 更新时间
- 2026/9/21
评论
- …
同一仓库的更多技能
cli-anything-3mf
58k帮你的智能体检查和修复 3D 打印文件,包括查找圆孔、调整孔径、修复网格,以及比较两个文件。
cli-anything-qgis
58k帮你的智能体在终端中打开、编辑和导出 QGIS 地图项目,包括图层、要素、打印布局和处理工具。
cli-anything-adguardhome
58k帮你的智能体管理 AdGuard Home,这是一款全网络广告拦截器,可管理过滤规则、DNS 重写、客户端和查询日志。
cli-anything-anygen
58k帮你的智能体借助 AnyGen 服务,根据文字提示生成幻灯片、文档、网站和图表。