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):
- Command-line arguments
- Environment variables (prefixed with
OPENAPI_NEXUS_) - Configuration file (
openapi-nexus-config.toml) - 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