What is CLI-Anything
CLI-Anything is a tool open-sourced by the Hong Kong University Data Science Laboratory (HKUDS) that can convert the codebase of any open-source software into a command-line interface (CLI) usable by AI Agents with one click. Through a 7-stage automated process (analysis, design, implementation, testing, etc.), the tool frees professional software such as GIMP, Blender, and LibreOffice from fragile GUI automation, turning them into stable, structured, programmable Agent-native tools, realizing the vision that "today's software is built for people, tomorrow's users are Agents."
Main features of CLI-Anything
-
One-click CLI generation: Automatically completes the full 7-stage process from source code analysis to release through a single command, converting any open-source software into a command-line tool usable by Agents.
-
Real software integration: Directly operates existing professional software (such as GIMP, Blender, and LibreOffice), calling real applications to process project files.
-
Say goodbye to GUI automation: Abandons fragile solutions based on screenshot recognition and simulated clicks, adopts pure command-line interaction, and eliminates the risk of failure caused by changes in UI elements.
-
Structured output: Supports both REPL interactive mode and script subcommand mode, with built-in
--jsonflag to output structured data, making it easy for Agents to directly consume and parse. -
Production-grade test assurance: Completed validation of 1436 test cases on 9 professional software programs, including unit tests, E2E tests, and real software calls, ensuring a 100% pass rate.
Technical principles of CLI-Anything
- Source code static analysis and GUI mapping: By scanning the source code of the target software, identifies operation logic, event handling, and API calls in the graphical interface, mapping human GUI operations such as clicks and drags into programmable function interfaces.
- Architecture design and state modeling: Based on the analysis results, designs the command group structure, builds a state model to manage the runtime context of the software (such as the current project, selected objects, and edit history), and defines a unified input/output format specification.
- Automatic CLI framework generation: Uses code generation technology to automatically build a command-line interface based on Python CLI frameworks such as Click, including Agent-friendly features such as a REPL interactive environment, JSON serialized output, and undo/redo mechanisms.
- Real software call encapsulation: The generated CLI does not reimplement functionality; it directly drives real applications by calling the software's native APIs, scripting interfaces, or headless mode, ensuring functional completeness and compatibility.
- Test-driven verification: Supports automatically generating and executing unit tests and end-to-end tests, verifying behavioral consistency between the generated CLI and various versions of the target software, ensuring reliability in production environments.
CLI-Anything project address
- GitHub repository:https://github.com/HKUDS/CLI-Anything
Application scenarios of CLI-Anything
- Multimedia content creation: Enables AI Agents to directly call Blender for 3D modeling and rendering, use GIMP to process images, and edit audio through Audacity, realizing automated content production pipelines.
- Document automation processing: Drives LibreOffice to batch-generate reports, convert formats, and fill in data, replacing traditional template engines to achieve intelligent generation of complex layout documents.
- Video post-production: Control professional tools such as OBS, Kdenlive, and Shotcut to achieve automated editing, effect addition, multi-track compositing, and batch export, greatly improving video production efficiency.
- Design Workflow Integration: Integrate design software such as Inkscape and Krita into the Agent system to complete vector graphic generation, batch asset processing, and automated execution of brand visual guidelines.
- Scientific Research and Engineering Computing: Extend to the fields of CAD, EDA, and scientific computing tools, enabling the Agent to directly operate professional software to complete complex tasks such as simulation analysis, circuit design, and data visualization.