Getting Started in 5 minutes
Its simple, install the CLI into your project or machine, setup the Codegen configuration file to include all the code your heart desire, customize it, and generate it at build time or whenever you feel like it.
Install
Installing the CLI can be done inside a project or within your system.
| Package manager | MacOS x64 | MacOS arm64 | Windows x64 | Windows x32 | Linux (Debian) | Linux (Others) |
|---|---|---|---|---|---|---|
You can find all the possible commands in the usage documentation.
Initialize
Add a configuration file, either manually or through the CLI;
codegen init

Customize it to your heart's desire! Each generator has unique set of options
Integrate
With your configuration file in hand, time to integrate it into your project and generate some code! Checkout all the integrations for inspiration how to do it.
Generate Code
One-time Generation
# Generate code once
codegen generate
# Generate with specific config file
codegen generate ./my-config.js
Development with Watch Mode
For active development, use watch mode to automatically regenerate code when your input files change:
# Watch for changes in the input file specified in your config
codegen generate --watch
# Watch for changes in a specific file or directory
codegen generate --watch --watchPath ./my-asyncapi.yaml
# Short form
codegen generate -w -p ./schemas/
Pro tip: Use watch mode during development to keep your generated code in sync with your API specifications. Press Ctrl+C to stop watching.