TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/wevm/incur/llms.txt
Use this file to discover all available pages before exploring further.
Openapi module generates incur command entries from OpenAPI 3.x specifications, allowing you to mount REST APIs as CLI commands.
Functions
generateCommands
Generates incur command entries from an OpenAPI spec. Resolves all$ref pointers.
OpenAPI 3.x specification object
Fetch handler function that processes requests
Base path to prepend to all endpoint paths
Map of command names to generated command entries
Example
Types
OpenAPISpec
A minimal OpenAPI 3.x spec shape. Accepts both hand-written specs and generated ones (e.g., from@hono/zod-openapi).
FetchHandler
A fetch handler function.Standard Web API Request object
Standard Web API Response object
GeneratedCommand
A generated command entry compatible with incur’s internal CommandEntry.Zod schema for path parameters
Command description from
summary or description fieldZod schema for query parameters and request body properties
Command handler function
How It Works
Schema Mapping
The generator maps OpenAPI parameters and request bodies to incur command schemas: Path parameters →args schema
options schema
options schema
Command Naming
Commands are named usingoperationId if present, otherwise generated from method and path:
Type Coercion
CLI arguments are always strings, so the generator adds coercion for numeric and boolean types:Error Handling
The generated handler usescontext.error() for non-2xx responses:
Related
- Fetch - Low-level fetch utilities
- Mounting APIs - Guide to mounting REST APIs
- OpenAPI Integration - Advanced OpenAPI usage

