DEV Community

Cover image for How to use CLI-Anything: make any software agent-native
Wanda
Wanda

Posted on • Originally published at apidog.com

How to use CLI-Anything: make any software agent-native

CLI-Anything is an open-source plugin for AI coding agents (primarily Claude Code) that automatically generates a command-line interface (CLI) for any software with a codebase. Just point it at GIMP, Blender, LibreOffice, or any application, and it analyzes the source code to produce a structured CLI your AI agent—or scripts—can use to control that software programmatically.

Try Apidog today

The problem: AI agents can't use GUI software

Modern software splits into two camps:

  • API-first services (cloud storage, payments, analytics): These expose HTTP APIs that AI agents can call directly.
  • GUI-centric software (GIMP, Blender, LibreOffice, Audacity): These are built for human interaction, exposing graphical interfaces instead of APIs.

Connecting AI agents to GUI software is tricky. Manual wrappers are slow to build and break with updates. Robotic Process Automation (RPA) tools simulate human actions but are fragile—UI changes break automations.

CLI-Anything takes a different path: it analyzes the software's source code, finds the APIs the GUI uses, and generates a CLI that calls those APIs directly. Your AI agent issues structured commands—the software does the work, no GUI automation required.

💡 If your agent workflows need to call external REST APIs alongside local software, Apidog handles API testing. It's a free tool for sending, inspecting, and organizing API requests, so you can verify integrations before building them into your agent workflows.

What CLI-Anything does

CLI-Anything is built by HKUDS (Hong Kong University Data Science Lab). As the creator, Chao Huang, said:

"Today's software serves humans. Tomorrow's users will be agents. CLI-Anything: bridging the gap between AI agents and the world's software. One command line to make any software agent-ready."

The project has over 6,100 GitHub stars.

CLI-Anything runs inside Claude Code (also experimentally in Codex and OpenCode). Point it at a codebase; it runs a 7-phase pipeline:

  1. Analyze – Scans source, maps GUI actions to APIs, produces a standard operating procedure (SOP) document.
  2. Design – Defines command groups, state models, and output formats.
  3. Implement – Builds a Python Click-based CLI with REPL, --json output, undo/redo.
  4. Plan tests – Creates TEST.md with unit and end-to-end test plans.
  5. Write tests – Generates test_core.py (unit) and test_full_e2e.py (E2E).
  6. Document – Runs pytest, appends results to TEST.md.
  7. Publish – Creates setup.py, configures entry points, installs to PATH.

After phase 7, you have a working CLI installed. Discover it with which cli-anything-gimp, inspect with cli-anything-gimp --help, and start issuing commands.

All generated CLIs use a consistent design: human-readable table output by default, machine-readable JSON with --json, persistent state, undo/redo, and interactive REPL. Agents don't need to learn a new interface for each tool.

Installing CLI-Anything

CLI-Anything is a Python plugin (not npm). Install it into your AI coding agent; generated CLIs are installed with pip install -e ..

Requirements:

  • Python 3.10+
  • Target software installed locally
  • Supported AI coding agent (Claude Code recommended; Codex/OpenCode experimental)

Claude Code (primary method)

/plugin marketplace add HKUDS/CLI-Anything
/plugin install cli-anything
Enter fullscreen mode Exit fullscreen mode

Now /cli-anything slash commands are available in your Claude Code session.

OpenCode

Clone the repo, copy command files and HARNESS.md to ~/.config/opencode/commands/. This adds:

  • /cli-anything
  • /cli-anything-refine
  • /cli-anything-test
  • /cli-anything-validate
  • /cli-anything-list

Codex

bash CLI-Anything/codex-skill/scripts/install.sh
Enter fullscreen mode Exit fullscreen mode

Qodercli

bash CLI-Anything/qoder-plugin/setup-qodercli.sh
Enter fullscreen mode Exit fullscreen mode

Windows note

Requires Git for Windows (includes bash and cygpath) or WSL. Native Windows shell is not supported. If you see cygpath: command not found, install Git for Windows and retry.

Installing the generated CLI

After generating a CLI:

cd <software>/agent-harness
pip install -e .
Enter fullscreen mode Exit fullscreen mode

