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
- Added operations - New endpoints in the spec
- Removed operations - Endpoints that no longer exist
- Modified operations - Changes to existing endpoints
Flags
| Flag | Short | Description | Default |
|---|---|---|---|
--config | -c | Path to api.config.toml | Auto-detected |
--spec | -s | Path to new spec file to compare against | Remote endpoint |
--quiet | -q | Suppress non-error output | false |
--verbose | -v | Show detailed output | false |
Examples
Compare with Remote
chowbea-axios diffCompare with Local File
chowbea-axios diff --spec ./new-openapi.jsonOutput
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 changesWith 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 changesChange 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 -> trueUse Cases
Before Updating
See what changed before running fetch:
# Preview changes
chowbea-axios diff
# If changes look good, apply them
chowbea-axios fetchReviewing PR Changes
Compare current spec with a PR's changes:
# Check changes from a feature branch spec
chowbea-axios diff --spec ./feature-spec.jsonAPI 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.jsonNo 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 specNext Steps
After reviewing changes, apply them:
chowbea-axios fetch