CLI-AnythingHKUDS CLI-AnythingCLI for AI agents

What Is CLI-Anything? A CLI for Any App for AI Agents

CLI-Anything from HKUDS turns apps like GIMP, Blender and LibreOffice into agent-ready command lines. How it works, why it beats GUI automation, and its limits.

Portrait of Luis Chavez-Mattos
Edited by Luis Chavez-Mattos, Director, Product··RSS
Four different desktop application windows, each plugged into one uniform rail that fans out into an orderly grid of identical command-line prompt tiles, illustrating CLI-Anything giving apps a shared agent-ready CLI.

What is CLI-Anything?

CLI-Anything is an open-source project from HKUDS, the data intelligence lab at the University of Hong Kong. It takes the source code of a desktop app, such as Blender or LibreOffice, and has your coding agent generate a full command line interface for it. The CLI comes with tests, docs and a skill file, so other agents can discover and use it. It is Apache 2.0 licensed.

TL;DR

  • CLI-Anything generates a command line interface from an app's source code, using your own coding agent to do the work.
  • Every generated command supports a --json flag that returns clean, machine-readable output.
  • The CLI calls the real software (LibreOffice headless for PDFs, real Blender for renders) instead of imitating it.
  • A CLI Hub package manager offers prebuilt CLIs, so you can use the project without generating anything.
  • Generation needs a frontier-class model and works best with source code, and it can burn a lot of tokens on large code bases.
  • Expect to run the refine command several times before a generated CLI is ready for real work.

Why would an agent want a CLI instead of a GUI?

Most software is built for humans, with buttons, menus and windows. Agents handle text far better than pixels. The project frames the current options for letting an agent drive a desktop app as three approaches, each with a weakness:

ApproachHow it worksWeakness
GUI automationAgent takes screenshots and clicks pixelsSlow, and it breaks when the UI changes
APIAgent calls the app's documented interfaceMany apps have none, or cover only a slice of features
RewriteSomeone rebuilds a small copy in PythonThe copy misses most of the real app's features
CLI (CLI-Anything)Text commands wrapped around the real appNeeds generation effort and a strong model

Agents already know how to use a terminal. A CLI is text in, text out. Each command has a help page, so an agent can discover what is available. The JSON flag removes the guesswork of parsing human-oriented output.

How does CLI-Anything work?

The generator runs as a plugin. In Claude Code you add the marketplace and install the plugin:

/plugin marketplace add HKUDS/CLI-Anything
/plugin install cli-anything

Then you point it at a local path or a GitHub URL with /cli-anything. The plugin runs a seven-phase pipeline:

  1. Analyze. The agent reads the source, finds what the GUI does, and maps each action to the code behind it.
  2. Design. It plans command groups, the state model and output formats.
  3. Implement. It writes the CLI in Python with the Click library. Each CLI gets a REPL mode, JSON output, and undo and redo.
  4. Plan tests. It writes a TEST.md with unit and end-to-end test plans.
  5. Write tests. It builds the tests from that plan.
  6. Document. It runs the tests, records results in TEST.md, and produces a SKILL.md that other agents use to find the CLI.
  7. Publish. It creates a setup.py and installs the CLI on your path.

Generated CLIs follow one naming pattern: cli-anything- plus the software name. In the demo, a new project took a width, a height and an output file, and adding a layer with --json returned structured output. Running a CLI with no subcommand opens the REPL. In the Blender example, the prompt showed the scene name and a star for unsaved changes, so the agent always sees current state.

Does it replace the real software?

No. This is the key design choice. The CLI drives the actual application. The LibreOffice CLI produces a real PDF through LibreOffice in headless mode. The Blender CLI renders with real Blender. The project calls this authentic software integration. You get the app's full capability, not a toy reimplementation.

It also means the app must be installed. If you install the GIMP CLI, you still need GIMP on the machine. The same applies to Blender, LibreOffice and the rest.

