Skip to content

Command Reference

Logan McDuffie edited this page Dec 23, 2025 · 1 revision

Complete documentation for all api-docs CLI commands.

Global Usage

api-docs <command> [options]

Use --help with any command for detailed usage information.


endpoints

List all API endpoints in a scannable, color-coded format.

Syntax

api-docs endpoints <query> [options]

Arguments

Argument Description
query Provider name (e.g., "stripe", "n8n") or URL to API docs

Options

Option Short Description Default
--force -f Force fresh fetch (bypass cache) false
--verbose -v Show full descriptions instead of summaries false
--grouped -g Group endpoints by category/tag true

Examples

# List endpoints by provider name
api-docs endpoints stripe

# List endpoints from a URL
api-docs endpoints https://api.example.com/docs

# Show full descriptions
api-docs endpoints stripe --verbose

# Force refresh, ungrouped
api-docs endpoints stripe --force --no-grouped

endpoint

Get detailed information for a specific API endpoint.

Syntax

api-docs endpoint <url> <path> [options]

Arguments

Argument Description
url URL of the cached API spec
path Endpoint path (e.g., /users/{id})

Options

Option Short Description
--method -m HTTP method to show (e.g., GET, POST)

Examples

# Show all methods for an endpoint
api-docs endpoint https://api.stripe.com/openapi /v1/customers

# Show only GET method
api-docs endpoint https://api.stripe.com/openapi /v1/customers --method GET

Output

Displays:

  • HTTP method and path
  • Summary and description
  • Parameters (with required indicators)
  • Request body information
  • Response codes and descriptions

fetch

Fetch and cache an API specification.

Syntax

api-docs fetch <query> [options]

Arguments

Argument Description
query Provider name or URL to API docs

Options

Option Short Description Default
--force -f Force refresh (bypass APITracker cache) false
--no-cache Bypass spec cache (fetch fresh) false

Examples

# Fetch by provider name
api-docs fetch stripe

# Fetch by URL
api-docs fetch https://api.example.com/openapi.json

# Force refresh from source
api-docs fetch stripe --force

# Fetch without caching
api-docs fetch https://api.example.com/openapi.json --no-cache

list

Show all cached API specifications.

Syntax

api-docs list

Output

Displays for each cached spec:

  • API title
  • Source URL
  • Cache timestamp
  • Expiration status

Example

api-docs list

Output:

Cached API Specs (2):

  Stripe API
    URL: https://api.stripe.com/openapi
    Cached: 2024-01-15T10:30:00Z

  n8n API (expired)
    URL: https://docs.n8n.io/api
    Cached: 2024-01-10T08:00:00Z

clear

Clear cached API specifications.

Syntax

api-docs clear [url]

Arguments

Argument Description
url (Optional) URL of spec to clear. Omit to clear all.

Examples

# Clear all cached specs
api-docs clear

# Clear specific cached spec
api-docs clear https://api.stripe.com/openapi

Extraction Strategy

The CLI uses multiple extraction methods in order:

  1. Direct OpenAPI fetch - For URLs ending in .json, .yaml, or containing openapi/swagger
  2. DOM scraping - Extracts from Scalar, Redoc, and generic documentation pages
  3. Swagger UI extraction - Uses Puppeteer to extract from JavaScript-rendered Swagger UI pages
  4. APITracker discovery - For provider names, looks up documentation URLs via APITracker.io

Each method falls back to the next if extraction fails.

Clone this wiki locally