test

A command that runs the tests for a CLI harness and records the results in TEST.md. A CLI harness is the command-line layer that lets scripts or users operate another application's functions.

In plain words
What is it for?
Use it with a local software directory or GitHub repository to locate its harness, run the pytest suite, capture output, verify the subprocess backend, and append the test results.
Why use it?
It standardizes test execution and preserves the outcome in the project documentation. It also checks that the tests are using the installed command-line program rather than an unintended implementation.

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/test
Clone the repo
git clone --depth 1 https://github.com/HKUDS/CLI-Anything
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 537 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.00000 $0.00537
Opus 5 $0.00000 $0.00269
Sonnet 5 $0.00000 $0.00107
Haiku 4.5 $0.00000 $0.00054

Measured yesterday against content hash 97c8e1fca0be, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

test 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 yesterday.

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.

cli-anything-plugin/commands/test.md · 74 lines

How it starts

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

cli-anything:test Command

Run tests for a CLI harness and update TEST.md with results.

CRITICAL: Read HARNESS.md First

Before running tests, read ./HARNESS.md. It defines the test standards, expected structure, and what constitutes a passing test suite.

Usage

/cli-anything:test <software-path-or-repo>

Arguments

  • <software-path-or-repo> - Required. Either:

    • A local path to the software source code (e.g., /home/user/gimp, ./blender)
    • A GitHub repository URL (e.g., https://github.com/GNOME/gimp, github.com/blender/blender)

    If a GitHub URL is provided, the agent clones the repo locally first, then works on the local copy.

    The software name is derived from the directory name. The agent locates the CLI harness at /root/cli-anything/<software-name>/agent-harness/.

What This Command Does

  1. Locates the CLI - Finds the CLI harness based on the software path
  2. Runs pytest - Executes tests with -v -s --tb=short
  3. Captures output - Saves full test results
  4. Verifies subprocess backend - Confirms [_resolve_cli] Using installed command: appears in output
  5. Updates TEST.md - Appends results to the Test Results section
  6. Reports status - Shows pass/fail summary

Test Output Format

The command appends to TEST.md:

## Test Results

Last run: 2024-03-05 14:30:00

[full pytest -v --tb=no output]


**Summary**: 103 passed in 3.05s

Example

# Run all tests for GIMP CLI
/cli-anything:test /home/user/gimp

# Run tests for Blender from GitHub
/cli-anything:test https://github.com/blender/blender

Success Criteria

  • All tests pass (100% pass rate)
  • TEST.md is updated with full results
  • No test failures or errors
  • [_resolve_cli] output confirms installed command path

Failure Handling

If tests fail:

  1. Shows which tests failed
  2. Does NOT update TEST.md (keeps previous passing results)
  3. Suggests fixes based on error messages
  4. Offers to re-run after fixes

Read the full file on GitHub · 74 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. yesterday First seen · 74 lines · 0 tokens per session scan A 97c8e1fca0be

Subscribe to this mod's changes

test is a command published in the GitHub repository HKUDS/CLI-Anything (48,669 stars, last pushed 11d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 537 tokens. 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.