DEV Community

Preecha
Preecha

Posted on

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

CLI-Anything: Generate CLIs for GUI Applications Your AI Agent Can Use

CLI-Anything is an open-source plugin for AI coding agents—primarily Claude Code—that generates a full command-line interface for software with an accessible codebase. Point it at GIMP, Blender, LibreOffice, or another application, and it analyzes the source code to produce a structured CLI that an AI agent can use programmatically.

Try Apidog today

The problem: AI agents cannot use most GUI software directly

Modern software is split between two worlds that rarely connect cleanly.

API-first services such as cloud storage, payment processors, email providers, and analytics platforms expose HTTP APIs. An AI agent can call them directly with standard tools.

Professional desktop software is different. GIMP, Blender, LibreOffice, and Audacity were primarily designed for people to operate through graphical interfaces. Their capabilities are exposed through menus, buttons, and dialogs rather than structured APIs.

Connecting an AI agent to these applications usually means choosing between two imperfect approaches:

  • Write a custom wrapper: This can take weeks and may break when the application changes.
  • Use robotic process automation (RPA): RPA tools simulate clicks using screenshots, coordinates, or pixel matching. These workflows can break when layouts, themes, or display scaling change.

CLI-Anything takes a different approach. Instead of simulating GUI interactions, it analyzes the application's source code to find the APIs that the GUI already uses. It then generates a CLI that calls those APIs directly.

The agent does not need to see the screen. It issues structured commands, and the target application performs the work.

If your agent workflow also needs to call external REST APIs, Apidog handles the API testing side. It is a free tool for sending, inspecting, and organizing API requests so you can verify integrations before adding them to your agent workflow.

What CLI-Anything generates

CLI-Anything is an open-source plugin built by HKUDS, the Hong Kong University Data Science Lab. Its creator, Chao Huang, described the project this way:

"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."

At the time of writing, the project has more than 6,100 GitHub stars.

The plugin runs inside Claude Code and has experimental integrations for Codex and OpenCode. You point it at a software codebase, and it runs a seven-phase pipeline:

  1. Analyze — Scan the source code, map GUI actions to underlying APIs, and produce a software-specific standard operating procedure document.
  2. Design — Define command groups, state models, and output formats.
  3. Implement — Build a Click-based Python CLI with REPL mode, --json output, and undo/redo support.
  4. Plan tests — Create a TEST.md file containing unit and end-to-end test plans.
  5. Write tests — Generate test_core.py for unit tests with synthetic data and test_full_e2e.py for tests using real files.
  6. Document — Run pytest and append the results to TEST.md.
  7. Publish — Create setup.py, configure console-script entry points, and install the CLI on your PATH.

After phase seven, you have a working CLI installed locally. For example:

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

Generated CLIs follow a consistent design:

  • Human-readable table output by default
  • Machine-readable JSON output with --json
  • Persistent project state
  • Undo/redo support
  • Interactive REPL mode

This consistency means an AI agent can reuse the same interaction patterns across different applications.

Install CLI-Anything

CLI-Anything is a Python-based plugin, not an npm package. You install it into your AI coding agent. The generated CLIs are Python packages installed with pip install -e ..

Requirements

  • Python 3.10 or later
  • The target application installed on your system
  • A supported AI coding agent:
    • Claude Code is the primary platform
    • Codex and OpenCode integrations are experimental

Claude Code

In Claude Code, add the marketplace and install the plugin:

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

This adds the /cli-anything slash commands to your Claude Code session.

OpenCode

Clone the repository, then copy the command files and HARNESS.md to:

~/.config/opencode/commands/
Enter fullscreen mode Exit fullscreen mode

This adds the following commands:

/cli-anything
/cli-anything-refine
/cli-anything-test
/cli-anything-validate
/cli-anything-list
Enter fullscreen mode Exit fullscreen mode

Codex

Run the installation script:

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

Qodercli

Run the Qodercli setup script:

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

Windows

The plugin requires Git for Windows, which includes bash and cygpath, or WSL. Native Windows shell is not supported.

If you see this error:

cygpath: command not found
Enter fullscreen mode Exit fullscreen mode

Install Git for Windows and retry.

Install a generated CLI

After CLI-Anything generates a harness, install it from the agent-harness directory:

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

