api2cli

api2cli is a skill for Claude Code, Codex from alexknowshtml/api2cli. It costs 101 tokens per session (2,948 once invoked), scanned A, original, MIT.

A generator that turns an API (a service software can call) into a Node.js command-line program and a Claude Code skill. It can start from API documentation, a live base URL, or a captured endpoint catalogue.

In plain words
What is it for?
Inspecting an API, cataloguing its endpoints, scaffolding a Commander.js CLI for people and agents, and generating a skill folder for the resulting CLI.
Why use it?
It removes much of the repeated work of discovering endpoints, building an API client, creating command-line commands, and teaching an agent how to use them.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths; mentions Claude Code.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node bin/cli.js https://example.com.

Good fit Inspecting an API, cataloguing its endpoints, scaffolding a Commander.js CLI for people and agents, and generating a skill folder for the resulting CLI.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/alexknowshtml/api2cli
agentmods
npx agentmods add skills/alexknowshtml/api2cli/skill

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for api2cli

README.md
[![agentmods](https://agentmods.dev/badge/skills/alexknowshtml/api2cli/skill/github.svg)](https://agentmods.dev/skills/alexknowshtml/api2cli/skill)
Your own site
<a href="https://agentmods.dev/skills/alexknowshtml/api2cli/skill"><img src="https://agentmods.dev/badge/skills/alexknowshtml/api2cli/skill/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for api2cli

Your own site · 80×15
<a href="https://agentmods.dev/skills/alexknowshtml/api2cli/skill"><img src="https://agentmods.dev/badge/skills/alexknowshtml/api2cli/skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 101 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,948 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00101 $0.02948
Opus 5.5 $0.00040 $0.01179
Sonnet 5.5 $0.00020 $0.00590
Haiku 4.5 $0.00010 $0.00295

Measured 1mo ago against content hash 92918ec1d1ef, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

api2cli 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 1mo 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.

skill/SKILL.md · 337 lines

How it starts

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

api2cli

Generate a working Node.js CLI from any API, then wrap it in a Claude Code skill. Discovers endpoints, scaffolds a dual-mode Commander.js CLI with a full-featured API client, and creates a skill folder so Claude knows how to use it.

Workflow

  1. Identify the API -- user provides a docs URL, a live API base URL, or a peek-api capture
  2. Discover endpoints -- parse docs, probe the API, or read a peek-api catalog
  3. Build endpoint catalog -- normalize all discovered endpoints into a standard format
  4. Generate CLI -- scaffold Commander.js CLI from the catalog
  5. User chooses destination -- scaffold into current project or create standalone project
  6. Generate skill -- create a SKILL.md that teaches Claude how to use the generated CLI

Step 1: Identify the API

Ask the user:

  • "What API do you want to wrap? Share a docs URL, a base URL, or point me at a peek-api capture."

Determine which discovery paths to use based on what they provide:

Input Discovery Path
Docs URL (e.g., https://docs.stripe.com/api) Docs parsing + active probing
Base URL (e.g., https://api.example.com/v1) Active probing
peek-api capture dir (e.g., ./peek-api-linkedin/) Read existing catalog
Live website URL Suggest running peek-api first, then active probing

Also ask:

  • "What auth does this API use?" (API key, Bearer token, cookies, OAuth, none)
  • "Do you want this CLI in your current project or as a standalone project?"

Step 2: Discover Endpoints

Use all applicable discovery paths. Combine results into a single catalog.

Path A: Docs Parsing

  1. Fetch the docs URL with WebFetch
  2. Extract endpoint information: method, path, description, parameters, request/response examples
  3. Look for pagination patterns, auth requirements, rate limit info
  4. Follow links to sub-pages for individual endpoint docs if the main page is an index

Path B: Active Probing

  1. Check well-known paths for API specs:
    • /.well-known/openapi.json, /.well-known/openapi.yaml
    • /openapi.json, /openapi.yaml, /swagger.json, /swagger.yaml
    • /api-docs, /docs, /api/docs
    • /graphql (with introspection query)
  2. Try OPTIONS on the base URL and common resource paths
  3. Probe common REST patterns: /api/v1/, /api/v2/, /v1/, /v2/
  4. For each discovered resource, try standard CRUD: GET /resources, GET /resources/:id, POST /resources, etc.
  5. Parse response shapes to understand data models
  6. Check response headers for rate limit info (X-RateLimit-*, Retry-After)
  7. Check for pagination patterns in responses (next, cursor, page, offset)

Read the full file on GitHub · 337 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 1mo ago First seen · 337 lines · 101 tokens per session scan A 92918ec1d1ef

Subscribe to this mod's changes

api2cli is a skill published in the GitHub repository alexknowshtml/api2cli (454 stars, last pushed 8mo ago), licensed MIT. It adds 101 tokens to every session and 2,948 once invoked, about $0.0004 per session on Opus 5.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.