Skill: jasonchenjc/cli-anything (version 0.1.0)

--- name: cli-anything 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. --- # CLI-Anything Use this skill to work with the local `CLI-Anything/` repository in the workspace and turn its methodology into something usable from OpenClaw. ## What this skill is for Use it for three common cases: 1. **Assess feasibility** — inspect a target app/repo and decide whether CLI-Anything is a good fit. 2. **Use an existing harness** — work with one of the repo's prebuilt `agent-harness` examples. 3. **Wrap for OpenClaw** — turn CLI-Anything guidance or an existing harness into an OpenClaw skill/workflow. ## Local source of truth The repository is expected at: - `/root/.openclaw/workspace/CLI-Anything` Read these first when needed: - `CLI-Anything/README.md` — overall platform and examples - `CLI-Anything/cli-anything-plugin/HARNESS.md` — generation methodology and quality bar - `CLI-Anything/cli-anything-plugin/README.md` — plugin behavior and expected output layout For a fast survey of bundled examples, read `references/bundled-harnesses.md`. ## Core workflow ### 1) Classify the user's request Decide which path applies: - **Methodology request**: user wants to understand or apply CLI-Anything generally - **Existing harness request**: user wants to use/demo one of the included examples like GIMP or LibreOffice - **Packaging request**: user wants an OpenClaw skill or ClawHub package derived from CLI-Anything ### 2) Inspect prerequisites Before promising execution, check: - Python 3.10+ - target software presence if using a real harness backend - whether the request is about: - building a harness - running a generated CLI - packaging/publishing ### 3) Prefer existing harnesses before generation 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. ### 4) For OpenClaw packaging, separate method from implementation CLI-Anything itself is not a native OpenClaw skill package. When adapting it: - keep the OpenClaw `SKILL.md` focused on **when to use** and **how to navigate the local repo** - move large methodology text into references - do not claim that `/plugin` or `/cli-anything` slash commands are directly available inside OpenClaw unless you have actually wired them up ## Practical guidance ### When the user wants to use an existing bundled harness 1. Locate `<software>/agent-harness/` 2. Read its `setup.py`, package layout, and local README/SOP file 3. Identify hard dependencies on the real software backend 4. Install or verify Python requirements only as needed 5. Validate the CLI entry point and a minimal command ### When the user wants to make a new app agent-native Use CLI-Anything as methodology, not magic: 1. Analyze backend engine, data model, existing CLI/API hooks 2. Define command groups and state model 3. Create or refine `agent-harness/` 4. Add tests and a `TEST.md` 5. Install the resulting package to PATH 6. Verify real backend execution, not mock-only behavior ### When the user wants an OpenClaw skill There are two good outputs: - **Method skill**: teaches OpenClaw how to use CLI-Anything on local repos - **Harness skill**: wraps one generated CLI or one concrete software target Default to a **method skill** unless the user clearly wants a single app workflow. ## Rules - Do not say CLI-Anything is already a native OpenClaw skill unless you created that wrapper. - Do not promise a generated CLI works until you verify its entry point and real backend dependencies. - Treat third-party generated code as reviewable output, not automatically trusted output. - For publishing, require explicit user intent before pushing anything external. - If packaging for ClawHub, keep the skill lean and point to local references instead of pasting huge docs into `SKILL.md`. ## Useful script Use `scripts/inspect_cli_anything.py` to quickly inspect the local repo and enumerate bundled harnesses. It prints JSON with: - whether the repo exists - discovered harnesses - whether each harness has `setup.py`, package directory, README, and E2E tests Run: ```bash python3 /root/.openclaw/workspace/skills/cli-anything/scripts/inspect_cli_anything.py ``` Use `scripts/recommend_harness.py` to rank the bundled harnesses and suggest good first validation targets. Run: ```bash python3 /root/.openclaw/workspace/skills/cli-anything/scripts/recommend_harness.py ``` ## Helpful local paths - Repo root: `/root/.openclaw/workspace/CLI-Anything` - Plugin docs: `/root/.openclaw/workspace/CLI-Anything/cli-anything-plugin` - Example harnesses: `/root/.openclaw/workspace/CLI-Anything/*/agent-harness` ## Reference files - `references/bundled-harnesses.md` — quick map of included examples - `references/openclaw-adaptation-notes.md` — how to package CLI-Anything ideas into OpenClaw skills - `references/validated-example-gimp.md` — first locally verified runnable example

