mirror of
https://github.com/HKUDS/CLI-Anything.git
synced 2026-08-29 07:30:51 +08:00
5b9ec80def
* feat: CLI-Matrix with multi-approach stages, skill discovery, and matrix search Introduce CLI-Matrix — curated multi-CLI workflow matrices that agents can install in one command. The video-creation matrix bundles 11 CLIs across 8 production stages (AI video gen, capture, audio, voice/TTS, music, NLE editing, captions, thumbnails). Each stage now exposes a goal, alternative approaches (Python libs, cloud APIs, native commands), and skill_search_hints that encourage agents to dynamically discover relevant skills via `npx skills search` rather than relying on hard-coded tool lists. Key changes: - matrix_registry.json: extended stage schema with goal, alternatives, skill_search_hints fields - cli-hub matrix list/search/info/install commands - matrix_skill.py: renders dynamic SKILL.md with stage tooling overview, install status, and aggregated discovery commands - Fixed brittle parents[2] repo root detection with git-based lookup - 85 tests passing (10 new) * update cli-matrix * feat(cli-matrix): eco-first capability-based matrix, v2 schema + S2-S5 SKILLs - Add docs/cli-matrix/matrix_registry.schema.md describing v2 capability-based registry shape (capabilities[], providers with kind/requires/cost/quality/ offline, recipes[], known_gaps[], decision rubric, suggest-to-user template). - Rewrite cli-hub-matrix/video-creation/SKILL.md and matrix_registry.json (S1) around capabilities + providers + recipes instead of linear stages. - Rename Vn -> Sn across cli-matrix-plan.md and test fixtures. - Reorder scenarios by current completeness; rewrite S2 knowledge-research, S3 3d-cad, S4 game-development, S5 image-design in v2 capability form with full SKILL.md files. - Add docs/cli-matrix/test-plans/video-creation.md with 13 long realistic end-to-end tasks as checkable todo lists, each exercising 5-9 capabilities. - Move cli-matrix-plan.md and matrix_registry.schema.md under docs/cli-matrix/. * Document preview protocol and Audacity autosave Add the preview bundle protocol plan, record video matrix review evidence, and make one-shot Audacity project mutations persist to disk with E2E coverage. * Update CLI matrix skill registry and video workflow * chore(git): always ignore docs/* — working documents stay local * feat(cli-matrix): video-creation skill WIP — sound design, source triage, render doctor, NLE refs, video_doctor script - SKILL.md: adds sound.design capability, bundled video_doctor.py provider, recipe updates, and links to five new reference modules - new references: art-direction-review, nle-shotcut-kdenlive, render-doctor, sound-design, source-triage; captions and story-structure-audio updated - scripts/video_doctor.py: bundled probe/diagnose helper * fix(cli-hub): preflight detects packages by import name or PyPI dist name (P1-3) _package_available() now tries find_spec as-is, dash->underscore normalized, then importlib.metadata dist lookup (PEP 503), so registry entries like edge-tts are detected when installed. All lookup failures degrade to unavailable instead of crashing preflight. Adds 6 tests. * feat(cli-hub): distribute matrix skill content to installed skills, wheels, and Pages (P1-4) - matrix install renders to ~/.cli-hub/matrix/<name>/SKILL.md and copies references/ and scripts/ beside it (pycache excluded, idempotent reinstall purges stale files); legacy flat <name>.SKILL.md still read - content lookup chain: repo checkout -> bundled cli_hub/_matrix_data (vendored into sdist/wheel by setup.py build hooks + MANIFEST.in) -> published Pages URL -> stub - new 'matrix install --skill-only' renders skill + assets without installing CLIs - deploy-pages.yml: copy cli-hub-matrix/ into the site after the Jekyll build (served verbatim at /matrix/<name>/); triggers remain main-only - 12 new tests in tests/test_matrix_skill_dist.py (142 total pass) * feat(cli-matrix): register S2-S5 matrices and resync video-creation registry (P1-1, P1-2) - add knowledge-research (S2, 12 caps), 3d-cad (S3, 12), game-development (S4, 10), image-design (S5, 9) derived from their SKILL.md drafts; full v2 shape with capabilities, providers, recipes, known_gaps; clis lists cross-checked against registry.json (unresolvable tools represented as public-cli/native/python/api/agent-skill providers instead) - video-creation: add sound.design capability (5 providers, wired into 5 recipes), register scripts/video_doctor.py as bundled-script provider under quality.review, cite the 5 new reference modules in provider notes, refresh description - python provider package strings use import names (cv2, edge_tts, ffmpeg, skimage, ...) so preflight detection is robust to dist-name variants like opencv-python-headless - fix homepage URLs to docs/cli-matrix/cli-matrix-plan.md; bump meta.updated to 2026-06-11 * feat(cli-hub): ship the unified Gallery design as the production homepage Replace docs/hub/index.html with the finalized "Gallery / R2 Flip" main page (Steel Sky palette default, Newsreader serif hero title, liquid-glass flip cards, JS masonry catalog, and the unified Matrices layer with bidirectional stitching). Production-indexable robots meta retained. Stop tracking docs/cli-matrix/* — the CLI-Matrix working docs stay local and confidential; add an explicit /docs/cli-matrix/ ignore rule. * feat: CLI-Matrix command family + Hub docs/demos pages and responsive nav ---------
105 lines
3.5 KiB
Python
105 lines
3.5 KiB
Python
"""cli-hub — package manager for CLI-Anything harnesses."""
|
|
|
|
import shutil
|
|
from pathlib import Path
|
|
|
|
from setuptools import setup, find_packages
|
|
from setuptools.command.build_py import build_py as _build_py
|
|
from setuptools.command.sdist import sdist as _sdist
|
|
|
|
HERE = Path(__file__).resolve().parent
|
|
|
|
# Matrix skill content lives at the repo root (outside this package dir).
|
|
# It is vendored into cli_hub/_matrix_data/ at build time so wheels and
|
|
# sdists ship real matrix content for users without a repo checkout.
|
|
# Editable installs (`pip install -e`) do not need the vendored copy: the
|
|
# runtime lookup chain in cli_hub/matrix_skill.py finds the checkout first.
|
|
MATRIX_CONTENT_SOURCE = HERE.parent / "cli-hub-matrix"
|
|
MATRIX_DATA_DIR = HERE / "cli_hub" / "_matrix_data"
|
|
|
|
|
|
def _sync_matrix_data():
|
|
"""Vendor cli-hub-matrix/ into cli_hub/_matrix_data/ (build artifact).
|
|
|
|
No-op when building from an sdist (the data is already vendored) or when
|
|
the repo content is unavailable (runtime falls back to the published URL
|
|
or a stub).
|
|
"""
|
|
if not MATRIX_CONTENT_SOURCE.is_dir():
|
|
return
|
|
if MATRIX_DATA_DIR.exists():
|
|
shutil.rmtree(MATRIX_DATA_DIR)
|
|
shutil.copytree(
|
|
MATRIX_CONTENT_SOURCE,
|
|
MATRIX_DATA_DIR,
|
|
ignore=shutil.ignore_patterns("__pycache__", "*.pyc", "*.pyo"),
|
|
)
|
|
|
|
|
|
class build_py(_build_py):
|
|
def run(self):
|
|
_sync_matrix_data()
|
|
super().run()
|
|
|
|
|
|
class sdist(_sdist):
|
|
def run(self):
|
|
_sync_matrix_data()
|
|
super().run()
|
|
|
|
|
|
setup(
|
|
name="cli-anything-hub",
|
|
version="0.3.0",
|
|
description="Package manager for CLI-Anything — browse, install, and manage 40+ agent-native CLI interfaces for GUI applications",
|
|
long_description=open("README.md").read(),
|
|
long_description_content_type="text/markdown",
|
|
author="HKUDS",
|
|
author_email="hkuds@connect.hku.hk",
|
|
url="https://github.com/HKUDS/CLI-Anything",
|
|
project_urls={
|
|
"Homepage": "https://clianything.cc",
|
|
"Repository": "https://github.com/HKUDS/CLI-Anything",
|
|
"Bug Tracker": "https://github.com/HKUDS/CLI-Anything/issues",
|
|
"Catalog": "https://reeceyang.sgp1.cdn.digitaloceanspaces.com/SKILL.md",
|
|
},
|
|
license="MIT",
|
|
packages=find_packages(exclude=["tests", "tests.*"]),
|
|
cmdclass={"build_py": build_py, "sdist": sdist},
|
|
include_package_data=True,
|
|
package_data={
|
|
"cli_hub": [
|
|
"_matrix_data/*/SKILL.md",
|
|
"_matrix_data/*/references/*",
|
|
"_matrix_data/*/scripts/*",
|
|
],
|
|
},
|
|
python_requires=">=3.10",
|
|
install_requires=[
|
|
"click>=8.0",
|
|
"requests>=2.28",
|
|
],
|
|
entry_points={
|
|
"console_scripts": [
|
|
"cli-hub=cli_hub.cli:main",
|
|
],
|
|
},
|
|
classifiers=[
|
|
"Development Status :: 4 - Beta",
|
|
"Environment :: Console",
|
|
"Intended Audience :: Developers",
|
|
"Intended Audience :: System Administrators",
|
|
"License :: OSI Approved :: MIT License",
|
|
"Operating System :: OS Independent",
|
|
"Programming Language :: Python :: 3",
|
|
"Programming Language :: Python :: 3.10",
|
|
"Programming Language :: Python :: 3.11",
|
|
"Programming Language :: Python :: 3.12",
|
|
"Programming Language :: Python :: 3.13",
|
|
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
|
"Topic :: System :: Installation/Setup",
|
|
"Topic :: Utilities",
|
|
],
|
|
keywords="cli, agent, gui, automation, package-manager, cli-anything",
|
|
)
|