KenshiLib 1.0.1
dotnet add package KenshiLib --version 1.0.1
NuGet\Install-Package KenshiLib -Version 1.0.1
<PackageReference Include="KenshiLib" Version="1.0.1" />
<PackageVersion Include="KenshiLib" Version="1.0.1" />
<PackageReference Include="KenshiLib" />
paket add KenshiLib --version 1.0.1
#r "nuget: KenshiLib, 1.0.1"
#:package KenshiLib@1.0.1
#addin nuget:?package=KenshiLib&version=1.0.1
#tool nuget:?package=KenshiLib&version=1.0.1
KenshiLib
Core library for Kenshi mod management, providing comprehensive functionality for mod discovery, playset management, and load order handling.
Features
- Mod Discovery - Automatic detection of Steam Workshop and local mods
- Playset Management - Create, load, save, and switch between mod configurations
- Load Order - Handle mod ordering and dependencies
- Mod Metadata - Extract mod information (name, author, description, preview image)
- Steam Integration - Read Steam Workshop subscriptions and library paths
- Translation Support - Infrastructure for mod translation and glossary management
- File Persistence - Read/write
.cfgplayset files with enabled/disabled state
Installation
Add as NuGet package reference in your .csproj:
<ItemGroup>
<PackageReference Include="KenshiLib" Version="1.0.0" />
</ItemGroup>
Or via dotnet CLI:
dotnet add package KenshiLib
Basic Usage
Initialize Mod Manager
using KenshiLib.Core;
// Initialize reverse engineer (for mod file parsing)
var reverseEngineer = new ReverseEngineer();
// Create mod manager
var modManager = new ModManager(reverseEngineer);
// Load all available mods with details
var allMods = await modManager.LoadAllModsWithDetailsAsync();
foreach (var mod in allMods)
{
Console.WriteLine($"{mod.Name} by {mod.Author}");
Console.WriteLine($" Enabled: {mod.IsEnabled}, LoadOrder: {mod.LoadOrder}");
}
Manage Playsets
using KenshiLib.Core;
string kenshiPath = ModManager.KenshiPath; // Auto-detected or custom
// Create playset repository
var playsetRepo = new PlaysetRepository(kenshiPath);
// Get all playsets
var playsets = playsetRepo.GetAllPlaysets();
// Create new playset
var newPlayset = playsetRepo.CreateNewPlayset("MyModpack");
// Load mods from playset
var modEntries = playsetRepo.LoadPlaysetModsWithState(newPlayset.FilePath);
// Save mods to playset (with enabled/disabled state)
playsetRepo.SaveModsToPlaysetWithState(newPlayset.FilePath, modsList);
Detect Kenshi Installation
using KenshiLib.Core;
// Auto-detect Kenshi path
string? kenshiPath = ModManager.FindKenshiInstallDir();
if (kenshiPath != null)
{
Console.WriteLine($"Kenshi found at: {kenshiPath}");
// Find workshop mods path
string? workshopPath = ModManager.FindWorkshopPath();
Console.WriteLine($"Workshop mods: {workshopPath}");
}
Core Classes
ModManager
Main class for mod discovery and loading. Handles both Steam Workshop and local mods.
PlaysetRepository
Manages playset files (.cfg format). CRUD operations for playlists of mods.
ModInfo
Data class representing a mod with properties:
Name,Author,DescriptionIsEnabled,LoadOrderModPath,ImagePathIsSteamWorkshop
PlaysetInfo
Metadata about a playset:
Name,FilePathModCountCreatedDate,ModifiedDate
ReverseEngineer
Low-level mod file parser (reads .mod files).
Requirements
- .NET 9.0 or later
- Windows (uses Windows Registry for Steam path detection)
- Kenshi installation (Steam or standalone)
Dependencies
Google.Cloud.Translate.V3- Translation API supportDeepMorphy- Russian morphology for translation post-processingTensorFlowSharp- ML model support for DeepMorphy- Other translation-related packages
Platform Notes
This library is Windows-specific due to:
- Windows Registry usage for Steam path detection
- File path conventions (
C:\Program Files\...) - Kenshi game is Windows-only
Methods using Registry are marked with [SupportedOSPlatform("windows")].
License
MIT License - see LICENSE file for details.
Contributing
This library is part of the Kenshi mod management ecosystem. For issues or feature requests, please open an issue on GitHub.
Related Projects
- KenshiModManager - WPF application using this library for mod management UI
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0-windows7.0 is compatible. net10.0-windows was computed. |
-
net9.0-windows7.0
- DeepMorphy (>= 2.0.3)
- Google.Cloud.ResourceManager.V3 (>= 2.5.0)
- Google.Cloud.Translate.V3 (>= 3.9.0)
- GoogleTranslateFreeApi (>= 1.1.1)
- GTranslate (>= 2.3.1)
- NTextCat (>= 0.3.65)
- TensorFlowSharp (>= 1.12.0)
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 |
|---|---|---|
| 1.0.1 | 196 | 10/31/2025 |
Add language switcher, improve mod detection, add DeepMorphy and Google Translate support