Editable mode means changes to the generated source remain available without reinstalling the package.

Generate your first CLI

Once the plugin is installed, generation requires a single command.

For a local GIMP codebase:

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

For a GitHub repository:

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

The plugin starts the seven-phase pipeline. Generation takes a few minutes depending on the size of the codebase and the number of API surfaces it exposes.

What happens during analysis

During phase one, CLI-Anything reads the source code and maps GUI actions to their underlying API calls.

For GIMP, this can include operations such as:

  • Creating layers
  • Applying filters
  • Exporting files
  • Managing projects

The plugin writes a software-specific SOP document, such as GIMP.md, describing the supported operations.

During phase three, it builds the CLI with Python's Click framework. Commands support --json output, and stateful operations—such as opening a file or creating a project—store state in a JSON file. The generated CLI also includes an interactive REPL with colored prompts and persistent history.

Generated directory structure

A generated GIMP CLI may look like this:

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

All generated CLIs use the cli_anything.* namespace. For example:

cli_anything.gimp
Enter fullscreen mode Exit fullscreen mode

This helps prevent naming conflicts when you generate CLIs for multiple applications.

Use the generated CLI

After installing the generated package, inspect the available commands:

cd gimp/agent-harness
pip install -e .

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

The naming convention is:

cli-anything-<software>
Enter fullscreen mode Exit fullscreen mode

Human-readable output

Human-readable output is the 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 the project
cli-anything-gimp export save \
  --format png \
  --output ./output.png
Enter fullscreen mode Exit fullscreen mode

JSON output for AI agents

Use --json when the caller needs machine-readable responses:

cli-anything-gimp --json project new \
  --width 1920 \
  --height 1080
Enter fullscreen mode Exit fullscreen mode

Example response:

{
  "status": "ok",
  "project_id": "proj_abc123",
  "width": 1920,
  "height": 1080
}
Enter fullscreen mode Exit fullscreen mode

Another command might return:

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

The JSON format includes a status field, operation-specific fields, and error details when an operation fails.

Interactive REPL mode

For longer sessions, start the CLI without a subcommand:

cli-anything-gimp
Enter fullscreen mode Exit fullscreen mode

The REPL provides colored prompts, tab completion, and persistent history. It is useful for exploring commands interactively before turning them into scripts or agent actions.

Undo and redo

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

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

Refine and test the generated CLI

The first generated CLI may not cover every capability of the target application. CLI-Anything provides commands for gap analysis, testing, and validation.

Refine the CLI

Run a general refinement pass:

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

This compares the existing CLI with the application's API surface, identifies missing operations, and adds commands for the gaps.

You can also focus refinement on a specific area:

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

The focused version targets the specified part of the codebase instead of re-analyzing everything.

Run the test suites

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

This runs the test suites and updates TEST.md with the results. The project reports more than 1,508 passing tests across 11 applications with a 100% pass rate.

Validate the harness

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

Validation checks the generated CLI harness against the HARNESS.md specification and verifies that it meets the required structural conventions.

List generated CLIs

List all available CLIs:

/cli-anything:list
Enter fullscreen mode Exit fullscreen mode

Request machine-readable output:

/cli-anything:list --json
Enter fullscreen mode Exit fullscreen mode

Search in a specific directory:

/cli-anything:list --path /home
Enter fullscreen mode Exit fullscreen mode

Practical use cases

CLI-Anything has been demonstrated with 11 applications. The following examples show how the generated commands can fit into real workflows.

Batch image processing with GIMP

An AI agent can resize product images, apply a watermark, and export multiple formats without interacting with the GUI:

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

The same command pattern can be applied repeatedly in a batch script.

Document generation with LibreOffice

LibreOffice can generate PDFs from templates. An agent can populate invoice, report, or contract data and export the result:

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

Blender render jobs can be configured and started without opening the GUI:

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

OBS workflows can be scripted for scene changes and recording controls:

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

Generated CLIs can run in CI/CD pipelines. For example:

  • Render a Blender scene on every commit.
  • Generate PDF release notes from a LibreOffice template.
  • Process image assets during a build.
  • Run the generated CLI's tests as part of validation.

Combine local CLIs with external APIs

