Skip to content

"CLI-Anything: Making ALL Software Agent-Native" -- CLI-Hub: https://clianything.cc/

Python

Add Codex skill integration

mortye81607efecc1
diff --git a/.gitignore b/.gitignore
index bfeb417e0..1870595ad 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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/
@@ -89,4 +91,4 @@
assets/gen_typing_gif.py
!README_CN.md
-!opencode-commands/
\ No newline at end of file
+!opencode-commands/
diff --git a/README.md b/README.md
index 906e2e180..0f40d8294 100644
--- a/README.md
+++ b/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) | [More Platforms](#-more-platforms-coming-soon)
+- A supported AI coding agent: [Claude Code](#-claude-code) | [OpenCode](#-opencode) | [Codex](#-codex) | [More Platforms](#-more-platforms-coming-soon)
### Pick Your Platform
@@ -182,11 +182,46 @@ The command runs as a subtask and follows the same 7-phase methodology as Claude
</details>
+<details>
+<summary><h4 id="-codex">⚡ Codex</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>
<summary><h4 id="-more-platforms-coming-soon">🔮 More Platforms (Coming Soon)</h4></summary>
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.
@@ -517,6 +552,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)
diff --git a/README_CN.md b/README_CN.md
index 09cef2fc1..ec4a53bbd 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -56,7 +56,7 @@ CLI 是人类和 AI Agent 共通的万能接口:
- **Python 3.10+**
- 目标软件已安装(如 GIMP、Blender、LibreOffice 或你自己的应用)
-- 支持的 AI 编程工具之一:[Claude Code](#-claude-code) | [OpenCode](#-opencode) | [更多平台](#-更多平台即将支持)
+- 支持的 AI 编程工具之一:[Claude Code](#-claude-code) | [OpenCode](#-opencode) | [Codex](#-codex) | [更多平台](#-更多平台即将支持)
### 选择你的平台
@@ -182,11 +182,46 @@ cp CLI-Anything/cli-anything-plugin/HARNESS.md .opencode/commands/
</details>
+<details>
+<summary><h4 id="-codex">⚡ Codex</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>
+
<details>
<summary><h4 id="-更多平台即将支持">🔮 更多平台(即将支持)</h4></summary>
CLI-Anything 的设计是平台无关的,计划支持更多 AI 编程工具:
+- **Codex** — 已通过 `codex-skill/` 提供接入
- **Cursor** — 即将支持
- **Windsurf** — 即将支持
- **你喜欢的工具** — 欢迎贡献!参考 `opencode-commands/` 目录的实现。
@@ -532,6 +567,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 项测试)
@@ -783,4 +819,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>
-
diff --git a/codex-skill/SKILL.md b/codex-skill/SKILL.md
new file mode 100644
index 000000000..5d674e160
--- /dev/null
+++ b/codex-skill/SKILL.md
@@ -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
diff --git a/codex-skill/agents/openai.yaml b/codex-skill/agents/openai.yaml
new file mode 100644
index 000000000..7b0f71a60
--- /dev/null
+++ b/codex-skill/agents/openai.yaml
@@ -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."
diff --git a/codex-skill/scripts/install.sh b/codex-skill/scripts/install.sh
new file mode 100755
index 000000000..3c4c0f5f9
--- /dev/null
+++ b/codex-skill/scripts/install.sh
@@ -0,0 +1,15 @@
+#!/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}"
+rm -rf "${DEST_DIR}"
+cp -R "${SKILL_DIR}" "${DEST_DIR}"
+
+echo "Installed Codex skill to: ${DEST_DIR}"
+echo "Restart Codex to pick up the new skill."