Skip to content

Creating a Project

Creating a mod for PEAK is simple using the official BepInEx template. This guide covers installing the template, generating a project, and configuring it for development.

.NET templates must be installed before they can be used. This means that when you install the template, it doesn’t create a new project for you, but you will get the ability to do that.

Once you have the template installed, you don’t need to install it again, through it’s a good idea to update it if there are updates.

See the BepInEx Template repository

Install the template by running:

Terminal window
dotnet new install PEAKModding.BepInExTemplate

If you’re contributing to the template or prefer manual installation:

  1. Clone or download this repository
  2. Open a terminal in the root of the project
  3. Run:
Terminal window
dotnet new install .

To update:

Terminal window
dotnet new install . --force

To uninstall:

Terminal window
dotnet new uninstall .

Once installed, the template will be available as PEAK BepInEx Plugin with an alias peakmod.

Run the following command in your PEAK modding directory:

Terminal window
dotnet new peakmod --name ModName --guid com.github.YourAccount.ModName --ts-team YourThunderstoreTeam

This will create a new folder called ModName with your mod’s project.

This example demonstrates the structure of the project after using the template:

Terminal window
~/Workspace/PEAK$ dotnet new peakmod --name PeakMod --guid com.github.PEAKModding --ts-team PEAKModding
The template "PEAK BepInEx Plugin" was created successfully.
~/Workspace/PEAK$ cd PeakMod/

The file structure in PeakMod/ should look like this:

  • CHANGELOG.md
  • Config.Build.user.props.template
  • Directory.Build.props
  • Directory.Build.targets
  • icon.png
  • LICENSE
  • PeakMod.sln
  • README.md
  • Directorysrc
    • DirectoryPeakMod
      • PeakMod.csproj
      • Plugin.cs
      • thunderstore.toml

Key points:

  • Your mod code is in ./src/<project-name>/
  • Directory.Build.* files define shared build configuration
  • <project-name>.sln is your project solution

The project is configured so that it’s easy to add new projects into your project solution. Even if you don’t need that, it’s good to follow this standard project structure.

At the root of your new project you should see a file named Config.Build.user.props.template. This is a special file that is the template for the project’s user-specific config. Make a copy of this file and rename it Config.Build.user.props without the template part.

This file will copy your assembly files to a plugins directory and it can be used to configure your paths to the game files and BepInEx plugins directory if the defaults don’t work for you.

This template comes with Thunderstore packaging built-in, using Thunderstore CLI, aka TCLI. You should configure the src/<project-name>/thunderstore.toml file for your mod, such as setting the description for your mod.

You can build Thunderstore packages by running:

Terminal window
dotnet build -c Release -target:PackTS -v d

The built package will be found at artifacts/thunderstore/.

You can also directly publish to Thunderstore by including -property:PublishTS=true in the command.

Coming soon.