跳到正文
Skillpedia
通用编程58k · #3239

cli-anything

它能做什么

这个技能指导 AI 智能体为原本通过按钮和窗口运行的程序创建命令行接口。适合希望让智能体构建此类工具的开发者。

适用场景

  • ✓当你想让智能体为你使用的桌面应用制作一个命令行版本的时候。
  • ✓当你有一个源代码项目,想为它构建命令工具的时候。
  • ✓当你想测试和检查智能体构建的命令行工具的时候。

技能链接

https://github.com/HKUDS/CLI-Anything/blob/main/reasonix-skill/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/HKUDS/CLI-Anything/blob/main/reasonix-skill/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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:

  1. If the current workspace is the CLI-Anything repository, read cli-anything-plugin/HARNESS.md.
  2. If Reasonix is running from this adapter directory, also check ../cli-anything-plugin/HARNESS.md.
  3. If neither local file is available, clone or download cli-anything-plugin from https://github.com/HKUDS/CLI-Anything/tree/main/cli-anything-plugin, then use HARNESS.md and the resources around it from that folder.
  4. Only if local and network retrieval both fail, follow the condensed rules below.

Inputs

Accept either:

  • A local source path such as ./gimp or /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_steps is 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
  • --json machine-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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能