crozier
An ultra-fast, memory-efficient OpenAPI-to-SDK code generator written in Rust + minijinja. crozier reproduces Fern's generated SDKs byte-for-byte (with generator-identifying comments aside), driven by nothing but an OpenAPI document and a couple of naming flags — no per-project config, no generators written in the target language.
Python is the only target today; more will follow.
Status: early. crozier generates the Python type layer (pydantic models, enums, unions/aliases) plus
version.py/py.typed, and byte-matches Fern's output for those files. Seedocs/matching.mdfor exactly what is matched and the roadmap.
See it in action
One OpenAPI document in, a complete typed Python SDK out — crozier generate
writes the whole package in one shot, then you can read the code it produced:
The output is byte-for-byte Fern's. Here is the Pet model crozier emitted from a
handful of lines of schema — a real generated file, not a hand-written sample:
crozier generate python takes the document and a couple of naming flags and
writes the SDK — the models, enums, the per-endpoint client, and Fern's core/
runtime — into --output:
Or drive one — or several — named generators from a crozier.yml instead of
flags. crozier config shows the effective settings for every generator and the
layer each value resolved from (CLI flag > CROZIER_* env > file > default):
crozier init drops a starter crozier.yml carrying a JSON Schema modeline, so
editors complete and validate it against crozier's own config schema:
The full command surface (crozier --help and crozier generate --help)
A malformed document is rejected at the boundary with an actionable message and a non-zero exit — never a panic:
These are real captures of the CLI, rendered from its actual output by
just screenshotsand gated by screencomp — change what a command prints and the committed image (and its digest) changes with it.
Install
From PyPI (fastest — a prebuilt binary, no Rust toolchain): crozier ships as
platform wheels that wrap the compiled binary and expose it as a console script,
so any Python installer puts it on your PATH in seconds:
pip install crozier # or: pipx install crozier
uvx crozier --help # run once without installing
Platforms without a prebuilt wheel fall back to the source distribution, which builds from Rust (a toolchain is needed there).
From crates.io:
cargo install crozier --locked
From the install script (prebuilt binary from GitHub Releases, verified):
curl -fsSL https://raw.githubusercontent.com/nickderobertis/crozier/main/scripts/install.sh | sh
It detects your platform, downloads the matching archive, and verifies it against
a trust root independent of where it was downloaded — a Sigstore build-provenance
attestation when a verifier (cosign, pip install sigstore, or gh) is
present, else the canonical SHA-256 checksum. Pin a version or install location
with sh -s -- --version v0.1.0 --to ~/.local/bin.
From source (latest main):
cargo install --git https://github.com/nickderobertis/crozier --locked
From a release archive (manual): each release publishes per-platform archives
named crozier-<tag>-<target>.tar.gz with a matching .sha256 and a
.sigstore.json provenance bundle, for targets x86_64/aarch64 Linux,
x86_64/aarch64 macOS, and x86_64 Windows. Download the archive for your
platform from the
Releases page, verify the
checksum (or the attestation), and put the crozier binary on your PATH.
Usage
The fastest path needs no config file — the built-in python generator runs
straight from flags:
crozier generate python \
--spec path/to/openapi.yml \
--output ./generated \
--package-name my_api \
--project-name my-api
--spec— the OpenAPI 3.x document (.yml,.yaml, or.json).--output— directory to write the SDK into.--package-name— the Python import package (the directory undersrc/). Defaults to asnake_caseof the API title.--project-name— the distribution name recorded inversion.py. Defaults to the package name.--client-class-name— the name of the generated root client class (Fern'sclient_class_name). Defaults to{PascalCase(package_name)}Api.--audience(repeatable) /--audience-strict— prune generation tox-crozier-audiences.
crozier exits 0 on success (with a one-line summary on stderr) and 1 on any
error, printing the exact problem and a suggested fix.
Configuration
crozier runs one or more named generators. You can drive them purely from
flags (above), from a crozier.yml, or any mix — every setting resolves per
field as:
CLI flag > CROZIER_* env var > crozier.yml (generator over shared) > built-in default
Run crozier init to drop a starter crozier.yml in the working directory. It
leads with a JSON Schema modeline —
# yaml-language-server: $schema=https://raw.githubusercontent.com/nickderobertis/crozier/main/assets/crozier.schema.json
— so editors with the YAML language server give field completion and
validation against the published schema (derived
from crozier's own config types, so it never drifts). Run crozier config to
print the effective settings and the layer each value came from.
A crozier.yml in the working directory is picked up automatically. Top-level
keys are shared defaults; each entry under generators: is one SDK to emit:
# Shared across every generator
spec: ./openapi.yml
audiences: [public]
generators:
python: # overrides the built-in `python` generator
output: ./sdks/python
package-name: my_api
project-name: my-api
admin: # a second generator (also Python for now)
type: python
spec: ./admin-openapi.yml
output: ./sdks/admin
package-name: admin_api
crozierorcrozier generate— run every configured generator (or the built-inpythonwhen nothing is configured).crozier generate <name>— run one generator by name (pythonalways works, even with no config file).crozier init— write a startercrozier.yml(--output,--force).crozier config [<name>]— show the effective config and each value's source.crozier schema— print the config JSON Schema to stdout.--config <path>(repeatable, later wins) selects config files instead of auto-discovery;--no-configignores config files entirely;CROZIER_CONFIGnames a file via the environment.
Per-generation flags (--spec, --output, …) apply to a single generator, so
they are rejected when more than one would run — name one, or set the values in
crozier.yml. See docs/configuration.md for the full
reference.
Development
The command surface is a small set of just recipes:
just bootstrap # set up from a clean clone (toolchain + dev tools)
just check # full gate: fmt, clippy -D warnings, tests + e2e + coverage, deny, machete, doc
just test # fast tests with coverage enforced (95%)
just test-e2e # drive the compiled binary and byte-compare against fixtures
just format # rustfmt in place
just upgrade # cargo update, then re-run the gate
See AGENTS.md for the durable contributor guide and
docs/matching.md for the byte-matching strategy.
License and attribution
crozier is licensed under Apache-2.0. It is an independent, clean-room implementation — it reproduces Fern's generated output format (the project's explicit goal) and does not copy Fern's generator source.
The test fixtures under tests/fixtures/ are Fern's own output and OpenAPI test
specs, used under Apache-2.0 with attribution and a statement of changes; see
NOTICE and licenses/fern-APACHE-2.0.txt.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crozier-0.0.24.tar.gz.
File metadata
- Download URL: crozier-0.0.24.tar.gz
- Upload date:
- Size: 149.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91e391e9f8bf5f42a435fcf3dc6ce5307b47049caf75d31edebaa2afd86a7f92
|
|
| MD5 |
04b5958bf65716ba3c886d4da8646a12
|
|
| BLAKE2b-256 |
ee52fa61d2a4e969dbd2998721288d26f2c644aabb93cc991bf83812aff5f040
|
File details
Details for the file crozier-0.0.24-py3-none-win_amd64.whl.
File metadata
- Download URL: crozier-0.0.24-py3-none-win_amd64.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02456b1929cca90dd63b8bb3802e6133119fe59701ff86f88d95629d356c739e
|
|
| MD5 |
804be2146fc7de6875b9957ae9fee498
|
|
| BLAKE2b-256 |
d7b045ff29e543b2636f0147584c1564af1ce9b37381666033331f2a5344ecb9
|
File details
Details for the file crozier-0.0.24-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: crozier-0.0.24-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff9b9d3e73b32a26254e2a7aa972cab767737a9193e8555defea552d8310d352
|
|
| MD5 |
cacc9e543440bbe33102ecca4892a5e8
|
|
| BLAKE2b-256 |
e46d2d251fc6c4c4a96d28cd2b95137155b50ac55739b59884b7e79e112549b7
|
File details
Details for the file crozier-0.0.24-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: crozier-0.0.24-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
586c478dc43586f4a2ccf93123efb4a7908ccd9cd90682666f801ed6c55ef6bb
|
|
| MD5 |
9e595afda450d79786a9401c756047d1
|
|
| BLAKE2b-256 |
a92bcd7f41823e93742f15ecbed223190ea09cc8feeb9055264ba0bcd2fb8791
|
File details
Details for the file crozier-0.0.24-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: crozier-0.0.24-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d85933a68a9f08732c39e8a797d06f261230514c75bd2c016ad7e64ba358784
|
|
| MD5 |
3aaab0db08a191f0c71afc196925ad40
|
|
| BLAKE2b-256 |
0eb415ca99681810d6b777c6e782b7107ad0872f2c09397bc59a19a3e3dbf77e
|
File details
Details for the file crozier-0.0.24-py3-none-macosx_10_12_x86_64.whl.
File metadata
- Download URL: crozier-0.0.24-py3-none-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45d7fe3651acfcdd48c6d8257f73754231fe4ea1a94f6c48d9d8a45751ce88bf
|
|
| MD5 |
e8ec6e172ecba65d59b6088def3edd66
|
|
| BLAKE2b-256 |
d0e716e5b56f89e73539b2932a34dd5d7948b92a7db9b75f1079556ce6404661
|