Skip to content

Installation

OpenAPI Code Generator is distributed as a .NET tool via NuGet under the package name Nikcio.OpenApiCodeGen.

Install as a global tool available anywhere on your system:

Terminal window
dotnet tool install --global Nikcio.OpenApiCodeGen

After installation, the openapi-codegen command is available globally:

Terminal window
openapi-codegen --version
Terminal window
dotnet tool update --global Nikcio.OpenApiCodeGen
Terminal window
dotnet tool uninstall --global Nikcio.OpenApiCodeGen

Install as a local tool scoped to your repository. This is recommended for team projects to ensure consistent versions:

Terminal window
# Create a tool manifest (if you don't have one)
dotnet new tool-manifest
# Install the tool
dotnet tool install Nikcio.OpenApiCodeGen

When installed locally, run the tool with dotnet tool run:

Terminal window
dotnet tool run openapi-codegen petstore.yaml -o Models.cs

Or restore and use directly after dotnet tool restore:

Terminal window
dotnet tool restore
openapi-codegen petstore.yaml -o Models.cs