Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Getting Started

Installation

Download the latest binary from the releases page, or build from source:

cargo install --path crates/openapi-nexus

Requires Rust 1.90+ (edition 2024).

Basic Usage

Generate a TypeScript fetch client:

openapi-nexus generate \
  --input path/to/openapi.yaml \
  --output generated \
  --generator typescript-fetch

Generate both TypeScript and Go clients at once:

openapi-nexus generate \
  --input spec.yaml \
  --output output \
  --generators typescript-fetch,go-http

Configuration

Configuration is resolved with the following precedence (highest to lowest):

  1. Command-line arguments
  2. Environment variables (prefixed with OPENAPI_NEXUS_)
  3. Configuration file (openapi-nexus-config.toml)
  4. Defaults

Environment Variables

export OPENAPI_NEXUS_INPUT="spec.yaml"
export OPENAPI_NEXUS_OUTPUT="generated"
export OPENAPI_NEXUS_GENERATOR="typescript-fetch"

Configuration File

Create an openapi-nexus-config.toml in your project root. See the sample configuration file for all available options.

Generator-specific options live under [generators.<name>] sections:

[generators.go-http]
module_path = "github.com/myorg/myproject/sdk"

CLI Reference

openapi-nexus generate --help