No description
Find a file
Marvin Mees 9f3f02f5e3
Merge feature/slnfc-tui: slnfc TUI tool
Implements the slnfc tool: generate a .slnf solution filter from a
.slnx or .sln via an interactive TUI, with --sln targeting and
-m/--multiple batch creation. Includes README and PLAN.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 20:06:34 +02:00
src/Slnfc Add -m/--multiple to create several filters in one run 2026-07-09 20:02:36 +02:00
.gitignore Implement slnfc: TUI slnf generator from slnx 2026-07-09 19:43:47 +02:00
CLAUDE.md Added CLAUDE.md 2026-07-09 19:35:14 +02:00
PLAN.md Add -m/--multiple to create several filters in one run 2026-07-09 20:02:36 +02:00
README.md Add README 2026-07-09 20:04:56 +02:00
Slnfc.slnx Implement slnfc: TUI slnf generator from slnx 2026-07-09 19:43:47 +02:00

Slnfc

Slnfc is a small terminal tool that builds a solution filter (.slnf) from a solution file. Point it at an .slnx (or a classic .sln), pick the projects you want in an interactive TUI, name the filter, and it writes the .slnf next to the solution.

Features

  • Reads projects from .slnx (XML) and classic .sln solutions, including projects nested in solution folders.
  • Interactive selection powered by Spectre.Console.
  • Targets either the given solution or a same-named sibling of the other type (a migrated .slnx/.sln pair) — chosen via a prompt when both exist.
  • --sln override to reference a differently named solution or one in another folder.
  • --multiple mode to produce several filters in a single run.
  • Confirms before overwriting an existing .slnf.

Requirements

Usage

slnfc <solution.slnx|.sln> [-m|--multiple] [--sln <path>]

Running it opens a TUI that lists every project in the solution. Toggle projects with space, confirm with enter, then enter a name for the filter. The resulting <name>.slnf is written in the same directory as the solution.

Options

Option Description
-m, --multiple Create several filters in one run. Asks how many, then repeats the select/name step for each.
--sln <path> Reference this .sln/.slnx in the filter instead of the input (resolved relative to the input's directory). Its project list is used and the sibling prompt is skipped.
-h, --help Show usage.

Examples

Create a filter from a solution:

slnfc ./MySolution.slnx

When both MySolution.slnx and MySolution.sln exist, you'll be asked which one the filter should reference.

Reference a .sln that lives in a different folder:

slnfc ./MySolution.slnx --sln ./build/Release.sln

Create three filters in one session:

slnfc ./MySolution.slnx --multiple

Output

The generated .slnf is standard JSON understood by the .NET tooling and Visual Studio. solution.path is the target solution relative to the filter, and each project path is relative to the solution's directory:

{
  "solution": {
    "path": "MySolution.slnx",
    "projects": [
      "src/App/App.csproj",
      "src/Core/Core.csproj"
    ]
  }
}

You can then work against the filter directly, e.g.:

dotnet sln MySolution.slnf list
dotnet build MySolution.slnf

Building

Build and run from source:

dotnet run --project src/Slnfc -- ./MySolution.slnx

Publish a self-contained single-file executable (pass the runtime identifier for your platform):

dotnet publish src/Slnfc/Slnfc.csproj -c Release -r linux-x64 --self-contained

The executable is produced at src/Slnfc/bin/Release/net10.0/<rid>/publish/slnfc.