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

cli-anything

它能做什么

这个技能让 OpenClaw 充当命令行工具的构建者,这些工具用于封装桌面软件或代码仓库。适合希望 AI 智能体通过命令行控制软件的开发者。

适用场景

  • ✓当你想让 OpenClaw 为桌面应用构建一个命令行工具的时候。
  • ✓当你想为现有封装工具添加新功能的时候。
  • ✓当你想根据检查清单验证一个封装工具的时候。

技能链接

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

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“请帮我为这个 GIMP 文件夹构建一个命令行封装工具,并按照验证清单进行检查。”

每周 5 个新技能,1 分钟读完。

工作原理

这个技能在可用时从其仓库中读取 CLI-Anything 方法论,并遵循其构建规则。如果无法获得完整方法论,它会改用精简规则。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

CLI-Anything for OpenClaw

Use this skill when the user wants OpenClaw to act like the CLI-Anything builder.

If this skill is being used from inside the CLI-Anything repository, read ../cli-anything-plugin/HARNESS.md before implementation. That file is the full methodology source of truth. If it is not available, 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.

Modes

Build

Use when the user wants a new harness.

Produce this structure:

<software>/
└── agent-harness/
    ├── <SOFTWARE>.md
    ├── setup.py
    └── cli_anything/
        └── <software>/
            ├── README.md
            ├── __init__.py
            ├── __main__.py
            ├── <software>_cli.py
            ├── core/
            ├── utils/
            └── tests/

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 with undo/redo where the target software supports it

Refine

Use when the harness already exists.

First inventory current commands and tests, then do gap analysis against the target software. Prefer:

  • high-impact missing features
  • easy wrappers around existing backend APIs or CLIs
  • additions that compose well with existing commands

Do not remove existing commands unless the user explicitly asks for a breaking change.

Test

Plan tests before writing them. Keep both:

  • test_core.py for unit coverage
  • test_full_e2e.py for workflow and backend validation

When possible, test the installed command via subprocess using cli-anything-<software> rather than only module imports.

Validate

Check that the harness:

  • uses the cli_anything.<software> namespace package layout
  • has an installable setup.py entry point
  • supports JSON output
  • has a REPL default path
  • documents usage and tests

Backend Rules

Prefer the real software backend over reimplementation. Wrap the actual executable or scripting interface in utils/<software>_backend.py when possible. Use synthetic reimplementation only when the project explicitly requires it or no viable native backend exists.

Packaging Rules

  • Use find_namespace_packages(include=["cli_anything.*"])
  • Keep cli_anything/ as a namespace package without a top-level __init__.py
  • Expose cli-anything-<software> through console_scripts

Workflow

  1. Acquire the source tree locally.
  2. Analyze architecture, data model, existing CLIs, and GUI-to-API mappings.
  3. Design command groups and state model.
  4. Implement the harness.
  5. Write TEST.md, then tests, then run them.
  6. Update README usage docs.
  7. Verify local installation with pip install -e .

Output Expectations

When reporting progress or final results, include:

  • target software and source path
  • files added or changed
  • validation commands run
  • open risks or backend limitations
常见问题

方法论从哪里来?

当该文件在附近或可以下载时,它会使用 CLI-Anything 方法论文件。

它会改变输出格式吗?

不会,它会让生成的 Python 封装格式与合集中的其他工具保持一致。

它可以接受 GitHub 链接吗?

可以,你可以提供 GitHub 仓库网址作为源代码。

详情

作者的原始描述

Use when the user wants OpenClaw to build, refine, test, or validate a CLI-Anything harness for a GUI application or source repository. Adapts the CLI-Anything methodology to OpenClaw without changing the generated Python harness format.

repo: HKUDS/CLI-Anything

热度

GitHub 星标
58k
排名
#3220
许可证
Apache-2.0
更新时间
2026/9/21

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能