cli-anything-refine

A command that expands an existing CLI-Anything harness, which is a command-line interface for operating a piece of software through an agent.

In plain words
What is it for?
Use it with a local software directory to inspect its current coverage, add commands or modules, and create or update tests for a specific focus area.
Why use it?
It helps fill gaps when the current harness does not cover the software actions you need.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/hkuds/cli-anything/cli-anything-refine
Clone the repo
git clone --depth 1 https://github.com/HKUDS/CLI-Anything
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 507 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00021 $0.00507
Opus 5 $0.00010 $0.00253
Sonnet 5 $0.00004 $0.00101
Haiku 4.5 $0.00002 $0.00051

Measured 3d ago against content hash 2b79256982ba, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cli-anything-refine scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

cursor-plugin/commands/cli-anything-refine.md · 56 lines

How it starts

The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.

cli-anything-refine Command

Refine an existing CLI harness after a successful /cli-anything build.

Target software: first argument (local path required). Focus area: optional second argument / trailing natural-language focus.

CRITICAL: Resolve PLUGIN_ROOT (absolute paths only)

Resolve PLUGIN_ROOT in this order (first hit with references/HARNESS.md wins):

  1. Read %USERPROFILE%\.cursor\cli-anything-generator.root or ~/.cursor/cli-anything-generator.root
  2. Else {default-or-$CURSOR_PLUGINS_HOME}/local/cli-anything/PLUGIN_ROOT.txt
  3. Else that candidate directory if references/HARNESS.md exists
  4. Else workspace / cloned cli-anything-plugin/

Then read {PLUGIN_ROOT}/references/HARNESS.md and {PLUGIN_ROOT}/references/commands/refine.md with absolute paths.

Cursor Tool Bindings

Cursor tool Role
Read / Grep / Glob Inventory current CLI coverage and target APIs
Shell Run existing tests; verify new commands
Write / StrReplace Add commands, modules, and tests

Arguments

  • Local software path only (same tree used for the original build). Clone first with /cli-anything if needed.
  • Optional focus area narrows gap analysis (e.g. "picture-in-picture features").

Phase Gates and Resume (hard gate)

Progress: {software-root}/agent-harness/.cli-anything-progress.json with "mode": "refine".

  • Steps: inventory → capability scan → gap analysis → implement → test → document.
  • Do not advance a step until the previous is completed in the progress file.
  • Resume incomplete refine runs; do not remove existing commands unless the user requests a breaking change.
  • Mark terminal: true when refine completes or is permanently aborted.

Refine checklist

  • Inventory current commands/tests before coding
  • Prefer high-impact gaps and thin wrappers around real backend APIs
  • Add matching unit/E2E coverage for every new command surface
  • Keep HARNESS packaging and --json / REPL standards

Read the full file on GitHub · 56 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 56 lines · 21 tokens per session scan A 2b79256982ba

Subscribe to this mod's changes

cli-anything-refine is a command published in the GitHub repository HKUDS/CLI-Anything (48,809 stars, last pushed 12d ago), licensed Apache-2.0. It adds 21 tokens to every session and 507 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.