HenrikJensen.SourceMix
1.0.0-beta2
Prefix Reserved
dotnet tool install --global HenrikJensen.SourceMix --version 1.0.0-beta2
dotnet new tool-manifest
dotnet tool install --local HenrikJensen.SourceMix --version 1.0.0-beta2
#tool dotnet:?package=HenrikJensen.SourceMix&version=1.0.0-beta2&prerelease
nuke :add-package HenrikJensen.SourceMix --version 1.0.0-beta2
Source Mix
SourceMix turns selected C# source files into a single Markdown context file that is easier to hand to an LLM. You can use it in two ways from the same installed dotnet tool:
- CLI mode for scripted or repeatable runs
- TUI mode for interactive file picking and option selection
The tool can include just the files you select, or expand outward to referenced source types, optional decompiled dependency types, reusable skills, and a final prompt block.
<img src="assets/tui-screenshot-1.png" alt="File selection screen" style="max-width: 100%; height: auto; margin: 0;" width="600" /> <img src="assets/tui-screenshot-2.png" alt="Output file configuration screen" style="max-width: 100%; height: auto; margin: 0;" width="600" /> <img src="assets/tui-screenshot-3.png" alt="Prompt personality screen" style="max-width: 100%; height: auto; margin: 0;" width="600" /> <img src="assets/tui-screenshot-4.png" alt="Skills selection screen" style="max-width: 100%; height: auto; margin: 0;" width="600" />
Install
Install the tool globally from NuGet:
dotnet tool install --global HenrikJensen.SourceMix
After that, use the sourcemix command.
Update an existing installation:
dotnet tool update --global HenrikJensen.SourceMix
Uninstall it:
dotnet tool uninstall --global HenrikJensen.SourceMix
Quick start
Use the interactive experience when you want help choosing files:
sourcemix tui
Use the CLI when you already know the files or patterns you want:
sourcemix "src/**/*.cs" -o context.md
TUI usage
Run the TUI from any directory containing a .sln or .slnx file:
sourcemix tui
Wizard flow
- Search and select files — type to filter
.csfiles by name in real time, move with↑↓, toggle withSpace, pin withCtrl+P, confirm withEnter, and switch views withTab. - Configure options — choose recursive dependency resolution, optional depth limiting, decompilation of compiled types, whether dependency method bodies should be trimmed, and whether
var/ target-typednew()should be expanded to inferred types. - Select prompt — optionally append a built-in or custom prompt to the generated output.
- Select skills — optionally prepend one or more
SKILL.mdinstruction files. - Generate — write the final Markdown output and persist your preferences for the next run.
Note:
--include-compileddepends on assemblies that already exist inbin/, so rundotnet buildfirst.
CLI usage
sourcemix [<files>...] [--output <path>] [--recursive] [--depth <n>] [--include-compiled] [--trim] [--expand-types]
Arguments
<files>— one or more file paths or glob patterns such assrc/**/*.cs
Options
-o,--output <path>— write output to a file instead of stdout-r,--recursive— include files that define referenced types-d,--depth <n>— limit recursion depth when--recursiveis used-c,--include-compiled— decompile unresolved referenced interfaces/models from compiled assemblies; requires--recursive-t,--trim— trim dependency method bodies while keeping signatures; requires--recursive-e,--expand-types— replacevarwith the inferred type and expand target-typednew()to include the type; anonymous types, tuple deconstruction, and unresolved cases are left unchanged-p,--prompt <name-or-text>— append a built-in prompt key or custom prompt text-s,--skills <key>...— prepend one or more skills by key
Built-in prompts
nunit-testxunit-testcode-reviewtech-docsexplaindebugrefactorarchitecture
Examples
# Write a context file from a glob
sourcemix "src/**/*.cs" -o context.md
# Print selected files to stdout
sourcemix Foo.cs Bar.cs Baz.cs
# Pull in referenced source types and decompiled unresolved types
sourcemix MyService.cs -r -c -o context.md
# Trim dependency bodies and append an xUnit-focused prompt
sourcemix MyService.cs -r -t --prompt xunit-test -o context.md
# Expand inferred types before writing the context file
sourcemix MyService.cs -r -e -o context.md
# Add skills plus a code review prompt
sourcemix MyService.cs -r -t --skills unit-test-style architecture-rules --prompt code-review -o context.md
Preferences
SourceMix stores per-solution preferences after TUI runs, including pinned files, pinned skills, output path, last-used prompt, and default options.
| Platform | Location |
|---|---|
| Windows | %APPDATA%\sourcemix\sourcemix-<hash>.json |
| Linux | ~/.config/sourcemix/sourcemix-<hash>.json |
| macOS | ~/.config/sourcemix/sourcemix-<hash>.json |
Global custom prompts are stored separately:
| Platform | Location |
|---|---|
| Windows | %APPDATA%\sourcemix\sourcemix-global.json |
| Linux | ~/.config/sourcemix/sourcemix-global.json |
| macOS | ~/.config/sourcemix/sourcemix-global.json |
Skills
Skills are reusable Markdown instructions inserted before the collected code. Each skill lives in its own directory and must contain a SKILL.md file. A skill file cannot reference other files.
| Platform | Location |
|---|---|
| Windows | %APPDATA%\sourcemix\skills\ |
| Linux | ~/.config/sourcemix/skills/ |
| macOS | ~/.config/sourcemix/skills/ |
Example:
~/.config/sourcemix/skills/
unit-test-style/
SKILL.md
architecture-rules/
SKILL.md
Local development
Restore tools and dependencies:
dotnet tool restore
./scripts/restore.bash
Build with the repository checks:
./scripts/build.bash
Run the tests:
./scripts/test.bash
Run the benchmarks to measure performance and detect regressions:
./scripts/benchmark.bash
Results are saved to tmp/benchmark-latest.md after each run. The previous run is kept as tmp/benchmark-previous.md for comparison.
Create the release package:
./scripts/pack.bash
Pack and publish
Create the NuGet package:
./scripts/pack.bash
The package is written to:
src/SourceMix/bin/Release/HenrikJensen.SourceMix.<version>.nupkg
Install that package locally for validation:
dotnet tool install --global --add-source ./src/SourceMix/bin/Release HenrikJensen.SourceMix
Publish it to NuGet:
dotnet nuget push src/SourceMix/bin/Release/HenrikJensen.SourceMix.<version>.nupkg --source https://api.nuget.org/v3/index.json --api-key <api-key>
pack.bash only creates the Release package. Run ./scripts/build.bash and ./scripts/test.bash separately as your validation steps before publishing.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-beta2 | 108 | 5/8/2026 |
| 1.0.0-beta1 | 84 | 5/3/2026 |