This uses editable mode (-e), so changes to the generated source take effect immediately.

Generating your first CLI

After installing the plugin, generate a CLI with one command. For GIMP:

In Claude Code:

/cli-anything ./gimp
Enter fullscreen mode Exit fullscreen mode

Or from GitHub:

/cli-anything https://github.com/blender/blender
Enter fullscreen mode Exit fullscreen mode

The plugin runs the 7-phase pipeline. For large codebases, this may take several minutes.

Phase 1 (Analyze): Reads source code, maps GUI actions to APIs, and produces a software-specific SOP document (GIMP.md).

Phase 3 (Implement): Builds the CLI with Python's Click framework. All commands support --json output, stateful operations store state in JSON, and an interactive REPL with colored prompts and history is included.

Directory structure example:

gimp/
  agent-harness/
    GIMP.md           # SOP document
    setup.py
    cli_anything/     # Namespace package (PEP 420)
      gimp/
        README.md
        gimp_cli.py   # Main entry point
        core/         # Project/session/export modules
        utils/        # REPL, helpers
        tests/
          test_core.py
          test_full_e2e.py
          TEST.md
Enter fullscreen mode Exit fullscreen mode

Generated CLIs use the cli_anything.* namespace (e.g., cli_anything.gimp), preventing naming conflicts when generating multiple CLIs.

Using the generated CLI

After pip install -e . in agent-harness, a new CLI is available:

cli-anything-gimp --help
Enter fullscreen mode Exit fullscreen mode

This lists all commands. Each tool generates a CLI named cli-anything-<software>.

Human-readable output (default)

# Start a new project
cli-anything-gimp project new --width 1920 --height 1080

# List layers
cli-anything-gimp layer list

# Add a layer
cli-anything-gimp layer add --name "Background" --type solid --color "#ffffff"

# Apply a filter
cli-anything-gimp filter apply --name "gaussian-blur" --radius 3

# Export
cli-anything-gimp export save --format png --output ./output.png
Enter fullscreen mode Exit fullscreen mode

JSON output for AI agents

AI agents use --json for machine-readable output:

cli-anything-gimp --json project new --width 1920 --height 1080
# Returns: {"status": "ok", "project_id": "proj_abc123", "width": 1920, "height": 1080}

cli-anything-gimp --json layer add -n "Background"
# Returns: {"status": "ok", "layer_id": "layer_001", "name": "Background"}
Enter fullscreen mode Exit fullscreen mode

JSON output is consistent: status, operation fields, and error details as needed.

Interactive REPL mode

For extended sessions, launch the REPL:

cli-anything-gimp
Enter fullscreen mode Exit fullscreen mode

This opens an interactive shell with colored prompts, tab completion, and persistent history—great for iterating before scripting.

Undo/redo

State-changing commands support a 50-level undo stack:

cli-anything-gimp undo
cli-anything-gimp redo
Enter fullscreen mode Exit fullscreen mode

Refining and testing your CLI

First-generation CLIs may be incomplete. Use /cli-anything:refine to analyze and fill gaps.

General refinement

/cli-anything:refine /home/user/gimp
Enter fullscreen mode Exit fullscreen mode

This identifies uncovered operations and adds missing commands.

Focused refinement

/cli-anything:refine /home/user/blender "particle systems and physics simulation"
Enter fullscreen mode Exit fullscreen mode

Target a specific area for refinement.

Running tests

/cli-anything:test /home/user/gimp
Enter fullscreen mode Exit fullscreen mode

Runs all test suites, updating TEST.md with results. The project reports 1,508+ passing tests across 11 applications at a 100% pass rate.

Validation

/cli-anything:validate /home/user/gimp
Enter fullscreen mode Exit fullscreen mode

Checks the CLI harness against HARNESS.md to confirm structure and requirements.

Listing available CLIs

/cli-anything:list
/cli-anything:list --json        # Machine-readable
/cli-anything:list --path /home  # Search specific directory
Enter fullscreen mode Exit fullscreen mode

Real-world use cases

CLI-Anything works with 11+ applications. Example workflows:

Image processing pipelines with GIMP

Automate batch image edits—resize, watermark, export—no GUI needed:

