Skip to main content
skill CX Codex

cli-anything-macrocli — Claude Code skill: GUI macros via CLI

This skill converts GUI workflows into parameterized CLI commands. An agent calls macro run <name> with parameters, and the system automatically routes execution to the right backend — API, file transformation, or UI automation.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add HKUDS/CLI-Anything --skill cli-anything-macrocli -a claude-code
Open on GitHub

What cli-anything-macrocli does

MacroCLI lets agents call GUI macros without touching the interface directly. Instead, the agent invokes macro run <name> with parameters, and the runtime picks the right backend: native API, file transformation, keyboard control, or precompiled coordinate replay.

The skill provides commands to list macros (macro list), inspect schema (macro info), test without side effects (--dry-run), and run with JSON output. Macros are defined in YAML with parameters, preconditions, steps, and postconditions — this lets you reuse complex workflows. Requires Python 3.10+.

Each macro can be tagged with a danger level and side effects, helping the agent decide if extra validation is needed. Backends are selected automatically by step type — no manual routing.

What it helps with

  • Call and manage GUI automation from an agent without direct UI interaction
  • Reuse complex workflows as parameterized macros
  • Safely test macros before execution with dry-run
  • Automatically route macro steps to the right backend
  • Transform JSON, XML, and text files through a single interface

Example prompts for the agent

  • See what macros are available: cli-anything-macrocli macro list --json
  • Run a JSON transform macro with parameters: cli-anything-macrocli macro run transform_json --param file=/tmp/config.json --param key=theme --param value=dark --json
  • Check a macro's parameters before running it: cli-anything-macrocli macro info export_file --json

How to install cli-anything-macrocli

1Skills CLI (Vercel)

npx skills add HKUDS/CLI-Anything --skill cli-anything-macrocli -a claude-code

2Manually: put the files in place

~/.claude/skills/cli-anything-macrocli/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/cli-anything-macrocli/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about cli-anything-macrocli

How do I install cli-anything-macrocli in Claude Code?

Run npx skills add HKUDS/CLI-Anything --skill cli-anything-macrocli -a claude-code. The skill will be installed to ~/.claude/skills/cli-anything-macrocli/.

What does cli-anything-macrocli do?

It lets agents call GUI macros via CLI instead of interacting with the UI directly. The system automatically routes each macro step to the right backend — API, file transformation, keyboard commands, or UI automation.

What does cli-anything-macrocli require to run?

Python 3.10 or later, plus PyYAML, click, and prompt-toolkit. These are installed automatically when you add the skill.

Source text

SKILL.md · Apache-2.0
---
name: "cli-anything-macrocli"
description: >
  Use when the agent wants to define, list, inspect, or execute GUI macros
  via the MacroCLI CLI. Macros are parameterized, CLI-callable
  workflows — the agent invokes `macro run <name>` and the system handles
  backend routing (plugin, file transform, accessibility, compiled GUI replay).
---

# MacroCLI CLI

## What It Is

The MacroCLI converts valuable GUI workflows into parameterized,
CLI-callable macros. Agents **never touch the GUI directly** — they call macros
through this stable CLI, and the runtime routes execution to the best available
backend (native plugin/API, file transformation, semantic UI control, or
precompiled GUI macro replay).

## Installation

```bash
cd macrocli/agent-harness
pip install -e .
```

**Requirements:** Python 3.10+, PyYAML, click, prompt-toolkit.

## Quick Start (for agents)

```bash
# 1. See what macros are available
cli-anything-macrocli macro list --json

# 2. Inspect a macro's parameters
cli-anything-macrocli macro info export_file --json

# 3. Dry-run to check params without side effects
cli-anything-macrocli --dry-run macro run export_file \
    --param output=/tmp/test.txt --json

# 4. Execute a macro
cli-anything-macrocli macro run export_file \
    --param output=/tmp/result.txt --json

# 5. See what backends are available
cli-anything-macrocli backends --json
```

## Command Reference

### Global Flags

| Flag | Description |
|------|-------------|
| `--json` | Machine-readable JSON output on stdout |
| `--dry-run` | Simulate all steps, skip side effects |
| `--session-id <id>` | Resume or create a named session |

### `macro` group

| Command | Description |
|---------|-------------|
| `macro list` | List all available macros |
| `macro info <name>` | Show macro schema (parameters, steps, conditions) |
| `macro run <name> --param k=v` | Execute a macro |
| `macro dry-run <name> --param k=v` | Simulate without side effects |
| `macro validate [name]` | Structural validation |
| `macro define <name>` | Scaffold a new macro YAML |

### `session` group

| Command | Description |
|---------|-------------|
| `session status` | Show session statistics |
| `session history` | Show recent run history |
| `session save` | Persist session to disk |
| `session list` | List all saved sessions |

### `backends`

```bash
cli-anything-macrocli backends --json
# Shows: native_api, file_transform, semantic_ui, gui_macro, recovery
# and whether each is available in the current environment.
```

