chowbea-axios
Commands

generate

Generate types and operations from cached or local spec.

generate regenerates from disk. No network, no hash dance — just read the cached spec and rewrite _generated/. Use it when you're offline, iterating on generator output, or you've already copied a spec into _internal/.

For "did the remote API change?" use fetch. For "I have a spec file, make TypeScript" use this.

Usage

chowbea-axios generate [flags]

What it does

  1. Reads the cached spec from _internal/openapi.json
  2. Generates api.contracts.ts and api.types.ts from OpenAPI schemas
  3. Generates api.operations.ts from endpoints with operationId (skips the rest)
  4. Creates client files if they don't exist

Flags

FlagShortDescriptionDefault
--config-cPath to api.config.tomlAuto-detected
--spec-file-sUse specific local spec file-
--dry-run-nPreview without writing filesfalse
--types-only-Generate only TypeScript typesfalse
--operations-only-Generate only operationsfalse
--quiet-qSuppress non-error outputfalse
--verbose-vShow detailed outputfalse

Examples

Basic generate

chowbea-axios generate

Use specific spec file

chowbea-axios generate --spec-file ./openapi.json

Copies to cache first. Subsequent generate calls use that copy.

Dry run

chowbea-axios generate --dry-run

Generate only types

chowbea-axios generate --types-only

Generate only operations

chowbea-axios generate --operations-only

When to use generate

  • Working offline with a cached spec
  • Quick iteration without network round-trips
  • Local spec files that aren't served over HTTP
  • Testing changes to the generation process

Prerequisites

No cache? You'll get a helpful error, not a stack trace:

Error [SPEC_NOT_FOUND]: OpenAPI spec not found at: app/services/api/_internal/openapi.json

Recovery: Run 'chowbea-axios fetch' to download the spec from the remote endpoint.

Using local spec files

chowbea-axios generate --spec-file ./docs/api-spec.json

File is copied to cache before generation. Future generate calls use it until replaced by fetch.

Difference from fetch

fetchgenerate
Downloads spec from remoteUses cached/local spec
Checks for changesAlways regenerates
Network requiredWorks offline
Updates cacheReads from cache

Generated output

Same as fetch:

api.contracts.ts
api.types.ts
api.operations.ts

Import named types from api.contracts.ts. Call via api.op. See The Query Layer.

Next Steps

On this page