How do you use prebuilt CLIs from CLI Hub?

You do not have to generate anything. CLI Hub is a package manager for CLIs others have already made. It needs Python 3.10 or newer.

pip install cli-anything-hub
cli-hub-list
cli-hub-search image
cli-hub-install gimp
cli-hub-info gimp
cli-hub-launch gimp

The registry includes Blender, Inkscape, Audacity, OBS Studio, LibreOffice, Kdenlive, Shotcut, draw.io, Zoom, Ollama, ComfyUI, FreeCAD, QGIS, Obsidian and Zotero, among others.

There is also a meta skill that teaches an agent to find and install these tools on its own:

npx skills add HKUDS/CLI-Anything --skill cli-hub-meta-skill -g -y

It works with Claude Code, Codex, OpenClaw, Nanobot, Antigravity and other agents that support skills. In the demo, a prompt asking the agent to find a suitable CLI in the hub and make an architecture diagram led it to pick the draw.io CLI, install it, read its skill file, add and connect shapes, and export a PNG. Nobody named the tool. For a step-by-step walkthrough, see how to use CLI-Anything with Claude Code and Codex. For a model-backed example of the same skill idea, see Carbon-X as a DNA tool for agents.

How does it keep generated CLIs honest?

The project ships a playbook, HARNESS.md, that the agent follows in each phase. Two rules stand out. The CLI must use the real software rather than a substitute library. And an exit code of zero does not prove an export worked, so tests inspect the actual output: magic bytes, file structure, pixels, audio levels and duration.

The README reports more than 2,400 passing tests across about 30 harnesses, split between unit tests on synthetic data and end-to-end tests on real software. If the real software is missing, tests fail rather than skip, which prevents a skipped test from hiding a broken CLI.

Two extra commands help after the first build. /cli-anything:refine compares what the software can do against what the CLI covers and fills gaps, optionally with a focus such as batch processing or filters. Each run adds to the CLI without deleting earlier work. validate checks a CLI against the HARNESS.md rules, and test reruns tests and updates TEST.md.

Where does CLI-Anything fall short?

  • It needs a frontier-class model. The README points to models like Claude Opus, Sonnet and GPT-5.4. A small local model may produce an incomplete or incorrect CLI.
  • Token cost can be high. Generating a CLI for a large code base can use a lot of tokens.
  • Source code matters. With only a compiled binary, quality and coverage drop considerably.
  • One pass is rarely enough. Plan on several refine runs.
  • Agent-written code is still agent-written code. Read the tests and check commands before giving the CLI access to important files.

Is a generated CLI better than screenshot-based GUI automation?

For most agent workloads, probably yes, with caveats. Text commands with JSON output are faster and cheaper per step than screenshot loops, and they do not break when a button moves. The cost shifts to a one-time generation step that needs a strong model and source access. If the app is already in CLI Hub, that cost is zero. If you only have a binary and no API, GUI automation may still be your only option.

Frequently Asked Questions

4 questions

Is CLI-Anything free and open source?

Yes. The repo is Apache 2.0 licensed and fully open source. You still pay for whatever model runs the generation.

Which agents does it work with?

The generator plugin works in Claude Code and also in Cursor, Codex, OpenCode, Pi, Hermes, GitHub Copilot CLI and a few others. The CLI Hub meta skill works with Claude Code, Codex, OpenClaw, Nanobot, Antigravity and other skill-supporting agents.

Do I need to build a CLI myself?

Not necessarily. CLI Hub lists many prebuilt CLIs you can install with pip-based tooling. Use the generator only when your app is missing from the registry or is an internal tool.

Does it work on Windows?

Yes, with a condition. You need Git for Windows or WSL, because Claude Code runs shell commands through Bash and the plugin depends on it.

How we source, write, and correct our articles. Editorial standards

Related articles

Straight to your inbox.
New pieces as they publish. No noise.