CLI-Anything handles local desktop software. Production agent workflows often need external APIs as well—for example:

  • Upload a processed image to a CDN.
  • Send a generated PDF to a document management system.
  • Upload a rendered video to a review platform.

Apidog handles the API testing side. It is a free API client for testing, documenting, and automating REST API calls.

For example, suppose you are building an agent that processes product images with GIMP and uploads them to cloud storage. CLI-Anything gives the agent the GIMP commands, while Apidog helps you verify the storage API before writing the integration.

In Apidog, you can:

  1. Create an environment and store API credentials as variables.
  2. Test the upload endpoint with a sample file.
  3. Verify that the request format is correct.
  4. Add assertions that confirm the response includes the expected file URL.
  5. Export the working request as a curl command or code snippet.
  6. Add the request to your agent script.

This separates two potential failure points. You can confirm that the external API works before debugging the GIMP workflow and the API integration at the same time.

Apidog also supports automated test suites. Once the workflow works, add assertions that run during each execution to catch regressions.

Limitations

Windows requires Git Bash or WSL

Generated CLIs are Python applications that rely on bash-style path handling. Windows users need Git for Windows, which includes Bash and cygpath, or WSL. Native PowerShell is not supported.

The target software must already be installed

CLI-Anything does not bundle the applications it wraps. GIMP, Blender, LibreOffice, and other target applications must be installed on the same machine as the generated CLI.

The CLI calls the real application backends directly.

Generated CLIs are Python-only

CLI-Anything generates Python Click applications. It does not generate wrappers in other languages. If you need a Node.js or Go CLI, you must build that wrapper separately.

Claude Code is the stable platform

Claude Code is the primary and most-tested environment. Codex and OpenCode integrations are experimental, so behavior may vary outside Claude Code.

Generation quality depends on the codebase

The plugin must identify the APIs behind GUI actions. If the codebase is poorly structured, heavily obfuscated, or tightly coupled to GUI state, the analysis may miss commands or produce incomplete wrappers.

The refinement workflow can improve coverage, but complex proprietary software may be more difficult to wrap cleanly.

FAQ

Does CLI-Anything work with any software?

In principle, CLI-Anything can generate a CLI for software with an accessible codebase. In practice, it works best with open-source applications where GUI actions map clearly to underlying API calls.

The project has demonstrated support for:

  • GIMP
  • Blender
  • Inkscape
  • Audacity
  • Kdenlive
  • Shotcut
  • OBS Studio
  • Draw.io
  • LibreOffice
  • AnyGen
  • Zoom

Is the project free to use?

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

Do I need to know Python?

No. The plugin generates the Python code for you. You do need Python 3.10 or later installed to run the generated CLIs.

Can I call the generated CLI from my own code?

Yes. The generated CLI is a standard command-line tool. You can call it from:

  • Shell scripts
  • Makefiles
  • Python programs
  • CI/CD jobs
  • Any program that can run a subprocess

What is HARNESS.md?

HARNESS.md defines the expected structure of a CLI-Anything-generated harness. It covers command structure, output formats, testing requirements, and packaging.

The validation command checks the generated CLI against this specification.

Can I generate CLIs for internal tools?

Yes. You can point the plugin at any local codebase, including private internal tools. The plugin runs locally and does not send your source code elsewhere.

How does CLI-Anything compare with Model Context Protocol (MCP)?

MCP connects AI agents to external services through a standardized server protocol. CLI-Anything generates local CLI wrappers for GUI applications that do not expose usable APIs.

They solve different problems. You can use both:

  • MCP for cloud and external services
  • CLI-Anything for local desktop software

Additional resources

  • CLI-Anything GitHub repository
  • CLI-Anything official website
  • Community guide
  • Apidog free API client

Top comments (1)

Collapse
 
topstar_ai profile image
Luis Cruz

The approach of analyzing source code to generate a structured CLI for GUI applications is a brilliant solution to a long-standing issue with AI agent integration. It not only simplifies the process but also ensures that the generated CLI remains robust against changes in the GUI, unlike traditional methods. One potential improvement could be incorporating user-defined customization options in the CLI output to enhance flexibility for specific use cases. If you're looking for help refining the testing phase or expanding CLI capabilities, I'd be glad to discuss a paid collaboration. How do you envision the project evolving to accommodate more complex GUIs in the future?