$ show HKUDS/CLI-Anything
CLI-Anything is a meta-framework for generating agent-native CLI interfaces for arbitrary GUI applications. The repository contains 40+ pre-built CLI harnesses (e.g., Blender, GIMP, Audacity, LibreOffice, OBS Studio) each structured as a self-contained Python package under `cli_anything.<name>/`. These harnesses provide a consistent Click-based CLI with `--json` output, interactive REPL mode, session management with undo/redo, and backend abstraction over subprocess or API calls. The project also includes a CLI-Hub package manager, agent plugins for Claude Code, Pi, Codex, Hermes, and a skill generation system. The primary data flow is: agent/user invokes a CLI command → harness translates to subprocess/API calls to the target software → structured output returned. External dependencies are the target software binaries (must be pre-installed). The codebase is well-tested (2,461 tests passing) and actively maintained, though significant code duplication exists across harnesses.
The LLM identified 5 files worth highlighting for reuse:
Generates a self-contained HTML preview bundle from a JSON trajectory plan and optional base64 snapshot. Embeds CSS styling and custom Monaco editor-inspired code blocks. Can be extracted to provide live preview for any tool workflow system.
Provides URL validation, private network blocking, and DOM text sanitization for browser automation. The `validate_url` function checks against a curated allowlist and blocks internal IPs. Demonstrates robust input validation patterns that can be reused in any agent-facing tool.
Implements a macro registry that discovers YAML macro definitions from a manifest and multiple directories. Each macro is loaded with parameter schema, tag support, and deduplication. The pattern of scanning for YAML files, parsing frontmatter, and registering typed entries is reusable for any plugin or workflow system.
Auto-generates SKILL.md files from Click CLI decorators by parsing command groups, subcommands, and options. Uses a template with YAML frontmatter. Demonstrates a non-obvious pattern for keeping documentation in sync with CLI structure; extractable for any Click-based project.
Wraps the SoX audio processing tool via subprocess with command-line generation, codec validation, and error parsing. Provides methods like `apply_effect`, `convert_format`, `combine_audio`. The pattern of mapping abstract operations to CLI flags and validating parameters before subprocess execution is reusable for any CLI tool wrapper.