cli-to-plugin

A generator that turns a command-line program into a self-contained Claude Code plugin. It reads the program's --help output and creates skills for groups of commands.

In plain words
What is it for?
Use it to inspect a CLI's command tree, generate a plugin into a chosen folder, load a saved help tree, or regenerate an existing plugin.
Why use it?
It removes much of the manual work needed to document a CLI and package its commands for use by a coding agent.

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/fakoli/fakoli-plugins/cli-to-plugin
Clone the repo
git clone --depth 1 https://github.com/fakoli/fakoli-plugins
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,102 The whole file, excluding the scripts and references it only reads on demand.
Security scan E 3 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.00012 $0.04102
Opus 5 $0.00006 $0.02051
Sonnet 5 $0.00002 $0.00820
Haiku 4.5 $0.00001 $0.00410

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

Security

Grade E, and why

cli-to-plugin scanned grade E with 3 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 2d 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

Install it: curl -LsSf https://astral.sh/uv/install.sh | sh

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf "<out>/.regen-tmp"

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

Install it: curl -LsSf https://astral.sh/uv/install.sh | sh
plugins/cli-to-plugin/commands/cli-to-plugin.md · 445 lines

How it starts

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

cli-to-plugin

Convert a CLI tool into a Claude Code plugin by walking its --help tree, generating one skill per command group, and (optionally) proposing workflow meta-skills for the user to curate.

Full spec in the marketplace repository: docs/specs/2026-05-24-cli-to-plugin.md

Argument parsing

Parse the invocation before doing anything else:

  • <cli-name> — required; the binary to introspect (e.g., gh, kubectl)
  • --out <path> — destination directory for the generated plugin; default: ./plugins/<cli-name>
  • --override <path> — YAML override file; optional
  • --from-tree <path> — load a pre-captured help-tree JSON instead of running discovery
  • --no-meta-skills — skip Steps 5, 6, and 7 entirely
  • --regen — hint that regeneration is expected (triggers the regeneration flow automatically without prompting twice)
  • --max-depth <n> — max recursion depth for discover.py (default 3); forwarded as --max-depth to the script
  • --max-commands <n> — halt discovery if the walked command count exceeds this (default 500); forwarded as --max-commands to the script

Treat unrecognised flags as an error: halt and print usage.


Pre-Step-0 — Override file validation

If --override <path> is set, verify the file exists and parses as YAML before running any other step. This runs regardless of --from-tree, so a broken override file fails fast.

test -f "$OVERRIDE_PATH" || { echo "HALT: override file not found: $OVERRIDE_PATH"; exit 1; }
uv run --with pyyaml -c "import yaml, sys; yaml.safe_load(open(sys.argv[1]))" -- "$OVERRIDE_PATH"

Passing the path via sys.argv rather than interpolating it inside the Python string protects against paths containing single quotes (e.g., /tmp/it's-here.yaml).

On failure: halt with the parse error.


Step 0 — Regeneration guard

Skip this step entirely when --out does not exist or is empty.

When --out exists and is non-empty:

  • If --regen was passed: set REGEN_MODE=diff-merge automatically and skip the prompt. Proceed to Step 1.
  • If --regen was NOT passed: ask the user:

Read the full file on GitHub · 445 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. 2d ago First seen · 445 lines · 12 tokens per session scan E 95fb07607feb

Subscribe to this mod's changes

cli-to-plugin is a command published in the GitHub repository fakoli/fakoli-plugins (4 stars, last pushed 24d ago), licensed MIT. It adds 12 tokens to every session and 4,102 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it E with 3 findings (downloads and executes remote code, recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.