|
| 1 | +--- |
| 2 | +name: cli-anything |
| 3 | +description: Generate or refine agent-usable CLIs for existing software/codebases using the CLI-Anything methodology. Use when the user wants to turn a GUI app, desktop tool, repository, SDK, or web/API surface into a structured CLI for agents; when adapting CLI-Anything into OpenClaw workflows; or when packaging a generated harness as an OpenClaw-compatible skill. |
| 4 | +--- |
| 5 | + |
| 6 | +# CLI-Anything |
| 7 | + |
| 8 | +Use this skill to work with the local `CLI-Anything/` repository in the workspace and turn its methodology into something usable from OpenClaw. |
| 9 | + |
| 10 | +## What this skill is for |
| 11 | + |
| 12 | +Use it for three common cases: |
| 13 | + |
| 14 | +1. **Assess feasibility** — inspect a target app/repo and decide whether CLI-Anything is a good fit. |
| 15 | +2. **Use an existing harness** — work with one of the repo's prebuilt `agent-harness` examples. |
| 16 | +3. **Wrap for OpenClaw** — turn CLI-Anything guidance or an existing harness into an OpenClaw skill/workflow. |
| 17 | + |
| 18 | +## Local source of truth |
| 19 | + |
| 20 | +The repository is expected at: |
| 21 | + |
| 22 | +- `/root/.openclaw/workspace/CLI-Anything` |
| 23 | + |
| 24 | +Read these first when needed: |
| 25 | + |
| 26 | +- `CLI-Anything/README.md` — overall platform and examples |
| 27 | +- `CLI-Anything/cli-anything-plugin/HARNESS.md` — generation methodology and quality bar |
| 28 | +- `CLI-Anything/cli-anything-plugin/README.md` — plugin behavior and expected output layout |
| 29 | + |
| 30 | +For a fast survey of bundled examples, read `references/bundled-harnesses.md`. |
| 31 | + |
| 32 | +## Core workflow |
| 33 | + |
| 34 | +### 1) Classify the user's request |
| 35 | + |
| 36 | +Decide which path applies: |
| 37 | + |
| 38 | +- **Methodology request**: user wants to understand or apply CLI-Anything generally |
| 39 | +- **Existing harness request**: user wants to use/demo one of the included examples like GIMP or LibreOffice |
| 40 | +- **Packaging request**: user wants an OpenClaw skill or ClawHub package derived from CLI-Anything |
| 41 | + |
| 42 | +### 2) Inspect prerequisites |
| 43 | + |
| 44 | +Before promising execution, check: |
| 45 | + |
| 46 | +- Python 3.10+ |
| 47 | +- target software presence if using a real harness backend |
| 48 | +- whether the request is about: |
| 49 | + - building a harness |
| 50 | + - running a generated CLI |
| 51 | + - packaging/publishing |
| 52 | + |
| 53 | +### 3) Prefer existing harnesses before generation |
| 54 | + |
| 55 | +If the repo already includes a matching harness under `<software>/agent-harness/`, use that as the baseline instead of pretending generation has to happen from scratch. |
| 56 | + |
| 57 | +### 4) For OpenClaw packaging, separate method from implementation |
| 58 | + |
| 59 | +CLI-Anything itself is not a native OpenClaw skill package. When adapting it: |
| 60 | + |
| 61 | +- keep the OpenClaw `SKILL.md` focused on **when to use** and **how to navigate the local repo** |
| 62 | +- move large methodology text into references |
| 63 | +- do not claim that `/plugin` or `/cli-anything` slash commands are directly available inside OpenClaw unless you have actually wired them up |
| 64 | + |
| 65 | +## Practical guidance |
| 66 | + |
| 67 | +### When the user wants to use an existing bundled harness |
| 68 | + |
| 69 | +1. Locate `<software>/agent-harness/` |
| 70 | +2. Read its `setup.py`, package layout, and local README/SOP file |
| 71 | +3. Identify hard dependencies on the real software backend |
| 72 | +4. Install or verify Python requirements only as needed |
| 73 | +5. Validate the CLI entry point and a minimal command |
| 74 | + |
| 75 | +### When the user wants to make a new app agent-native |
| 76 | + |
| 77 | +Use CLI-Anything as methodology, not magic: |
| 78 | + |
| 79 | +1. Analyze backend engine, data model, existing CLI/API hooks |
| 80 | +2. Define command groups and state model |
| 81 | +3. Create or refine `agent-harness/` |
| 82 | +4. Add tests and a `TEST.md` |
| 83 | +5. Install the resulting package to PATH |
| 84 | +6. Verify real backend execution, not mock-only behavior |
| 85 | + |
| 86 | +### When the user wants an OpenClaw skill |
| 87 | + |
| 88 | +There are two good outputs: |
| 89 | + |
| 90 | +- **Method skill**: teaches OpenClaw how to use CLI-Anything on local repos |
| 91 | +- **Harness skill**: wraps one generated CLI or one concrete software target |
| 92 | + |
| 93 | +Default to a **method skill** unless the user clearly wants a single app workflow. |
| 94 | + |
| 95 | +## Rules |
| 96 | + |
| 97 | +- Do not say CLI-Anything is already a native OpenClaw skill unless you created that wrapper. |
| 98 | +- Do not promise a generated CLI works until you verify its entry point and real backend dependencies. |
| 99 | +- Treat third-party generated code as reviewable output, not automatically trusted output. |
| 100 | +- For publishing, require explicit user intent before pushing anything external. |
| 101 | +- If packaging for ClawHub, keep the skill lean and point to local references instead of pasting huge docs into `SKILL.md`. |
| 102 | + |
| 103 | +## Useful script |
| 104 | + |
| 105 | +Use `scripts/inspect_cli_anything.py` to quickly inspect the local repo and enumerate bundled harnesses. It prints JSON with: |
| 106 | + |
| 107 | +- whether the repo exists |
| 108 | +- discovered harnesses |
| 109 | +- whether each harness has `setup.py`, package directory, README, and E2E tests |
| 110 | + |
| 111 | +Run: |
| 112 | + |
| 113 | +```bash |
| 114 | +python3 /root/.openclaw/workspace/skills/cli-anything/scripts/inspect_cli_anything.py |
| 115 | +``` |
| 116 | + |
| 117 | +Use `scripts/recommend_harness.py` to rank the bundled harnesses and suggest good first validation targets. |
| 118 | + |
| 119 | +Run: |
| 120 | + |
| 121 | +```bash |
| 122 | +python3 /root/.openclaw/workspace/skills/cli-anything/scripts/recommend_harness.py |
| 123 | +``` |
| 124 | + |
| 125 | +## Helpful local paths |
| 126 | + |
| 127 | +- Repo root: `/root/.openclaw/workspace/CLI-Anything` |
| 128 | +- Plugin docs: `/root/.openclaw/workspace/CLI-Anything/cli-anything-plugin` |
| 129 | +- Example harnesses: `/root/.openclaw/workspace/CLI-Anything/*/agent-harness` |
| 130 | + |
| 131 | +## Reference files |
| 132 | + |
| 133 | +- `references/bundled-harnesses.md` — quick map of included examples |
| 134 | +- `references/openclaw-adaptation-notes.md` — how to package CLI-Anything ideas into OpenClaw skills |
| 135 | +- `references/validated-example-gimp.md` — first locally verified runnable example |
0 commit comments