Nokturn is a Rust toolchain that turns an OpenAPI v3 specification into an idiomatic Rust SDK. The nokturn-gen CLI can generate SDKs for Cloudflare, DigitalOcean, Exoscale, Hetzner, Scaleway and any provider that publishes an OpenAPI spec.
crates/nokturn-core: Loads OpenAPI v3 (JSON/YAML), applies a small sanitization pass, resolves component references, and defines the canonical IR for code generation.crates/nokturn-gen: CLI wrapper (binary name:nokturn-gen) that reads the config/spec, resolves the schema, and is the home for upcoming SDK generation.
Code generation is in progress. Today nokturn-gen generate validates the config and resolves the OpenAPI spec, but does not yet emit SDK source files.
cargo build --manifest-path crates/Cargo.toml -p nokturn-gen
cargo install --path ./crates/nokturn-gencargo run --manifest-path crates/Cargo.toml -p nokturn-gen -- \
--log-level debug \
generate \
--schema open-api-specs/digitalocean/digitalocean.yaml \
--config open-api-specs/digitalocean/config.toml \
--output-dir generated/digitalocean
nokturn-gen generate --schema <schema-file> --output-dir <output-directory> --config <config-file>You can also run the binary directly after a release build:
(cd crates && cargo build --release)
./crates/target/release/nokturn-gen --log-level info generate \
--schema open-api-specs/digitalocean/digitalocean.yaml \
--config open-api-specs/digitalocean/config.toml \
--output-dir generated/digitalocean
nokturn-gen --log-level debug generate --schema openapi.yaml --config config.toml --output-dir ./outputSupported log levels: trace, debug, info, warn, error.
Nokturn uses a TOML configuration file to customize the generated SDK. Here's an example configuration:
crate_name = "digitalocean"
version = "0.1.0-alpha"
edition = "2024" # optional
description = "Unofficial Rust SDK for DigitalOcean"
lib_status = "experimental"
keywords = ["digitalocean"]
api_url = "https://api.digitalocean.com/v2"
authors = ["Cloudflavor GmbH <foss@cloudflavor.io>"]
# Optional filtering
include_only = ["User", "Account"]
exclude = ["InternalModel"]In-tree examples live under open-api-specs/*/config.toml.
crate_name: The name of the generated Rust crateversion: The version of the generated crateedition: The Rust edition to use (defaults to "2021")description: A brief description of the cratelib_status: The maintenance status of the library (e.g., "active", "deprecated", "experimental")keywords: A list of keywords for the crateapi_url: The base URL for the APIauthors: A list of authors for the crateinclude_only: (Optional) A list of models to include (if not specified, all models are included)exclude: (Optional) A list of models to exclude
nokturn-gen generate \
--schema path/to/openapi.yaml \
--config config.toml \
--output-dir ./outputThe output will contain a Cargo crate with a typical src/ layout and a Cargo.toml that exposes optional features like rustls, native-tls and http2.