"CLI-Anything: Making ALL Software Agent-Native" -- CLI-Hub: https://clianything.cc/
Python
fix: address PR review — correct path mismatch, relocate tests
Sereja09a3dfa6442c
diff --git a/.gitignore b/.gitignoreindex 8eae149b6..6ed085494 100644--- a/.gitignore+++ b/.gitignore@@ -16,7 +16,8 @@!/CONTRIBUTING.md!/SECURITY.md!/assets/-!/pi-extension/+!/.pi-extension/+/.pi-extension/cli-anything/node_modules!/.claude-plugin/!/.github//.github/*diff --git a/pi-extension/cli-anything/README.md b/.pi-extension/cli-anything/README.mdsimilarity index 67%rename from pi-extension/cli-anything/README.mdrename to .pi-extension/cli-anything/README.mdindex 583aaad09..e7934dda7 100644--- a/pi-extension/cli-anything/README.md+++ b/.pi-extension/cli-anything/README.md@@ -13,20 +13,16 @@ The CLI-Anything Pi extension provides 5 slash commands that inject the HARNESS.Install the extension globally so `/cli-anything` commands are available in **all** Pi projects:```bash-cd CLI-Anything/.pi-extension/extensions/cli-anything-bash install.sh+cd CLI-Anything+bash .pi-extension/cli-anything/install.sh```To uninstall:```bash-bash install.sh --uninstall+bash .pi-extension/cli-anything/install.sh --uninstall```-### Option 2: Project-Local--Pi auto-discovers extensions in `.pi-extension/extensions/` within a project. If you're working inside the CLI-Anything repo, the extension is already active — no installation needed.-### VerifyAfter installing, run `/reload` in Pi or restart Pi. Then type `/cli-anything` to verify the command is available.@@ -70,34 +66,21 @@ After installing, run `/reload` in Pi or restart Pi. Then type `/cli-anything` t## Extension Structure```-.pi-extension/extensions/cli-anything/+.pi-extension/cli-anything/├── index.ts # Main extension entry point+├── install.sh # Global installation script├── README.md # This file-├── commands/ # Command specifications-│ ├── cli-anything.md # Main build command-│ ├── refine.md # Refinement command-│ ├── test.md # Test runner command-│ ├── validate.md # Validation command-│ └── list.md # List tools command-├── guides/ # Detailed implementation guides-│ ├── filter-translation.md-│ ├── mcp-backend.md-│ ├── pypi-publishing.md-│ ├── session-locking.md-│ ├── skill-generation.md-│ └── timecode-precision.md-├── scripts/ # Utility scripts-│ └── skill_generator.py # SKILL.md generator-├── templates/ # Templates-│ └── SKILL.md.template # Skill definition template-└── tests/ # Test suite- ├── test_extension.test.ts # Command registration tests- └── test_skill_generator.py # Skill generator tests+└── tests/+ └── test_extension.test.ts # Command registration tests```-> **Note:** HARNESS.md is NOT duplicated here. The extension reads it directly-> from `cli-anything-plugin/HARNESS.md` (canonical source) using a relative path.-> When installed globally via `install.sh`, a copy is placed alongside the extension.+Tests for `skill_generator.py` live in `cli-anything-plugin/tests/` (next to the source).++> **Note:** Command specs, guides, scripts (skill_generator.py, repl_skin.py),+> templates, and HARNESS.md live in `cli-anything-plugin/` (canonical source).+> `install.sh` copies them into `~/.pi/agent/extensions/cli-anything/` alongside+> `index.ts` at install time. The extension reads them from its own directory+> via `__dirname`.## How It Worksdiff --git a/pi-extension/cli-anything/index.ts b/.pi-extension/cli-anything/index.tssimilarity index 100%rename from pi-extension/cli-anything/index.tsrename to .pi-extension/cli-anything/index.tsdiff --git a/pi-extension/cli-anything/install.sh b/.pi-extension/cli-anything/install.shsimilarity index 95%rename from pi-extension/cli-anything/install.shrename to .pi-extension/cli-anything/install.shindex f0d34c9c8..4c6fddea2 100755--- a/pi-extension/cli-anything/install.sh+++ b/.pi-extension/cli-anything/install.sh@@ -113,6 +113,14 @@ if [ -f "$SKILL_GEN_SRC" ]; thenecho "✓ skill_generator.py copied from $SKILL_GEN_SRC"fi+# Copy tests from the canonical location+TESTS_SRC="$REPO_ROOT/cli-anything-plugin/tests"+if [ -d "$TESTS_SRC" ]; then+ mkdir -p "$TARGET_DIR/tests"+ cp "$TESTS_SRC"/*.py "$TARGET_DIR/tests/"+ echo "✓ tests copied from $TESTS_SRC"+fi+echo ""echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"echo " ✓ CLI-Anything extension installed globally!"diff --git a/pi-extension/cli-anything/tests/test_extension.test.ts b/.pi-extension/cli-anything/tests/test_extension.test.tssimilarity index 100%rename from pi-extension/cli-anything/tests/test_extension.test.tsrename to .pi-extension/cli-anything/tests/test_extension.test.tsdiff --git a/README.md b/README.mdindex 29ef2e7c8..c197cbf72 100644--- a/README.md+++ b/README.md@@ -213,26 +213,25 @@ cp -r CLI-Anything/cli-anything-plugin ~/.claude/plugins/cli-anything**Step 1: Install the Extension**-Pi extensions are loaded automatically from the `.pi-extension/extensions/` directory. To install CLI-Anything:+The extension lives at `.pi-extension/cli-anything/` in this repository. Install it globally so `/cli-anything` commands are available in **all** Pi projects:```bash# Clone the repogit clone https://github.com/HKUDS/CLI-Anything.git+cd CLI-Anything-# The extension is already included in the repository at:-# CLI-Anything/.pi-extension/extensions/cli-anything/+# Install globally into Pi's extensions directory+bash .pi-extension/cli-anything/install.sh```-If you're developing the extension locally, symlink it to your Pi extensions directory:+To uninstall:```bash-# Create Pi extensions directory if it doesn't exist-mkdir -p ~/.pi/extensions--# Symlink the CLI-Anything extension-ln -s $(pwd)/CLI-Anything/.pi-extension/extensions/cli-anything ~/.pi/extensions/cli-anything+bash .pi-extension/cli-anything/install.sh --uninstall```+> **How it works:** `install.sh` copies the extension files (including HARNESS.md, commands, guides, scripts, and templates from `cli-anything-plugin/`) into `~/.pi/agent/extensions/cli-anything/`, which Pi auto-discovers on startup. Run `/reload` in Pi or restart Pi to activate.+**Step 2: Build a CLI in One Command**Once the extension is loaded, the following commands are available:diff --git a/pi-extension/cli-anything/tests/test_skill_generator.py b/cli-anything-plugin/tests/test_skill_generator.pysimilarity index 96%rename from pi-extension/cli-anything/tests/test_skill_generator.pyrename to cli-anything-plugin/tests/test_skill_generator.pyindex 26c2fdf53..dec23e868 100644--- a/pi-extension/cli-anything/tests/test_skill_generator.py+++ b/cli-anything-plugin/tests/test_skill_generator.py@@ -14,12 +14,15 @@ from pathlib import Pathimport pytest-# skill_generator lives in cli-anything-plugin/ (canonical) or scripts/ (installed)-EXT_DIR = Path(__file__).resolve().parent.parent-SCRIPTS_DIR = EXT_DIR / "scripts"-if not (SCRIPTS_DIR / "skill_generator.py").exists():- SCRIPTS_DIR = EXT_DIR.parents[1] / "cli-anything-plugin"-sys.path.insert(0, str(SCRIPTS_DIR))+# Resolve skill_generator.py location:+# - In the repo: cli-anything-plugin/skill_generator.py (parent dir)+# - After install.sh: scripts/skill_generator.py (sibling dir)+_PLUGIN_DIR = Path(__file__).resolve().parent.parent+_SCRIPTS_DIR = _PLUGIN_DIR / "scripts"+if (_SCRIPTS_DIR / "skill_generator.py").exists():+ sys.path.insert(0, str(_SCRIPTS_DIR))+else:+ sys.path.insert(0, str(_PLUGIN_DIR))from skill_generator import (extract_cli_metadata,