The REDkit tooling project defines a strongly typed representation of a REDkit workspace. The model is intentionally separate from the language server so REDkit-specific filesystem and process concerns stay outside the Python language-analysis core.
RedkitProject represents one REDkit project:
public sealed record RedkitProject(
string Name,
string ProjectDirectory,
string? GameDirectory,
string? RedkitDirectory,
IReadOnlyList<ContentRepository> ContentRepositories,
IReadOnlyList<string> ScriptRoots
);Fields:
Name: project display nameProjectDirectory: REDkit project directoryGameDirectory: The Witcher 3 installation directory, when configuredRedkitDirectory: REDkit installation directory, when configuredContentRepositories: ordered content repositories used by the projectScriptRoots: directories containing WitcherScript source files
ContentRepository describes a content source available to the project.
Repository kinds:
VanillaDlcModProject
The LoadOrder value is part of the model because script and content resolution depend on deterministic repository ordering.
The language server reads witcherscript.toml. REDkit tooling owns REDkit-oriented project data and can represent the same paths in C#:
[project]
name = "MyRedkitMod"
[redkit]
game_directory = "D:/Steam/steamapps/common/The Witcher 3"
redkit_directory = "D:/Steam/steamapps/common/The Witcher 3 REDkit"
project_directory = "D:/REDkitProjects/MyMod"
[scripts]
source_roots = ["content/scripts"]
vanilla_roots = ["D:/Steam/steamapps/common/The Witcher 3/content/content0/scripts"]
exclude = ["**/bin/**", "**/.cache/**", "**/.ws-cache/**", "**/generated/**"]The configuration boundary is simple:
- Python reads the TOML file and indexes scripts.
- C# owns REDkit project data and command-line tooling.
- Both sides use explicit paths rather than implicit global state.
- An LSP client can call
witcherscript.refreshIndexafterws-redkit initso the running language server reloads the generated configuration.
The model supports manual paths for the game, REDkit, project directory, and script roots. This avoids assuming one installation layout and keeps Steam, GOG, custom library, and portable setups representable.
Relative paths in witcherscript.toml are resolved from the workspace root by the language server. Absolute paths are preserved.
The REDkit CLI project builds as part of the .NET solution and exposes project tooling commands:
dotnet run --project src/dotnet/src/WitcherScript.RedkitTooling.Cli -- detect
dotnet run --project src/dotnet/src/WitcherScript.RedkitTooling.Cli -- init
dotnet run --project src/dotnet/src/WitcherScript.RedkitTooling.Cli -- print-config
dotnet run --project src/dotnet/src/WitcherScript.RedkitTooling.Cli -- validate
dotnet run --project src/dotnet/src/WitcherScript.RedkitTooling.Cli -- recompile --executable <path>
dotnet run --project src/dotnet/src/WitcherScript.RedkitTooling.Cli -- launch-game --executable <path>Common options:
--project-dir <path>--game-dir <path>--redkit-dir <path>--force
The detect command prints JSON:
{
"gameDirectory": "D:/Steam/steamapps/common/The Witcher 3",
"redkitDirectory": "D:/Steam/steamapps/common/The Witcher 3 REDkit",
"projectDirectory": "D:/REDkitProjects/MyMod",
"scriptRoots": [
"D:/REDkitProjects/MyMod/content/scripts",
"D:/Steam/steamapps/common/The Witcher 3/content/content0/scripts"
]
}The init command writes witcherscript.toml into the detected project directory.
Use --force when an existing configuration should be replaced.