REA
Reverse engineer anything from your terminal or agent with one CLI and MCP server.
Audience-aware CLI patterns for Node.js + Commander.js. Build CLIs for humans, AI agents, or both.
作者の方は、このコードを README に貼れます。バッジはこのページにリンクします。
[](https://mcp.popnx.com/en/skills/alexknowshtml-api2cli)同じ作業で AI をサービスにつなぐ MCP
Reverse engineer anything from your terminal or agent with one CLI and MCP server.
Codebase intelligence for TypeScript and JavaScript, exposed as structured MCP analysis tools.
MCP server for terminal commands, file operations, and process management
同じ種類の作業。Skill 一覧と同じ並び
| これ api2cli | rea | andrej-karpathy-skills | graphify | MoneyPrinterTurbo | |
|---|---|---|---|---|---|
| 作者 | alexknowshtml | morluto | multica-ai | Graphify-Labs | harry0703 |
| Skill 数 | 1 | 1 | 1 | 1 | 1 |
| GitHub スター | 455 | 463,670 | 233,682 | 148,887 | 143,987 |
| 最終コード更新 | 2026年2月20日 | 2026年11月17日 | 2026年4月20日 | 2026年11月17日 | 2026年11月16日 |
| ライセンス | MIT | MIT | – | Apache-2.0 | MIT |
alexknowshtml による 1 個の Skill(指示セット)。AI が読んでそのとおりに作業します · MCP server ではありません
MCP = 手
AI を外部のサービスやデータにつなぎます(例:Notion を読む、請求書を作る)。プログラムやサーバーが動いている必要があります。
Skill = 手順書
作業のやり方を AI に教えるテキストファイル。どのサービスにもつながりません。
重なる部分もあります。ツールを呼ぶスクリプト付きの Skill や、知識だけを渡す MCP もあります。やりたい作業から選んでください。
Claude Code
提供元の README と repo のフォルダから判断
GitHub account alexknowshtml (person), 18 years old
★ 455 stars, few users so far · code last changed 2026年2月20日
No, plain text files the AI reads and follows
No scripts, so it does not go online by itself
No hooks or writes to machine settings found
Checked automatically from the repo files at commit fde6f88 (read only, nothing was run). Not a safety guarantee: read it and decide for yourself
まず:どの AI を使っていますか
使っているアプリを選ぶと、そのアプリでのインストール方法だけが表示されます
Uploading to claude.ai would fail: the description is over 200 characters (408). Use "Let the AI install it" instead
この文をコピーして Claude Code のチャットに貼り付けます
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Claude Code を開き直し、/skill と入力するか関連する作業を頼むと Claude が自動で使います
Checked against official docs 2026年11月12日 · Source: code.claude.com
Skill は AI が従う指示です。入れる前にファイルを読み、信頼できる提供元のものだけを入れてください。
Mac:Command+スペースで Terminal と入力 · Windows:下のコマンドは PowerShell では動きません。上の「AI にインストールしてもらう」を使ってください
repo を一時フォルダにダウンロードし、SKILL.md のあるフォルダだけをコピーします
コマンドを確認中 · 確認が通るとコピーボタンが出ます
ChatGPT デスクトップアプリには Codex が組み込まれていて、Codex は ~/.agents/skills フォルダから Skill を読み込みます
ChatGPT デスクトップアプリで Codex を開き、この文をチャットに貼り付けます
The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
api2cli フォルダを ~/.agents/skills/api2cli に置きます
~ はホームフォルダ($HOME)です
Skill は AI が従う指示です。入れる前にファイルを読み、信頼できる提供元のものだけを入れてください。
Mac:Command+スペースで Terminal と入力 · Windows:下のコマンドは PowerShell では動きません。上の「AI にインストールしてもらう」を使ってください
repo を一時フォルダにダウンロードし、SKILL.md のあるフォルダだけをコピーします
コマンドを確認中 · 確認が通るとコピーボタンが出ます
Checked against official docs 2026年11月15日 · Source: learn.chatgpt.com
自分でインストールした Skill は使えません。ディレクトリのプラグインに含まれる Skill だけが使えます
この Skill を ChatGPT で使うには、上の方法で ChatGPT デスクトップアプリを使ってください
Checked against official docs 2026年11月15日 · Source: learn.chatgpt.com
この文をコピーして Codex のチャットに貼り付けます · ChatGPT デスクトップアプリ内の Codex、Codex CLI、IDE 拡張機能で使えます
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Codex は新しくインストールした Skill を自動で見つけます。表示されない場合は Codex を再起動してください · 使い方:ChatGPT では @ を入力して Skill を選びます · Codex CLI や IDE 拡張機能では /skills を実行するか、$ に続けて Skill 名を入力します
Checked against official docs 2026年11月15日 · Source: learn.chatgpt.com
Skill は AI が従う指示です。入れる前にファイルを読み、信頼できる提供元のものだけを入れてください。
Mac:Command+スペースで Terminal と入力 · Windows:下のコマンドは PowerShell では動きません。上の「AI にインストールしてもらう」を使ってください
repo を一時フォルダにダウンロードし、SKILL.md のあるフォルダだけをコピーします
コマンドを確認中 · 確認が通るとコピーボタンが出ます
この文をコピーして Cursor のチャットに貼り付けます
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Cursor の Agent チャットで / を入力し skill を選ぶ
Checked against official docs 2026年11月12日 · Source: cursor.com
Skill は AI が従う指示です。入れる前にファイルを読み、信頼できる提供元のものだけを入れてください。
Mac:Command+スペースで Terminal と入力 · Windows:下のコマンドは PowerShell では動きません。上の「AI にインストールしてもらう」を使ってください
repo を一時フォルダにダウンロードし、SKILL.md のあるフォルダだけをコピーします
コマンドを確認中 · 確認が通るとコピーボタンが出ます
Skill を読めるほかのアプリ向けです。この文には Claude Code、Codex、Cursor のパスが入っていて、AI が使っているアプリに合わせて選びます · Copy this sentence into the app’s chat
For one project, paste it into a chat that is open in that project’s folder · The AI always shows you the path before installing
The AI tells you what it will do first and asks your permission at every step
Checked against official docs 2026年11月12日 · Source: code.claude.com, learn.chatgpt.com, cursor.com
Gemini CLI や GitHub Copilot など Agent Skills 対応の他のアプリはフォルダが違います。そのアプリのガイドを見て、SKILL.md のあるフォルダをコピーしてください。
2026年11月11日 に Claude Code、Codex、Cursor の公式ガイドで skill フォルダを確認
以下は提供元の repo の文章で、PopNx MCP の指示ではありません
最初の 8,000 文字を表示 · GitHub で全文を開く
---
name: api2cli
description: Generate a working CLI from any API, then wrap it in a Claude Code skill. Point it at API docs, a live URL, or a peek-api capture and get a dual-mode Commander.js CLI (human + agent output) plus a ready-to-use skill folder. Use when user wants to wrap an API in a CLI, generate a CLI from API docs, turn an API into a command-line tool, scaffold a CLI from discovered endpoints, or create a skill for an API.
---
# 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`)
See `references/discovery-strategies.md` for detailed probing patterns.
### Path C: peek-api Capture
1. Read the capture directory: `endpoints.json`, `auth.json`, `CAPTURE.md`
2. Parse endpoints into the standard catalog format
3. Extract auth headers and cookies from `auth.json`
If peek-api is not installed or no capture exists, tell the user:
```
To capture endpoints from a live site, install peek-api:
git clone https://github.com/alexknowshtml/peek-api
cd peek-api && npm install
node bin/cli.js https://example.com
```
## Step 3: Build Endpoint Catalog
Normalize all discovered endpoints into this format:
```typescript
interface EndpointCatalog {
service: string; // e.g., "stripe", "nexudus"
baseUrl: string;
auth: {
type: 'api-key' | 'bearer' | 'cookies' | 'oauth' | 'none';
headerName?: string; // e.g., "Authorization", "X-API-Key"
envVar: string; // e.g., "STRIPE_API_KEY"
};
pagination?: {
style: 'cursor' | 'offset' | 'page' | 'link-header';
paramName: string; // e.g., "starting_after", "offset", "page"
responseField: string; // e.g., "has_more", "next", "next_page_url"
};
rateLimit?: {
requests: number;
window: string; // e.g., "1m", "1h"
};
resources: ResourceGroup[];
}
interface ResourceGroup {
name: string; // e.g., "customers", "invoices"
description: string;
endpoints: Endpoint[];
}
interface Endpoint {
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
path: string; // e.g., "/v1/customers/:id"
description: string;
parameters: Parameter[];
requestBody?: object; // JSON schema or example
responseExample?: object;
}
interface Parameter {
name: string;
in: 'path' | 'query' | 'header';
required: boolean;
type: string;
description: string;
}
```
Present the catalog to the user for review before generating:
```
Found 24 endpoints across 5 resources:
customers (6 endpoints): list, get, create, update, delete, search
invoices (5 endpoints): list, get, create, send, void
...
Ready to generate the CLI?
```
## Step 4: Generate CLI
Generate a dual-mode CLI using Commander.js. The CLI auto-detects human vs agent output via `process.stdout.isTTY`.
### File Structure
**In-project scaffold:**
```
scripts/
{service}.ts # Entry point with shebang
{service}/
lib/
client.ts # API client (auth, pagination, retry, caching)
envelope.ts # Agent JSON envelope helpers
commands/
{resource}.ts # One file per resource group
```
**Standalone project:**
```
{service}-cli/
package.json
tsconfig.json
bin/
{service}.ts # Entry point with shebang
src/
lib/
client.ts
envelope.ts
commands/
{resource}.ts
```
### Code Generation Patterns
See these references for the patterns to apply during generation:
- `references/api-client-template.md` -- API client class with pagination, retry, rate limiting, caching
- `references/agent-first-patterns.md` -- JSON envelope, HATEOAS next_actions, context-safe output, error fix suggestions
- `references/commander-patterns.md` -- Commander.js subcommands, global options, interactive prompts, colored output
### Key Generation Rules
**Entry point (`{service}.ts`):**
- Shebang: `#!/usr/bin/env npx tsx`
- Self-documenting root command (no args → prints full command tree as JSON)
- Global options: `--json` (force JSON output), `--verbose`, `--config <path>`
**API client (`lib/client.ts`):**
- Constructor takes base URL + auth config
- Auth from env var (name based on `catalog.auth.envVar`)
- Built-in pagination matching the API's pattern
- Retry with exponential backoff for 5xx and 429 errors
- Rate limiting based on discovered limits
- Optional response caching
**Envelope helpers (`lib/envelope.ts`):**
```typescript
const isAgent = !process.stdout.isTTY;
function respond(command: string, result: any, nextActions: Action[] = []) {
if (isAgent) {
console.log(JSON.stringify({ ok: true, command, result, next_actions: nextActions }));
} else {
return result; // caller handles human rendering
}
}
function respondError(command: string, message: string, code: string, fix: string, nextActions: Action[] = []) {
if (isAgent) {
console.log(JSON.stringify({ ok: false, command, error: { message, code }, fix, next_actions: nextActions }));
} else {
console.error(`Error: ${message}`);
console.error(`Fix: ${fix}`);
}
process.exit(1);
}
```
**Command files (`commands/{resource}.ts`):**
- One file per resource group
- Each endpoint becomes a subcommand: `mycli customers list`, `mycli customers get <id>`
- `list` commands: support `--limit`, `--offset`/`--cursor`, `--status` (if filterable)
- `get` commands: take ID as argument
- `質問、コツの共有、使えないことの報告ができます。「役に立った」の多い順です。