Skip to content

Build a CLI tool to validate and add new API previews #15

@akuligowski9

Description

@akuligowski9

Adding a new API preview currently requires manually creating a JSON file and knowing the correct format. A CLI tool would make this much more accessible for contributors.

Proposed solution
A Node.js CLI script (extending the existing scripts/generate-previews.cjs) that:

  1. Accepts an API name or slug as input
  2. Fetches a sample response from the API
  3. Auto-detects the best preview type
  4. Writes the preview JSON file
  5. Validates the output builds correctly

Usage example

node scripts/add-preview.cjs --api "cat-facts"

Acceptance criteria

  • Works for APIs in catalog.json
  • Validates the generated preview renders without errors
  • Handles auth-required APIs gracefully with a prompt for the key

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthardChallenging implementationhelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions