Kenshi Mod Generator (kmg) creates ready-to-build Visual Studio C++ projects for KenshiLib plugins loaded through RE_Kenshi.
Generated projects are configured for the Visual Studio C++ v100 toolset and Release|x64.
Download the latest prebuilt kmg.exe from the Releases page.
Put kmg.exe somewhere on your PATH, or run it from the folder where you downloaded it.
Building from source is optional and requires Odin. See Build from source.
To generate and build a KenshiLib plugin project, you need:
- Visual Studio C++
v100toolset support - KenshiLib headers and libraries
- Boost 1.60.0 headers and libraries
- RE_Kenshi installed for loading the plugin in Kenshi
The easiest way to get KenshiLib and Boost dependencies is the KenshiLib_Examples_deps repository.
If you use KenshiLib_Examples_deps, clone it instead of downloading it as a .zip. Some files are stored through Git LFS, and a ZIP download will contain pointer files instead of the actual files.
Create config.json:
kmg initValidate your setup:
kmg checkCreate a new plugin project:
kmg new MyModOpen the generated .sln in Visual Studio, or any other IDE that supports .sln / .vcxproj files, then build Release|x64.
kmg init asks for:
output_projects_dir - where generated projects should be created
kenshi_lib_dir - folder containing KenshiLib Include/ and Libraries/
boost_root_dir - Boost 1.60.0 root folder
boost_root_dir should contain both:
boost/
stage/lib/
If you cloned KenshiLib_Examples_deps and ran its setup script, it may have created environment variables. kmg init will detect and offer those paths. Supported variables are:
KENSHILIB_DIR
KENSHILIB_DEPS_DIR
BOOST_ROOT
BOOST_INCLUDE_PATH
Accepted paths are written directly into config.json. Generated projects do not depend on those environment variables being present later.
Run kmg check after editing config.json or moving dependency folders.
kmg init Create config.json
kmg check Validate config and dependencies
kmg new <name> Create a new KenshiLib plugin project
kmg help Show help (also -h and --help)
kmg new MyMod creates:
MyMod/
MyMod.sln
MyMod.vcxproj
MyMod.vcxproj.filters
README.md
src/MyMod.cpp
bin/MyMod/
RE_Kenshi.json
MyMod.mod
Generated projects use the Visual Studio C++ v100 toolset, include only Release|x64, and set WindowsTargetPlatformVersion to 10.0.
Add new .cpp and .h files through your IDE so the .vcxproj and .vcxproj.filters files are updated automatically.
Building kmg from source requires Odin.
This project was built and tested with:
version dev-2025-07:861fa4ab6
Build with:
odin build src -out:kmg.exe