Back to Blog

Category Guides

CLI-Anything Guide: Turning Desktop GUIs into Stateful, Agent-Native CLIs

September 5, 2026 · 14 min read

Every few months, the AI ecosystem gets captivated by a demo where an autonomous agent takes screenshots of a desktop, calculates pixel coordinates, and clicks through a graphic user interface like a tired human intern. It looks impressive on Twitter, but as an engineer building production systems, you quickly discover the reality: screenshot-based computer use is slow, brittle, non-deterministic, and burns through your context window like dry brush in a wildfire.

If a UI button moves five pixels to the left, an OS display scaling factor changes, or a tooltip renders half a second late, the visual agent derails. Worse, you are trading hundreds of thousands of vision tokens just to execute something that should take a single line of structured text.

That is why HKUDS/CLI-Anything (created by the Data Intelligence Lab at the University of Hong Kong) is one of the most important architectural developments of 2026. The thesis behind their research paper ("CLI-Anything: Towards Agent-Native Computer Use", arXiv:2606.03854) is straightforward: stop making agents play video games with user interfaces. Instead, give them structured, deterministic command-line harnesses with JSON output, session persistence, and instant execution.

In this comprehensive guide, I will break down the origin and verified identity of CLI-Anything, warn you about the unofficial clones polluting search results, show you how to install pre-built harnesses for tools like GIMP and Blender, demonstrate how to generate new harnesses from source inside Claude Code, and provide an architectural decision matrix so you know when to use CLI-Anything and when to stick with OpenAPI or MCP.

Origin, Identity & Canonical Verification

Before running a single installation command, let us establish exact provenance. In high-velocity open-source ecosystems, popular repositories inevitably attract copycats, unofficial forks, and scam downloads. CLI-Anything is no exception.

The canonical upstream repository is HKUDS/CLI-Anything. GitHub treats hkuds/cli-anything as the exact same repository under case-insensitive resolution. The project is an original creation from the Data Intelligence Lab at the University of Hong Kong—not a fork or side branch of another tool.

Crucial Security Warning: Avoid Unofficial Lookalikes

Do not download files from unofficial domains like cli-anything.com or third-party GitHub clones shipping mystery zip archives. The 4.5k forks on GitHub are downstream clones. Only install from the verified HKUDS organization on GitHub and the cli-anything-hub package on PyPI.

PropertyVerified Canonical Value
Canonical Repositoryhttps://github.com/HKUDS/CLI-Anything
Official OrganizationHKUDS — Data Intelligence Lab, University of Hong Kong
Upstream LineageOriginal project (fork: false, no parent repo, default branch: main)
Repository Metrics~48,900 Stars · ~4,500 Forks · 86 Open Issues (August 2026)
License & LanguageApache 2.0 · Python (>= 3.10)
Official Web Hubhttps://clianything.cc/
Official PyPI Packagecli-anything-hub (v0.4.1, author: HKUDS)
Academic PaperarXiv:2606.03854: "CLI-Anything: Towards Agent-Native Computer Use" (Yang, Fan, Huang)

