Skip to content

dankreiger/nx-openapi-codegen

Repository files navigation

nx-openapi-codegen

Built on top of Kubb, nx-openapi-codegen transforms an OpenAPI spec into a fully scoped NX monorepo for your GitHub organization or repository. Provide a URL or local path to your spec, and instantly generate.

Note

This is useful for now, but if it were to be a real CLI, there would be a ton of things to change - there is a checklist for this in docs/todo.md. Hard dependencies on nx should be reconsidered for example.

Autogenerated SDKs

You’ll also get publishable GitHub npm packages for TypeScript (publishing setup is currently limited to TypeScript), and optional Swift & Kotlin (Android) scaffolds are available for multi-platform projects (publishing not yet configured).

Automatic GitHub Workflows

By default, the tool creates helpful GitHub Actions workflows to streamline development:

  • main.yml: Runs on pushes to main (basic CI steps).
  • pull-request.yml: Validates pull requests (linting, code generation, docs).
  • release.yml: Manually triggers (via workflow_dispatch) for publishing TypeScript packages.
  • update-models.yml: Periodically (on a cron schedule) regenerates all models and opens a pull request with any changes—perfect for a spec that has changed (usefu for open api docs that are deployed and change on a regular basis.

Prerequisites

  • Bun (>=v1.2 recommended)

Usage

bunx nx-openapi-codegen

Follow the interactive prompts to specify your GitHub organization, repository, and OpenAPI spec path (remote or local). nx-openapi-codegen will take care of the rest—so you can focus on building applications, not boilerplate.

About

Create nx monorepo with openapi generated helper packages

Resources

Stars

Watchers

Forks

Packages

No packages published