path: scripts/inspect_cli_anything.py
content: #!/usr/bin/env python3
import json
from pathlib import Path

ROOT = Path('/root/.openclaw/workspace/CLI-Anything')


def detect_harnesses(root: Path):
    items = []
    if not root.exists():
        return items
    for setup_py in sorted(root.glob('*/agent-harness/setup.py')):
        harness_dir = setup_py.parent
        software_dir = harness_dir.parent
        name = software_dir.name
        pkg_root = harness_dir / 'cli_anything'
        readmes = list(harness_dir.glob('*.md')) + list((pkg_root / name).glob('README.md')) if (pkg_root / name).exists() else list(harness_dir.glob('*.md'))
        tests = list(harness_dir.glob('cli_anything/**/tests/test_full_e2e.py'))
        items.append({
            'name': name,
            'path': str(harness_dir),
            'has_setup_py': setup_py.exists(),
            'has_pkg_dir': (pkg_root / name).exists(),
            'has_readme': any(p.name.lower() == 'readme.md' for p in readmes),
            'has_e2e_tests': bool(tests),
        })
    return items


def main():
    data = {
        'repo_exists': ROOT.exists(),
        'repo_path': str(ROOT),
        'harnesses': detect_harnesses(ROOT),
    }
    data['harness_count'] = len(data['harnesses'])
    print(json.dumps(data, ensure_ascii=False, indent=2))


if __name__ == '__main__':
    main()


path: scripts/recommend_harness.py
content: #!/usr/bin/env python3
import json
import subprocess
from pathlib import Path

INSPECT = Path('/root/.openclaw/workspace/skills/cli-anything/scripts/inspect_cli_anything.py')


def score(item):
    s = 0
    if item.get('has_setup_py'):
        s += 3
    if item.get('has_pkg_dir'):
        s += 3
    if item.get('has_readme'):
        s += 2
    if item.get('has_e2e_tests'):
        s += 2
    name = item.get('name', '')
    if name in {'gimp', 'inkscape', 'libreoffice'}:
        s += 2
    if name in {'zoom', 'obs-studio', 'anygen'}:
        s -= 1
    return s


def main():
    raw = subprocess.check_output(['python3', str(INSPECT)], text=True)
    data = json.loads(raw)
    harnesses = data.get('harnesses', [])
    ranked = []
    for item in harnesses:
        item = dict(item)
        item['score'] = score(item)
        ranked.append(item)
    ranked.sort(key=lambda x: (-x['score'], x['name']))
    out = {
        'repo_exists': data.get('repo_exists', False),
        'recommended': ranked[:5],
        'best': ranked[0] if ranked else None,
    }
    print(json.dumps(out, ensure_ascii=False, indent=2))


if __name__ == '__main__':
    main()


path: references/bundled-harnesses.md
content: # Bundled harnesses in CLI-Anything

Use this as a quick map before reading a specific harness deeply.

## Included examples observed in the local repo

- `gimp/agent-harness`
- `blender/agent-harness`
- `inkscape/agent-harness`
- `audacity/agent-harness`
- `libreoffice/agent-harness`
- `obs-studio/agent-harness`
- `kdenlive/agent-harness`
- `shotcut/agent-harness`
- `zoom/agent-harness`
- `drawio/agent-harness`
- `anygen/agent-harness`

## Common structure to expect

Most examples contain:

- `setup.py`
- a PEP 420 namespace package under `cli_anything/<software>/`
- a software-specific SOP like `GIMP.md` or `LIBREOFFICE.md`
- `tests/test_core.py`
- `tests/test_full_e2e.py`
- `tests/TEST.md`

