chowbea-axios
Commands

diff

Preview API changes before regenerating types.

The diff command compares your cached spec with a new version (remote or local) and shows what operations have been added, removed, or modified.

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

Shows operations present in new spec but not in current:

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

Removed Operations

Shows operations in current spec but not in new:

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

Modified Operations

Shows operations that changed. Detects:

  • HTTP 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

See what changed before running fetch:

# Preview changes
chowbea-axios diff

# If changes look good, apply them
chowbea-axios fetch

Reviewing PR Changes

Compare current spec with a PR's changes:

# Check changes from a feature branch spec
chowbea-axios diff --spec ./feature-spec.json

API Version Migration

Compare two versions of an API:

# First cache the old version
chowbea-axios fetch --endpoint https://api.example.com/v1/docs

# Then diff against new version
chowbea-axios diff --spec ./v2-openapi.json

No Current Spec

If you don't have a cached spec yet:

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

Next Steps

After reviewing changes, apply them:

chowbea-axios fetch

On this page