npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

apicmd

v0.3.0

Published

Turn any API into a CLI. Designed for LLM agents.

Readme

apicmd

Turn any API into a CLI. Designed for LLM agents, works great for humans too.

Give it an OpenAPI spec URL — it generates a CLI with named operations, parameter validation, and --help that always shows the latest endpoints. No spec? Raw mode works with any HTTP API and learns endpoints from your usage history.

Install

# npm
npx apicmd

# bun
bunx apicmd

Quick Start

# Spec mode — point to an OpenAPI spec
apicmd init https://api.example.com/openapi.json --name myapi --auth 'Bearer $API_KEY'
apicmd myapi --help              # list all operations
apicmd myapi listUsers           # call by operation name

# Raw mode — any HTTP API, no spec needed
apicmd init https://api.example.com --name myapi --auth 'Bearer $API_KEY' --raw
apicmd myapi GET /users          # call any endpoint
apicmd myapi --help              # shows endpoints from your usage history

Setup

apicmd init <url> --name <name> [--auth <header>] [--ttl <hours>]   # Spec mode
apicmd init <url> --name <name> [--auth <header>] --raw             # Raw mode

| Flag | Description | |------|-------------| | <url> | OpenAPI spec URL (spec mode) or base URL (raw mode) | | --name | Short name for the API (used in all commands) | | --auth | Auth header, supports env vars: 'Bearer $MY_KEY' | | --ttl | Spec cache TTL in hours (default: 24) | | --raw | Raw mode — skip spec, use HTTP method + path |

Usage

Spec Mode

apicmd myapi --help                                    # list all operations with required params
apicmd myapi createIssue --help                        # show all params for an operation
apicmd myapi createIssue --title "Bug" --priority 2    # call an operation

Operations are auto-generated from the OpenAPI spec. The spec is cached and auto-refreshed based on the TTL (default 24 hours). --help always fetches the latest.

Raw Mode

apicmd myapi GET /api/users                                        # GET request
apicmd myapi POST /api/users --name "Alice" --email "[email protected]"      # POST with JSON body
apicmd myapi GET /api/users/{id} --id 123                          # path params via {placeholder}

How params are resolved:

  • {key} in the path → replaced with --key value
  • Remaining params on GET → query string
  • Remaining params on POST/PUT/PATCH → JSON body
  • Numbers and booleans are auto-coerced

Both Modes

Raw HTTP calls (apicmd myapi GET /path) work on any registered API, even spec mode ones. Use whichever is more convenient.

Auth

Auth supports env var references — the actual secret is never stored on disk:

apicmd init https://api.example.com/openapi.json --name myapi --auth 'Bearer $MY_API_KEY'

Literal keys also work:

apicmd init https://api.example.com/openapi.json --name myapi --auth 'Bearer sk-abc123'

Management

apicmd list          # show all registered APIs
apicmd --help        # show usage

Config

Stored in ~/.apicmd/<name>.json:

{
  "name": "myapi",
  "url": "https://api.example.com/openapi.json",
  "auth": "Bearer $MY_API_KEY"
}

That's it. The spec is cached after the first --help or operation call and auto-refreshed when stale.

For LLM Agents

Add this to your agent's global instructions (e.g. ~/.claude/CLAUDE.md):

Use `apicmd` CLI for API calls. Run `apicmd list` to see available APIs,
`apicmd <name> --help` for operations, `apicmd <name> <op> --help` for params.

The LLM runs --help once to discover all operations and required params, then calls them directly. No curl, no JSON construction, no auth headers.

License

MIT