What CLI-Anything Actually Is (And What It Isn't)

To use CLI-Anything effectively, you need to understand its boundaries. It is not a generic runtime bus like Zapier, nor is it a drop-in replacement for an enterprise REST API. Instead, it is a disciplined four-part system:

  • A Standardized Methodology (HARNESS.md): A rigorous blueprint for translating complex software into an agent-native CLI surface with persistent state.
  • A 7-Phase Agent Generation Pipeline: A multi-step workflow (/cli-anything) that guides coding models through analysis, design, implementation, test planning, test writing, documentation, and packaging.
  • A Curated Package Manager (cli-hub): A centralized catalog containing 40+ pre-built, tested harnesses for major software suites (including Blender, GIMP, LibreOffice, FreeCAD, and OBS).
  • Agent-Native Runtime Primitives: Built-in --json flags for machine consumption, interactive REPLs for stateful multi-turn sessions, undo/redo state stacks, and auto-generated SKILL.md files for automated agent discovery.

How does it talk to software? It avoids GUI vision models completely. Instead, typical CLI-Anything backends hook directly into the software's native scripting interfaces (such as Blender's bpy Python engine or GIMP's Script-Fu), parse structured interchange formats (SVG, XML, JSON), or drive headless process adapters.

However, there are three hard engineering constraints you must respect before planning a build:

  • Requires a Capable Coding Model: Generating a new harness requires an advanced reasoning model like Claude 3.7 Sonnet or Claude Opus. Smaller local models struggle with the 7-phase harness discipline.
  • Source Code is Paramount: While you can attempt to wrap closed binaries via headless wrappers, the quality of generated harnesses is dramatically higher when the agent has access to full open-source code.
  • The Upstream Software Must Still Be Installed: CLI-Anything generates the CLI bridge and harness; it does not replace the underlying rendering engine, CAD kernel, or graphic runtime.

Installation & Hands-On Workflow Guide

Prerequisites: Python 3.10 or higher installed on your system, plus the native upstream software (e.g., Blender, GIMP) if you intend to execute real commands. On Windows environments running Claude Code, ensure Git for Windows or WSL is installed because cygpath is required for Unix-style path translation.

There are two primary ways to work with CLI-Anything: consuming existing harnesses from the hub, or generating custom harnesses for unadapted codebases.

Workflow A: Consuming Existing Harnesses with cli-hub

Most developers start by using pre-built harnesses. You can search, inspect, and install verified harnesses directly from PyPI:

Terminal — CLI-Hub Setup & Management
bash
# 1. Install the official HKUDS hub package from PyPI
pip install cli-anything-hub

# 2. Search and discover available harnesses
cli-hub list
cli-hub search "3d modeling"
cli-hub info gimp

# 3. Install the GIMP harness
cli-hub install gimp

# 4. Inspect available commands
cli-hub launch gimp --help

# Optional: Opt out of hub telemetry
export CLI_HUB_NO_ANALYTICS=1

Once installed, your coding agent can invoke the CLI in one of two modes: direct one-shot execution with machine-readable JSON flags, or an interactive stateful REPL session that preserves project state across multiple agent steps:

Terminal — Invoking Generated Harnesses
bash
# Structured JSON output for agent parsing
cli-anything-gimp --json project list
cli-anything-gimp --json canvas resize --width 1920 --height 1080

# Interactive REPL mode for stateful agent sessions (with undo/redo)
cli-anything-gimp

# Alternatively, run directly from a local harness checkout in editable mode
cd gimp/agent-harness
pip install -e .
cli-anything-gimp --help

Workflow B: Generating a Brand-New CLI Harness with Claude Code

When you have an internal codebase or an open-source tool with no CLI, you point Claude Code at the source repository or local checkout and run the CLI-Anything plugin pipeline:

Claude Code Slash CommandsTerminal / Claude Code CLI

Register the official HKUDS plugin marketplace and execute the 7-phase generation pipeline on your target software repository:

# Step 1: Add the HKUDS marketplace and install the generator plugin /plugin marketplace add HKUDS/CLI-Anything /plugin install cli-anything # Step 2: Kick off the 7-phase analysis and generation against your local codebase /cli-anything ./your-software # Step 3: Refine specific sub-modules or high-priority integration surfaces /cli-anything:refine ./your-software "focus on the vector export and layer rendering engine" # Step 4: Run automated test harness validation /cli-anything:validate ./your-software

If you are working in Cursor or other IDE environments, HKUDS ships installation scripts that set up the exact same command playbook:

Terminal — Cursor & Extension Setup
bash
# Cursor Plugin Setup
git clone https://github.com/HKUDS/CLI-Anything.git
bash CLI-Anything/cursor-plugin/scripts/install.sh

# Pi Extension Setup
bash CLI-Anything/.pi-extension/cli-anything/install.sh

Community adapters are also available for OpenCode, Codex, Hermes, Reasonix, OpenClaw, Goose, Qodercli, and GitHub Copilot CLI. They all enforce the exact same HARNESS.md methodology, ensuring that whichever agent you deploy produces consistent, verifiable CLI tooling.

Architectural Decision Matrix: Is CLI-Anything the Right Choice?

One of the biggest mistakes I see teams make when modernizing their developer tooling is reaching for the shiny new framework without evaluating interface maturity. CLI-Anything is an exceptional tool when you need to bridge desktop software into agent workflows, but it is not a hammer for every nail.

Here is how I evaluate when to use CLI-Anything versus alternative patterns:

CLI-Anything vs. mcp2cli: Understanding the Inverse

Do not confuse CLI-Anything with runtime tools like mcp2cli. Tooling like mcp2cli operates on existing APIs (taking an MCP server, OpenAPI spec, or GraphQL schema and presenting a dynamic CLI at runtime). CLI-Anything works in the opposite direction: it takes raw software codebases that lack clean APIs and synthesizes permanent, stateful, test-backed CLI harnesses.

Your Current ArchitectureRecommended StrategyWhy This Path Wins
Both tools already have OpenAPI / REST / GraphQL / gRPCDirect MCP or Typed SDK (FastMCP, Speakeasy, openapi-mcp-generator)APIs already provide typed contracts, schema validation, and auth. Generating a CLI wrapper is an unnecessary layer of indirection.
Both tools are desktop / GUI software with open sourceCLI-Anything Generation PipelineEliminates fragile vision agents. Converts native scripting APIs (bpy, Script-Fu) into deterministic, testable command-line harnesses.
One tool has an API, the other is a GUI desktop toolHybrid: Keep API as MCP; wrap GUI with CLI-AnythingUse standard MCP for the API service, and generate a CLI-Anything harness for the GUI. Compose them cleanly with an orchestrating agent or shell script.
Need enterprise service-to-service communication (auth, SLA, versioning)Hand-crafted OpenAPI / gRPC ServiceProduction microservices need rigid backwards compatibility, auth tokens, rate limits, and latency SLAs. A generated agent CLI is a prototype, not a service bus.
Existing CLIs already exist for both toolsOrchestration Script or Native Agent ExecutionNo generator needed. Simply grant Claude Code execution rights and provide clear SKILL.md conventions.

The Sherpa Takeaway: Determinism Over Desktop Screenshots

In systems architecture, the most reliable interface is always the one with the smallest blast radius and the highest signal-to-noise ratio.

Visual computer use—asking a multimodal LLM to parse a 4K desktop display, predict coordinates, and issue simulated mouse clicks—is an impressive parlor trick, but it is an operational liability. It fails silently, burns token budgets on redundant pixels, and cannot easily be tested or versioned.

CLI-Anything provides the pragmatic alternative. By converting GUI engines into command-line harnesses with structured JSON responses, undo/redo state tracking, and isolated REPLs, it gives AI agents the exact abstraction layer they were designed to excel at: text-based, deterministic tools.

If you have legacy desktop software, specialized creative tools, or internal utilities that your team wants Claude Code or Cursor to drive autonomously, do not build a visual bot. Run CLI-Anything, generate a clean harness, verify it with tests, and let your agents work with the speed and reliability of the terminal.