The Problem

APIs are everywhere, but building a CLI for one is a slog. You’ve got to manually go through the docs, figure out endpoints, handle authentication, pagination, errors, and then (if you’re feeling fancy) format the output for both humans and machines. Oh, and if you want to integrate it with AI tools like Claude? Good luck. It’s a ton of boilerplate, repetitive code, and you’ll probably still miss something.

What This Does

api2cli automates all of that nonsense. Point it at an API (docs, live endpoint, or a peek-api capture), and it spits out two things: A Commander.js-based CLI with commands for every endpoint, complete with dual-mode output—human-readable in the terminal, JSON when piped. A SKILL.md file that teaches Claude how to use the CLI.

The heavy lifting happens in the skill/ folder, which contains templates and patterns (commander-patterns.md, api-client-template.md) to generate the CLI and skill. The root directory has your usual suspects: README.md, LICENSE, and .gitignore. The magic is in the SKILL.md, which becomes the operating manual for Claude, allowing it to use the CLI like a pro.

Real-World Use

Say you’re working with the Resend API, but you don’t want to spend hours writing a CLI. Just tell Claude:

api2cli discovers the endpoints, generates a CLI (scripts/resend.ts), and creates a skill file (.claude/skills/resend/SKILL.md). Now you can: Use the CLI directly: Or let Claude handle the commands in your project, because it knows how to use the CLI thanks to the generated skill file.

The Bottom Line

api2cli is a niche but powerful tool. If you’re building CLIs for APIs and want to integrate them with Claude or other AI agents, this will save you a ton of time. That said, it’s not for everyone—it’s a dependency on Claude Code, and if you just need a quick curl wrapper, this is probably overkill. But if you’re in the business of making APIs usable for both humans and machines, give it a spin.