mirror of
https://github.com/HKUDS/CLI-Anything.git
synced 2026-08-30 17:34:27 +08:00
Merge branch 'main' into feat/qodercli-plugin-support
This commit is contained in:
+4
-1
@@ -1,6 +1,7 @@
|
||||
# ============================================================
|
||||
# Only track:
|
||||
# - cli-anything-plugin/**
|
||||
# - codex-skill/**
|
||||
# - */agent-harness/** (under each software dir)
|
||||
# - .gitignore
|
||||
# Everything else is ignored.
|
||||
@@ -17,6 +18,7 @@
|
||||
|
||||
# Step 3: Allow cli-anything-plugin entirely
|
||||
!/cli-anything-plugin/
|
||||
!/codex-skill/
|
||||
|
||||
# Step 4: Allow each software dir (top level only)
|
||||
!/gimp/
|
||||
@@ -90,4 +92,5 @@
|
||||
assets/gen_typing_gif.py
|
||||
!README_CN.md
|
||||
!opencode-commands/
|
||||
!/qoder-plugin/
|
||||
!/qoder-plugin/
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ CLI is the universal interface for both humans and AI agents:
|
||||
|
||||
- **Python 3.10+**
|
||||
- Target software installed (e.g., GIMP, Blender, LibreOffice, or your own application)
|
||||
- A supported AI coding agent: [Claude Code](#-claude-code) | [OpenCode](#-opencode) | [Qodercli](#-qodercli) | [More Platforms](#-more-platforms-coming-soon)
|
||||
- A supported AI coding agent: [Claude Code](#-claude-code) | [OpenCode](#-opencode) | [Codex](#-codex) | [Qodercli](#-qodercli) | [More Platforms](#-more-platforms-coming-soon)
|
||||
|
||||
### Pick Your Platform
|
||||
|
||||
@@ -135,7 +135,7 @@ cp -r CLI-Anything/cli-anything-plugin ~/.claude/plugins/cli-anything
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><h4 id="-opencode">⚡ OpenCode</h4></summary>
|
||||
<summary><h4 id="-opencode">⚡ OpenCode (Experimental)</h4></summary>
|
||||
|
||||
**Step 1: Install the Commands**
|
||||
|
||||
@@ -183,6 +183,7 @@ The command runs as a subtask and follows the same 7-phase methodology as Claude
|
||||
</details>
|
||||
|
||||
<details>
|
||||
|
||||
<summary><h4 id="-qodercli">⚡ Qodercli</h4></summary>
|
||||
|
||||
**Step 1: Register the Plugin**
|
||||
@@ -201,7 +202,39 @@ This registers the cli-anything plugin in `~/.qoder.json`. Start a new Qodercli
|
||||
/cli-anything:refine ./gimp "batch processing and filters"
|
||||
/cli-anything:validate ./gimp
|
||||
```
|
||||
</details>
|
||||
|
||||
<summary><h4 id="-codex">⚡ Codex <sup><code>Experimental</code></sup> <sup><code>Community</code></sup></h4></summary>
|
||||
|
||||
**Step 1: Install the Skill**
|
||||
|
||||
Run the bundled installer:
|
||||
|
||||
```bash
|
||||
# Clone the repo
|
||||
git clone https://github.com/HKUDS/CLI-Anything.git
|
||||
|
||||
# Install the skill
|
||||
bash CLI-Anything/codex-skill/scripts/install.sh
|
||||
```
|
||||
|
||||
This installs the skill to `$CODEX_HOME/skills/cli-anything` (or `~/.codex/skills/cli-anything` if `CODEX_HOME` is unset).
|
||||
|
||||
Restart Codex after installation so it is discovered.
|
||||
|
||||
**Step 2: Use CLI-Anything from Codex**
|
||||
|
||||
Describe the task in natural language, for example:
|
||||
|
||||
```text
|
||||
Use CLI-Anything to build a harness for ./gimp
|
||||
Use CLI-Anything to refine ./shotcut for picture-in-picture workflows
|
||||
Use CLI-Anything to validate ./libreoffice
|
||||
```
|
||||
|
||||
The Codex skill adapts the same methodology used by the Claude Code plugin and
|
||||
OpenCode commands, while keeping the generated Python harness format unchanged.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
@@ -209,6 +242,7 @@ This registers the cli-anything plugin in `~/.qoder.json`. Start a new Qodercli
|
||||
|
||||
CLI-Anything is designed to be platform-agnostic. Support for more AI coding agents is planned:
|
||||
|
||||
- **Codex** — available via the bundled skill in `codex-skill/`
|
||||
- **Cursor** — coming soon
|
||||
- **Windsurf** — coming soon
|
||||
- **Your favorite tool** — contributions welcome! See the `opencode-commands/` directory for a reference implementation.
|
||||
@@ -539,6 +573,7 @@ cli-anything/
|
||||
│ └── scripts/
|
||||
│ └── setup-cli-anything.sh # Setup script
|
||||
│
|
||||
├── 🤖 codex-skill/ # Codex skill entry point
|
||||
├── 🎨 gimp/agent-harness/ # GIMP CLI (107 tests)
|
||||
├── 🧊 blender/agent-harness/ # Blender CLI (208 tests)
|
||||
├── ✏️ inkscape/agent-harness/ # Inkscape CLI (202 tests)
|
||||
@@ -717,6 +752,12 @@ We welcome contributions! CLI-Anything is designed to be extensible:
|
||||
- **Plugin enhancements** — New commands, phase improvements, better validation
|
||||
- **Test coverage** — More E2E scenarios, edge cases, workflow tests
|
||||
|
||||
### Limitations
|
||||
|
||||
- **Requires strong foundation models** — CLI-Anything relies on frontier-class models (e.g., Claude Opus 4.6, Claude Sonnet 4.6, GPT-5.4) for reliable harness generation. Weaker or smaller models may produce incomplete or incorrect CLIs that require significant manual correction.
|
||||
- **Relies on available source code** — The 7-phase pipeline analyzes and generates from source code. When the target software only provides compiled binaries that require decompilation, harness quality and coverage will degrade substantially.
|
||||
- **May require iterative refinement** — A single `/cli-anything` run may not fully cover all capabilities. Running `/refine` one or more times is often needed to push the CLI's performance and coverage to production quality.
|
||||
|
||||
### Roadmap
|
||||
|
||||
- [ ] Support for more application categories (CAD, DAW, IDE, EDA, scientific tools)
|
||||
|
||||
+43
-3
@@ -56,7 +56,7 @@ CLI 是人类和 AI Agent 共通的万能接口:
|
||||
|
||||
- **Python 3.10+**
|
||||
- 目标软件已安装(如 GIMP、Blender、LibreOffice 或你自己的应用)
|
||||
- 支持的 AI 编程工具之一:[Claude Code](#-claude-code) | [OpenCode](#-opencode) | [Qodercli](#-qodercli) | [更多平台](#-更多平台即将支持)
|
||||
- 支持的 AI 编程工具之一:[Claude Code](#-claude-code) | [OpenCode](#-opencode) | [Codex](#-codex) | [Qodercli](#-qodercli) | [更多平台](#-更多平台即将支持)
|
||||
|
||||
### 选择你的平台
|
||||
|
||||
@@ -135,7 +135,7 @@ cp -r CLI-Anything/cli-anything-plugin ~/.claude/plugins/cli-anything
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><h4 id="-opencode">⚡ OpenCode</h4></summary>
|
||||
<summary><h4 id="-opencode">⚡ OpenCode (实验性支持)</h4></summary>
|
||||
|
||||
**第一步:安装命令**
|
||||
|
||||
@@ -183,6 +183,7 @@ cp CLI-Anything/cli-anything-plugin/HARNESS.md .opencode/commands/
|
||||
</details>
|
||||
|
||||
<details>
|
||||
|
||||
<summary><h4 id="-qodercli">⚡ Qodercli</h4></summary>
|
||||
|
||||
**第一步:注册插件**
|
||||
@@ -201,6 +202,38 @@ bash CLI-Anything/qoder-plugin/setup-qodercli.sh
|
||||
/cli-anything:refine ./gimp "批处理和滤镜"
|
||||
/cli-anything:validate ./gimp
|
||||
```
|
||||
</details>
|
||||
|
||||
<summary><h4 id="-codex">⚡ Codex <sup><code>实验性</code></sup> <sup><code>社区贡献</code></sup></h4></summary>
|
||||
|
||||
**第一步:安装 Skill**
|
||||
|
||||
运行仓库内置的安装脚本:
|
||||
|
||||
```bash
|
||||
# 克隆仓库
|
||||
git clone https://github.com/HKUDS/CLI-Anything.git
|
||||
|
||||
# 安装 skill
|
||||
bash CLI-Anything/codex-skill/scripts/install.sh
|
||||
```
|
||||
|
||||
脚本会把 skill 安装到 `$CODEX_HOME/skills/cli-anything`;如果没有设置 `CODEX_HOME`,则默认安装到 `~/.codex/skills/cli-anything`。
|
||||
|
||||
安装后重启 Codex,让它重新发现这个 skill。
|
||||
|
||||
**第二步:在 Codex 里使用 CLI-Anything**
|
||||
|
||||
直接用自然语言描述任务,例如:
|
||||
|
||||
```text
|
||||
Use CLI-Anything to build a harness for ./gimp
|
||||
Use CLI-Anything to refine ./shotcut for picture-in-picture workflows
|
||||
Use CLI-Anything to validate ./libreoffice
|
||||
```
|
||||
|
||||
这个 Codex skill 复用了 Claude Code 插件和 OpenCode 命令所使用的同一套方法论,
|
||||
不会改变生成出来的 Python harness 结构。
|
||||
|
||||
</details>
|
||||
|
||||
@@ -209,6 +242,7 @@ bash CLI-Anything/qoder-plugin/setup-qodercli.sh
|
||||
|
||||
CLI-Anything 的设计是平台无关的,计划支持更多 AI 编程工具:
|
||||
|
||||
- **Codex** — 已通过 `codex-skill/` 提供接入
|
||||
- **Cursor** — 即将支持
|
||||
- **Windsurf** — 即将支持
|
||||
- **你喜欢的工具** — 欢迎贡献!参考 `opencode-commands/` 目录的实现。
|
||||
@@ -554,6 +588,7 @@ cli-anything/
|
||||
│ ├── cli-anything-validate.md # 标准验证
|
||||
│ └── cli-anything-list.md # 列出所有 CLI 工具
|
||||
│
|
||||
├── 🤖 codex-skill/ # Codex skill 接入层
|
||||
├── 🎨 gimp/agent-harness/ # GIMP CLI(107 项测试)
|
||||
├── 🧊 blender/agent-harness/ # Blender CLI(208 项测试)
|
||||
├── ✏️ inkscape/agent-harness/ # Inkscape CLI(202 项测试)
|
||||
@@ -747,6 +782,12 @@ CLI_ANYTHING_FORCE_INSTALLED=1 python3 -m pytest cli_anything/<软件名>/tests/
|
||||
- **插件增强** — 新命令、阶段优化、更好的验证逻辑
|
||||
- **测试覆盖** — 更多端到端场景、边界情况、工作流测试
|
||||
|
||||
### 已知局限
|
||||
|
||||
- **依赖强大的基础模型** — CLI-Anything 依赖前沿级别的模型(如 Claude Opus 4.6、Claude Sonnet 4.6、GPT-5.4)才能可靠地生成 harness。较弱或较小的模型可能产出不完整或有误的 CLI,需要大量人工修正。
|
||||
- **依赖可用的源代码** — `/cli-anything` 基于源码进行分析和生成。如果目标软件只提供编译后的二进制文件,需要反编译才能获取代码,harness 的质量和覆盖率会显著下降。
|
||||
- **可能需要迭代优化** — 单次 `/cli-anything` 运行不一定能完整覆盖所有功能。通常需要执行一次或多次 `/refine` 命令,才能将 CLI 的性能和覆盖率推到生产级水平。
|
||||
|
||||
---
|
||||
|
||||
## 📖 文档
|
||||
@@ -805,4 +846,3 @@ MIT License — 可自由使用、修改和分发。
|
||||
<em>感谢访问 ✨ CLI-Anything!</em><br><br>
|
||||
<img src="https://visitor-badge.laobi.icu/badge?page_id=HKUDS.CLI-Anything&style=for-the-badge&color=00d4ff" alt="Views">
|
||||
</p>
|
||||
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
---
|
||||
name: cli-anything
|
||||
description: Use when the user wants Codex to build, refine, test, or validate a CLI-Anything harness for a GUI application or source repository. Adapts the CLI-Anything methodology to Codex without changing the generated Python harness format.
|
||||
---
|
||||
|
||||
# CLI-Anything for Codex
|
||||
|
||||
Use this skill when the user wants Codex 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:
|
||||
|
||||
```text
|
||||
<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
|
||||
@@ -0,0 +1,4 @@
|
||||
interface:
|
||||
display_name: "CLI-Anything"
|
||||
short_description: "Build or refine CLI-Anything harnesses from Codex."
|
||||
default_prompt: "Use CLI-Anything to build, refine, test, or validate a harness for the user's target software or source repository."
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
SKILL_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
||||
DEST_ROOT="${CODEX_HOME:-$HOME/.codex}/skills"
|
||||
DEST_DIR="${DEST_ROOT}/cli-anything"
|
||||
|
||||
mkdir -p "${DEST_ROOT}"
|
||||
|
||||
if [[ -e "${DEST_DIR}" ]]; then
|
||||
echo "Refusing to overwrite existing skill: ${DEST_DIR}" >&2
|
||||
echo "Remove it manually if you want to reinstall." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cp -R "${SKILL_DIR}" "${DEST_DIR}"
|
||||
|
||||
echo "Installed Codex skill to: ${DEST_DIR}"
|
||||
echo "Restart Codex to pick up the new skill."
|
||||
Reference in New Issue
Block a user