chowbea-axios
Commands

diff

Preview API changes before regenerating types.

diff compares your cached spec against a new one — remote or local — and tells you what moved before you run fetch and discover breaking changes in TypeScript instead of in this terminal.

Added endpoints, deleted endpoints, modified request bodies. The stuff that makes api.op methods appear, vanish, or change signature.

Usage

chowbea-axios diff [flags]

What it shows

  1. Added operations — new endpoints in the spec
  2. Removed operations — endpoints that no longer exist
  3. Modified operations — changes to existing endpoints

Flags

FlagShortDescriptionDefault
--config-cPath to api.config.tomlAuto-detected
--spec-sPath to new spec file to compare againstRemote endpoint
--quiet-qSuppress non-error outputfalse
--verbose-vShow detailed outputfalse

Examples

Compare with remote

chowbea-axios diff

Compare with local file

chowbea-axios diff --spec ./new-openapi.json

Output

No changes

╭────────────────────────────────────────
│ chowbea-axios diff
├────────────────────────────────────────

│ ✓ Loaded current spec (operations=42)
│ ✓ Fetching new spec from endpoint...
│ ✓ Analyzed new spec (operations=42)

│ ✓ Spec is identical to cached version - no changes

With changes

╭────────────────────────────────────────
│ chowbea-axios diff
├────────────────────────────────────────

│ ✓ Loaded current spec (operations=42)
│ ✓ Analyzed new spec (operations=45)

├────────────────────────────────────────
│ Changes Summary
├────────────────────────────────────────

│ + Added operations (3):
│   + POST /api/v1/notifications (createNotification)
│   + GET /api/v1/notifications/{id} (getNotification)
│   + DELETE /api/v1/notifications/{id} (deleteNotification)

│ - Removed operations (1):
│   - GET /api/v1/legacy/users (getLegacyUsers)

│ ~ Modified operations (2):
│   ~ PUT /api/v1/users/{id} (updateUser)
│     Request body: false -> true
│   ~ GET /api/v1/posts (listPosts)
│     Summary changed

╰────────────────────────────────────────

│ ✓ Total changes (added=3, removed=1, modified=2)

│ Run 'chowbea-axios fetch' to apply these changes

Change detection

Added operations

Present in new spec, absent in cache:

│ + Added operations (3):
│   + POST /api/v1/users (createUser)
│   + GET /api/v1/users/{id} (getUserById)
│   + DELETE /api/v1/users/{id} (deleteUser)

New operationId → new api.op method after fetch. Update your query layer accordingly.

Removed operations

In cache, gone from new spec:

│ - Removed operations (1):
│   - GET /api/v1/deprecated (deprecatedEndpoint)

TypeScript will flag dead imports from api.contracts.ts after you fetch. That's a feature.

Modified operations

Detects method changes, path changes, request body added/removed, summary changes:

│ ~ Modified operations (1):
│   ~ PUT /api/v1/users/{id} (updateUser)
│     Request body: false -> true

Use cases

Before updating

chowbea-axios diff
chowbea-axios fetch

Read first. Regret less.

Reviewing PR changes

chowbea-axios diff --spec ./feature-spec.json

API version migration

chowbea-axios fetch --endpoint https://api.example.com/v1/docs
chowbea-axios diff --spec ./v2-openapi.json

No current spec

Nothing cached yet:

│ ⚠ No local spec found - nothing to compare against
│ ✓ Run 'chowbea-axios fetch' first to download the spec

Next Steps

After review:

chowbea-axios fetch

On this page