BepInExConfigurationGenerator 0.1.0

dotnet add package BepInExConfigurationGenerator --version 0.1.0
                    
NuGet\Install-Package BepInExConfigurationGenerator -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BepInExConfigurationGenerator" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BepInExConfigurationGenerator" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="BepInExConfigurationGenerator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BepInExConfigurationGenerator --version 0.1.0
                    
#r "nuget: BepInExConfigurationGenerator, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BepInExConfigurationGenerator@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BepInExConfigurationGenerator&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=BepInExConfigurationGenerator&version=0.1.0
                    
Install as a Cake Tool

BepInEx Configuration Generator

This is a configuration generation utility to help you iterate on mods quickly.

Quick Start

Create a class called MyConfig.cs.

To allow the source generator to complete the class, add the [GenerateConfig] attribute to the class, and mark the class as static partial.

using BepInEx.Configuration.Generators;

[GenerateConfig]
public static partial class MyConfig
{
    
}

To create a new configuration entry, add a new static readonly field with the [Entry] attribute to the property.

using BepInEx.Configuration.Generators;

[GenerateConfig]
public static partial class MyConfig
{
    [Entry("General", "Test", "An integer config")]
    private static readonly int Test = 0; // 0 is the default value.
    
    [Entry("General", "Keyboard shortcut", "A keyboard shortcut config (Custom type registered in TomlTypeConverter)")]
    private static readonly KeyboardShortcut TestKeyboardShortcut = new(KeyCode.H, KeyCode.LeftControl);
}

Register the configs to your plugin.

// ...

[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
public sealed class Plugin : BaseUnityPlugin
{
    private void Awake()
    {
+       MyConfig.Register(Config);
        // ...
    }
}

You can then read from the entries.

Debug.Log(ConfigTest.TestConfig); // The generated entries append the `Config` suffix.
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 240 5/25/2025
0.0.3 163 5/25/2025
0.0.2 151 5/25/2025
0.0.1 130 5/24/2025