cli-anything-gimp project open --file product.jpg
cli-anything-gimp layer add --name "Watermark" --type image --source watermark.png
cli-anything-gimp layer position --name "Watermark" --x 10 --y 10
cli-anything-gimp export save --format webp --output product-final.webp
Enter fullscreen mode Exit fullscreen mode

Document generation with LibreOffice

Generate PDFs from templates, fill cells with data, and export:

cli-anything-libreoffice document open --template invoice-template.ods
cli-anything-libreoffice cell set --address "B5" --value "Acme Corp"
cli-anything-libreoffice cell set --address "C10" --value "1500.00"
cli-anything-libreoffice export pdf --output invoice-2026-001.pdf
Enter fullscreen mode Exit fullscreen mode

3D rendering with Blender

Queue renders, set scene parameters, manage output—all scriptable:

cli-anything-blender scene open --file product-scene.blend
cli-anything-blender render set --samples 256 --output /renders/product
cli-anything-blender render start --format png
Enter fullscreen mode Exit fullscreen mode

Streaming automation with OBS Studio

Script scene transitions, source management, and recording:

cli-anything-obs scene set --name "Main Camera"
cli-anything-obs recording start
cli-anything-obs scene set --name "Screen Share"
cli-anything-obs recording stop --output session.mp4
Enter fullscreen mode Exit fullscreen mode

CI/CD integration

Add to CI/CD pipelines—e.g., GitHub Actions that build renders or generate PDFs on commit.

Building agent workflows with Apidog

CLI-Anything handles local software. Most real agent workflows also need external APIs: upload images to a CDN, send PDFs to DMS, push videos to review platforms.

Apidog covers that. It's a free API client for testing, documenting, and automating REST API calls.

Example: Processing product images with GIMP, then uploading via a cloud storage API.

With Apidog:

  1. Set up an environment with API credentials as variables.
  2. Test the upload endpoint with a sample file.
  3. Add assertions to verify the file URL in the response.
  4. Export working request as curl/code snippet for your agent script.

This eliminates guesswork—verify your API calls before integrating them into your automation.

Apidog also supports automated test suites, so you can add assertions for every execution and catch regressions early.

Limitations to know about

Windows support requires Git Bash or WSL

Generated CLIs need bash-style path handling. On Windows, use Git for Windows or WSL. PowerShell is not supported.

The target software must be installed

CLI-Anything does not bundle wrapped software. Install GIMP, Blender, LibreOffice, etc., on the same machine as the generated CLI.

Python-only output

Generated CLIs are Python Click apps. No Node.js, Go, or other language output.

Claude Code is the stable platform

Claude Code is the main supported environment. Codex and OpenCode are experimental.

Generation quality depends on the codebase

If the codebase is poorly structured or tightly coupled to the GUI, the analysis may miss commands. Refinement helps, but complex/proprietary software may be harder to wrap.

FAQ

Does CLI-Anything work with any software?

In principle, yes—if the codebase is accessible. Works best with open-source projects where GUI actions map cleanly to API calls. Demonstrated on GIMP, Blender, Inkscape, Audacity, Kdenlive, Shotcut, OBS Studio, Draw.io, LibreOffice, AnyGen, and Zoom.

Is the project free to use?

Yes. CLI-Anything is MIT licensed and open source at github.com/HKUDS/CLI-Anything.

Do I need to know Python to use it?

No. You need Python 3.10+, but no coding is required; the plugin generates Python code automatically.

Can I use the generated CLI from my own code (not just AI agents)?

Yes. The CLI is a standard command-line tool—call it from shell scripts, Makefiles, Python, etc.

What's HARNESS.md?

HARNESS.md defines the expected structure and requirements of a CLI-Anything harness. Validation checks your CLI against this spec.

Can I generate CLIs for internal/private tools?

Yes. Point the plugin at any local codebase; it runs locally and doesn't send code anywhere.

How does this compare to Model Context Protocol (MCP)?

MCP connects agents to external services via a server protocol. CLI-Anything generates local CLI wrappers for GUI apps with no APIs. Use both: MCP for cloud, CLI-Anything for desktop apps.

Additional resources

Top comments (0)