## Macro Parameters

Pass parameters with `--param key=value`. Repeat for multiple:

```bash
cli-anything-macrocli macro run transform_json \
    --param file=/path/to/data.json \
    --param key=settings.theme \
    --param value=dark \
    --json
```

## Output Format (--json)

All commands output JSON when `--json` is set:

```json
{
  "success": true,
  "macro_name": "export_file",
  "output": {
    "exported_file": "/tmp/result.txt"
  },
  "error": "",
  "telemetry": {
    "duration_ms": 312,
    "steps_total": 2,
    "steps_run": 2,
    "backends_used": ["native_api"],
    "dry_run": false
  }
}
```

On failure (`"success": false`), read the `"error"` field for the reason.
Exit code is 1 on failure.

## Execution Backends

Backends are selected automatically based on the macro step definition:

| Backend | Triggered by | Use case |
|---------|-------------|----------|
| `native_api` | `backend: native_api` | Subprocess / shell command |
| `file_transform` | `backend: file_transform` | XML, JSON, text file editing |
| `semantic_ui` | `backend: semantic_ui` | Accessibility / keyboard shortcuts |
| `gui_macro` | `backend: gui_macro` | Precompiled coordinate replay |
| `recovery` | `backend: recovery` | Retry / fallback orchestration |

## Writing Macros

Macros are YAML files in `cli_anything/macrocli/macro_definitions/`.
Scaffold one with:

```bash
cli-anything-macrocli macro define my_macro --output \
    cli_anything/macrocli/macro_definitions/examples/my_macro.yaml
```

Minimal schema:

```yaml
name: my_macro
version: "1.0"
description: What this macro does.

parameters:
  output:
    type: string
    required: true
    description: Where to write results.
    example: /tmp/result.txt

preconditions:
  - file_exists: /path/to/input

steps:
  - id: step1
    backend: native_api
    action: run_command
    params:
      command: [my-app, --export, "${output}"]
    timeout_ms: 30000
    on_failure: fail  # or: skip, continue

postconditions:
  - file_exists: ${output}
  - file_size_gt: [${output}, 100]

outputs:
  - name: result_file
    path: ${output}

agent_hints:
  danger_level: safe  # safe | moderate | dangerous
  side_effects: [creates_file]
  reversible: true
```

## Agent Usage Rules

1. **Always use `--json`** for programmatic output.
2. **Use `--dry-run` to validate params** before executing side-effectful macros.
3. **Check `success` field** — do not assume success from exit code alone.
4. **Read `error` field** when `success` is false — it explains what failed.
5. **Use `macro info <name>` to discover params** before calling `macro run`.
6. **Use absolute paths** for all file parameters.

## Example Workflow

```bash
# Step 1: What's available?
cli-anything-macrocli macro list --json

# Step 2: What params does transform_json need?
cli-anything-macrocli macro info transform_json --json

# Step 3: Test safely
cli-anything-macrocli --dry-run macro run transform_json \
    --param file=/tmp/config.json \
    --param key=theme \
    --param value=dark --json

# Step 4: Execute for real
cli-anything-macrocli macro run transform_json \
    --param file=/tmp/config.json \
    --param key=theme \
    --param value=dark --json
```

## Version

1.0.0

© HKUDS · Apache-2.0 · HKUDS/CLI-Anything

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set55

cli-anything-nsight-graphics Runs NVIDIA Nsight Graphics captures and analysis from the command line. Use it when investigating frames or GPU trace output. CX Codex +1 412installs cli-anything-lldb This skill runs stateful LLDB workflows with JSON output for breakpoints, process inspection, memory reads, and AI-client debugging through DAP. CX Codex +1 405installs cli-anything-quietshrink Compresses macOS screen recordings using Apple Silicon hardware HEVC encoding without stressing the CPU. It reduces .mov and .mp4 file size by 70–90% with visually lossless quality. CX Codex +1 387installs cli-anything-sbox A CLI with 79+ commands for s&box (Source 2): edit scenes, prefabs, materials, and configs from your agent, generate C# code, and validate your project without launching the editor. CX Codex +1 378installs cli-anything-firefly-iii Connects coding agents to Firefly III via a stateless command-line interface. Helps track accounts and transactions without lingering background processes. CX Codex +1 347installs cli-anything-mailchimp A skill that hands your agent a CLI harness for the Mailchimp Marketing API v3.0: 303 commands covering lists, campaigns, reports and automations. Useful when audiences and sends belong in code, not in the web UI. CX Codex +1 340installs cli-anything-nslogger CLI harness for parsing, filtering, and streaming NSLogger files. It lets your coding agent inspect iOS and macOS crash logs without launching the desktop GUI. CX Codex +1 331installs cli-anything-calibre Controls Calibre libraries, edits e-book metadata, and runs format conversions directly from CLI agents. CX Codex +1 322installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor