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
- 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
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 -> trueUse cases
Before updating
chowbea-axios diff
chowbea-axios fetchRead first. Regret less.
Reviewing PR changes
chowbea-axios diff --spec ./feature-spec.jsonAPI version migration
chowbea-axios fetch --endpoint https://api.example.com/v1/docs
chowbea-axios diff --spec ./v2-openapi.jsonNo current spec
Nothing cached yet:
│ ⚠ No local spec found - nothing to compare against
│ ✓ Run 'chowbea-axios fetch' first to download the specNext Steps
After review:
chowbea-axios fetch