Skip to content

Configuration

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

The api-docs CLI uses sensible defaults and requires no configuration for basic usage. This page covers cache settings and advanced options.

Cache Location

API specifications are cached locally for fast repeated access:

~/.cache/api-docs-cli/specs/

On Windows:

%USERPROFILE%\.cache\api-docs-cli\specs\

Cache Structure

~/.cache/api-docs-cli/
  specs/
    manifest.json          # Index of all cached specs
    <hash>.json            # Individual spec files (SHA256 hash of URL)

TTL Settings

Cache Type TTL Description
API Specifications 24 hours Cached OpenAPI/Swagger specs
Provider Lookups 7 days APITracker.io provider-to-URL mappings
Indefinite No expiry Specs cached with ttl: null

Bypassing Cache

# Bypass spec cache for a single fetch
api-docs fetch https://api.example.com/openapi.json --no-cache

# Force refresh for endpoints command
api-docs endpoints stripe --force

# Force refresh APITracker lookup
api-docs fetch stripe --force

Browser Configuration

The CLI uses Puppeteer for extracting documentation from JavaScript-rendered pages (Swagger UI, Redoc).

Puppeteer Browser

By default, Puppeteer downloads its own Chromium binary. To use a system-installed browser:

# Set Chrome/Chromium path
export PUPPETEER_EXECUTABLE_PATH=/path/to/chrome

Common paths:

  • macOS: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
  • Linux: /usr/bin/google-chrome or /usr/bin/chromium-browser
  • Windows: C:\Program Files\Google\Chrome\Application\chrome.exe

Timeouts

Default timeouts for extraction operations:

Operation Timeout
Direct OpenAPI fetch 15 seconds
DOM scraping 30 seconds
Swagger UI extraction 30 seconds
Page navigation 30 seconds

Environment Variables

Variable Description
PUPPETEER_EXECUTABLE_PATH Path to Chrome/Chromium binary
NO_COLOR Disable colored output (set to any value)

npm Configuration

The package is published as @tidalstudios/api-docs-cli. No additional npm configuration is required.

Global Installation

npm install -g @tidalstudios/api-docs-cli

Using npx

npx @tidalstudios/api-docs-cli endpoints stripe

Clone this wiki locally