## What to verify before claiming one is usable

1. The target software/backend is installed
2. The Python package can be installed or imported
3. The console entry point resolves
4. A minimal command works
5. Any E2E claim uses the real software backend, not only synthetic tests

## Recommended first targets

If you need a smaller proof-of-concept, start with examples that look structurally complete and have straightforward file-based workflows, such as:

- `gimp`
- `inkscape`
- `libreoffice`

More environment-sensitive examples may need extra services, APIs, or media tools.


path: references/openclaw-adaptation-notes.md
content: # Adapting CLI-Anything into OpenClaw

CLI-Anything is a methodology repo plus plugin/command assets, not a native OpenClaw skill package.

## Safe adaptation pattern

1. Keep OpenClaw `SKILL.md` short and procedural
2. Store heavier methodology in references
3. Point to the local `CLI-Anything/` checkout as the implementation source
4. Distinguish clearly between:
   - plugin commands for Claude Code / OpenCode
   - local Python harnesses
   - OpenClaw skill wrappers

## Good packaging targets

### Option A — method skill

Create an OpenClaw skill that teaches the agent how to:

- inspect the local CLI-Anything repo
- choose a harness or target app
- verify dependencies
- adapt generated outputs into OpenClaw-friendly workflows

### Option B — concrete harness skill

Wrap one concrete generated CLI, for example a `cli-anything-libreoffice` workflow.
This is often easier to test than packaging the whole methodology.

## Publishing cautions

Before publishing to ClawHub:

- verify there is real implementation value beyond copied docs
- avoid bundling unnecessary large third-party source trees in the skill unless intentionally distributing them
- make sure the description says whether the skill is:
  - methodology only
  - a wrapper around a local repo
  - a distributable harness with runnable scripts

## Recommended wording

Prefer wording like:

- "Uses a local checkout of CLI-Anything to guide harness generation"
- "Wraps existing CLI-Anything harnesses for OpenClaw workflows"

Avoid wording like:

- "Provides full CLI-Anything functionality" unless you actually wired all of it up


path: references/validated-example-gimp.md
content: # Validated example: gimp harness

This is the first locally validated example for the OpenClaw `cli-anything` skill.

## What was verified

### Environment

- Python present: `Python 3.12.3`
- Local repo present: `/root/.openclaw/workspace/CLI-Anything`

### Python dependencies installed for the harness

Installed into the current machine Python environment:

- `Pillow`
- `numpy`
- `prompt_toolkit`

### Harness installation

Installed from:

- `/root/.openclaw/workspace/CLI-Anything/gimp/agent-harness`

Command used conceptually:

```bash
python3 -m pip install --break-system-packages -e /root/.openclaw/workspace/CLI-Anything/gimp/agent-harness
```

### Entry point verification

Verified command:

```bash
cli-anything-gimp --help
```

The CLI loaded successfully and exposed command groups including:

- `canvas`
- `draw`
- `export`
- `filter`
- `layer`
- `media`
- `project`
- `repl`
- `session`

### Minimal functional verification

Verified JSON project creation:

```bash
cli-anything-gimp --json project new --width 320 --height 240 -o /root/.openclaw/workspace/tmp-gimp-project.json
```

Observed result:

- JSON printed to stdout
- project file created successfully
- output file path:
  - `/root/.openclaw/workspace/tmp-gimp-project.json`

## Important note

The `gimp` harness is a good first demonstration target because it is runnable in the current environment after Python dependency installation.

However, its packaging/docs are not perfectly aligned:

- `setup.py` describes it as a GIMP batch-mode harness
- the README describes a Pillow-based image editing CLI

Treat this harness as:

- **validated enough for local demonstration**
- **not yet proof that every CLI-Anything harness exactly matches its stated backend model**

## Recommended use in the skill

When using the `cli-anything` method skill:

1. Prefer `gimp` as the first runnable example
2. Use it to demonstrate harness inspection, installation, and entry-point checks
3. Avoid over-claiming that all bundled harnesses are equally verified until they are tested one by one


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)