mirror of
https://fastgit.cc/github.com/HKUDS/CLI-Anything
synced 2026-04-20 21:00:28 +08:00
docs: fix opencode command typo and officially document OpenClaw integration
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -19,6 +19,7 @@
|
||||
# Step 3: Allow cli-anything-plugin entirely
|
||||
!/cli-anything-plugin/
|
||||
!/codex-skill/
|
||||
!/openclaw-skill/
|
||||
|
||||
# Step 4: Allow each software dir (top level only)
|
||||
!/gimp/
|
||||
|
||||
29
README.md
29
README.md
@@ -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) | [Codex](#-codex) | [Qodercli](#-qodercli) | [More Platforms](#-more-platforms-coming-soon)
|
||||
- A supported AI coding agent: [Claude Code](#-claude-code) | [OpenClaw](#-openclaw) | [OpenCode](#-opencode) | [Codex](#-codex) | [Qodercli](#-qodercli) | [More Platforms](#-more-platforms-coming-soon)
|
||||
|
||||
### Pick Your Platform
|
||||
|
||||
@@ -211,6 +211,33 @@ This registers the cli-anything plugin in `~/.qoder.json`. Start a new Qodercli
|
||||
|
||||
<details>
|
||||
|
||||
<summary><h4 id="-openclaw">⚡ OpenClaw</h4></summary>
|
||||
|
||||
**Step 1: Install the Skill**
|
||||
|
||||
CLI-Anything provides a native OpenClaw `SKILL.md` file. Copy it to your OpenClaw skills directory:
|
||||
|
||||
```bash
|
||||
# Clone the repo
|
||||
git clone https://github.com/HKUDS/CLI-Anything.git
|
||||
|
||||
# Install to the global skills folder
|
||||
mkdir -p ~/.openclaw/skills/cli-anything
|
||||
cp CLI-Anything/openclaw-skill/SKILL.md ~/.openclaw/skills/cli-anything/SKILL.md
|
||||
```
|
||||
|
||||
**Step 2: Build a CLI**
|
||||
|
||||
Now you can invoke the skill inside OpenClaw:
|
||||
|
||||
`@cli-anything build a CLI for ./gimp`
|
||||
|
||||
The skill follows the same 7-phase methodology as Claude Code and OpenCode.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
|
||||
<summary><h4 id="-codex">⚡ Codex <sup><code>Experimental</code></sup> <sup><code>Community</code></sup></h4></summary>
|
||||
|
||||
**Step 1: Install the Skill**
|
||||
|
||||
41
README_CN.md
41
README_CN.md
@@ -56,7 +56,7 @@ CLI 是人类和 AI Agent 共通的万能接口:
|
||||
|
||||
- **Python 3.10+**
|
||||
- 目标软件已安装(如 GIMP、Blender、LibreOffice 或你自己的应用)
|
||||
- 支持的 AI 编程工具之一:[Claude Code](#-claude-code) | [OpenCode](#-opencode) | [Codex](#-codex) | [Qodercli](#-qodercli) | [更多平台](#-更多平台即将支持)
|
||||
- 支持的 AI 编程工具之一:[Claude Code](#-claude-code) | [OpenClaw](#-openclaw) | [OpenCode](#-opencode) | [Codex](#-codex) | [Qodercli](#-qodercli) | [更多平台](#-更多平台即将支持)
|
||||
|
||||
### 选择你的平台
|
||||
|
||||
@@ -151,12 +151,12 @@ cp -r CLI-Anything/cli-anything-plugin ~/.claude/plugins/cli-anything
|
||||
git clone https://github.com/HKUDS/CLI-Anything.git
|
||||
|
||||
# 全局安装(所有项目可用)
|
||||
cp CLI-Anything/opencode-commands/*.md ~/.config/opencode/commands/
|
||||
cp CLI-Anything/cli-anything-plugin/HARNESS.md ~/.config/opencode/commands/
|
||||
cp CLI-Anything/opencode-commands/*.md ~/.config/opencode/command/
|
||||
cp CLI-Anything/cli-anything-plugin/HARNESS.md ~/.config/opencode/command/
|
||||
|
||||
# 或项目级安装
|
||||
cp CLI-Anything/opencode-commands/*.md .opencode/commands/
|
||||
cp CLI-Anything/cli-anything-plugin/HARNESS.md .opencode/commands/
|
||||
cp CLI-Anything/opencode-commands/*.md .opencode/command/
|
||||
cp CLI-Anything/cli-anything-plugin/HARNESS.md .opencode/command/
|
||||
```
|
||||
|
||||
> **注意:** `HARNESS.md` 是所有命令引用的方法论规范,必须和命令文件放在同一目录下。
|
||||
@@ -211,6 +211,33 @@ bash CLI-Anything/qoder-plugin/setup-qodercli.sh
|
||||
|
||||
<details>
|
||||
|
||||
<summary><h4 id="-openclaw">⚡ OpenClaw</h4></summary>
|
||||
|
||||
**第一步:安装 Skill**
|
||||
|
||||
CLI-Anything 提供了原生的 OpenClaw `SKILL.md` 文件。请将其复制到你的 OpenClaw 技能目录:
|
||||
|
||||
```bash
|
||||
# Clone the repo
|
||||
git clone https://github.com/HKUDS/CLI-Anything.git
|
||||
|
||||
# Install to the global skills folder
|
||||
mkdir -p ~/.openclaw/skills/cli-anything
|
||||
cp CLI-Anything/openclaw-skill/SKILL.md ~/.openclaw/skills/cli-anything/SKILL.md
|
||||
```
|
||||
|
||||
**第二步:构建 CLI**
|
||||
|
||||
安装完成后,你就可以在 OpenClaw 中直接调用:
|
||||
|
||||
`@cli-anything build a CLI for ./gimp`
|
||||
|
||||
该技能采用了与 Claude Code 和 OpenCode 一致的 7 步构建流程。
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
|
||||
<summary><h4 id="-codex">⚡ Codex <sup><code>实验性</code></sup> <sup><code>社区贡献</code></sup></h4></summary>
|
||||
|
||||
**第一步:安装 Skill**
|
||||
@@ -751,8 +778,8 @@ git clone https://github.com/HKUDS/CLI-Anything.git
|
||||
|
||||
# 请确保使用最新 OpenCode,旧版本可能使用不同的命令目录路径
|
||||
# 复制命令和 HARNESS.md 到 OpenCode 命令目录
|
||||
cp CLI-Anything/opencode-commands/*.md ~/.config/opencode/commands/
|
||||
cp CLI-Anything/cli-anything-plugin/HARNESS.md ~/.config/opencode/commands/
|
||||
cp CLI-Anything/opencode-commands/*.md ~/.config/opencode/command/
|
||||
cp CLI-Anything/cli-anything-plugin/HARNESS.md ~/.config/opencode/command/
|
||||
|
||||
# 为任何有代码库的软件生成 CLI
|
||||
/cli-anything <软件路径或仓库>
|
||||
|
||||
37
README_JA.md
37
README_JA.md
@@ -56,7 +56,7 @@ CLIは人間とAIエージェント両方にとって普遍的なインターフ
|
||||
|
||||
- **Python 3.10+**
|
||||
- 対象ソフトウェアがインストール済みであること(例:GIMP、Blender、LibreOffice、または独自のアプリケーション)
|
||||
- サポートされているAIコーディングエージェント: [Claude Code](#-claude-code) | [OpenCode](#-opencode) | [Codex](#-codex) | [Qodercli](#-qodercli) | [その他のプラットフォーム](#-その他のプラットフォーム近日公開)
|
||||
- サポートされているAIコーディングエージェント: [Claude Code](#-claude-code) | [OpenClaw](#-openclaw) | [OpenCode](#-opencode) | [Codex](#-codex) | [Qodercli](#-qodercli) | [その他のプラットフォーム](#-その他のプラットフォーム近日公開)
|
||||
|
||||
### プラットフォームを選択
|
||||
|
||||
@@ -146,12 +146,12 @@ CLI-Anythingのコマンド**と** `HARNESS.md` をOpenCodeのコマンドディ
|
||||
git clone https://github.com/HKUDS/CLI-Anything.git
|
||||
|
||||
# グローバルインストール(すべてのプロジェクトで利用可能)
|
||||
cp CLI-Anything/opencode-commands/*.md ~/.config/opencode/commands/
|
||||
cp CLI-Anything/cli-anything-plugin/HARNESS.md ~/.config/opencode/commands/
|
||||
cp CLI-Anything/opencode-commands/*.md ~/.config/opencode/command/
|
||||
cp CLI-Anything/cli-anything-plugin/HARNESS.md ~/.config/opencode/command/
|
||||
|
||||
# またはプロジェクトレベルのインストール
|
||||
cp CLI-Anything/opencode-commands/*.md .opencode/commands/
|
||||
cp CLI-Anything/cli-anything-plugin/HARNESS.md .opencode/commands/
|
||||
cp CLI-Anything/opencode-commands/*.md .opencode/command/
|
||||
cp CLI-Anything/cli-anything-plugin/HARNESS.md .opencode/command/
|
||||
```
|
||||
|
||||
> **注:** `HARNESS.md`はすべてのコマンドが参照する方法論の仕様書です。コマンドと同じディレクトリに配置する必要があります。
|
||||
@@ -206,6 +206,33 @@ bash CLI-Anything/qoder-plugin/setup-qodercli.sh
|
||||
|
||||
<details>
|
||||
|
||||
<summary><h4 id="-openclaw">⚡ OpenClaw</h4></summary>
|
||||
|
||||
**ステップ1: スキルのインストール**
|
||||
|
||||
CLI-Anything はネイティブな OpenClaw `SKILL.md` ファイルを提供しています。OpenClaw のスキルディレクトリにコピーしてください:
|
||||
|
||||
```bash
|
||||
# リポジトリをクローン
|
||||
git clone https://github.com/HKUDS/CLI-Anything.git
|
||||
|
||||
# グローバルスキルフォルダにインストール
|
||||
mkdir -p ~/.openclaw/skills/cli-anything
|
||||
cp CLI-Anything/openclaw-skill/SKILL.md ~/.openclaw/skills/cli-anything/SKILL.md
|
||||
```
|
||||
|
||||
**ステップ2: CLIの構築**
|
||||
|
||||
インストール後、OpenClaw 内で以下のようにスキルを呼び出せます:
|
||||
|
||||
`@cli-anything build a CLI for ./gimp`
|
||||
|
||||
このスキルは Claude Code や OpenCode と同じ7段階の方法論に従っています。
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
|
||||
<summary><h4 id="-codex">⚡ Codex <sup><code>実験的</code></sup> <sup><code>コミュニティ</code></sup></h4></summary>
|
||||
|
||||
**ステップ1: スキルのインストール**
|
||||
|
||||
110
openclaw-skill/SKILL.md
Normal file
110
openclaw-skill/SKILL.md
Normal file
@@ -0,0 +1,110 @@
|
||||
---
|
||||
name: cli-anything
|
||||
description: 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.
|
||||
---
|
||||
|
||||
# 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:
|
||||
|
||||
```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
|
||||
Reference in New Issue
Block a user