TechTeaStudio.Console.FileSelector 0.2.1

dotnet add package TechTeaStudio.Console.FileSelector --version 0.2.1
                    
NuGet\Install-Package TechTeaStudio.Console.FileSelector -Version 0.2.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TechTeaStudio.Console.FileSelector" Version="0.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TechTeaStudio.Console.FileSelector" Version="0.2.1" />
                    
Directory.Packages.props
<PackageReference Include="TechTeaStudio.Console.FileSelector" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TechTeaStudio.Console.FileSelector --version 0.2.1
                    
#r "nuget: TechTeaStudio.Console.FileSelector, 0.2.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TechTeaStudio.Console.FileSelector@0.2.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TechTeaStudio.Console.FileSelector&version=0.2.1
                    
Install as a Cake Addin
#tool nuget:?package=TechTeaStudio.Console.FileSelector&version=0.2.1
                    
Install as a Cake Tool

TechTeaStudio.Console.FileSelector

An interactive console file browser for .NET. Navigate directories and pick a file with a tiny cd / select command loop — useful whenever a console app needs the user to point at a file without dragging in a TUI framework.

NuGet

Targets net6.0, net8.0, net9.0, net10.0.

Install

dotnet add package TechTeaStudio.Console.FileSelector

Quick start

using TechTeaStudio.Console.FileSelector;

IConsoleFileBrowser browser = new ConsoleFileBrowser();

string? path = browser.SelectFile(
    initialDirectory: Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
    fileExtensions: ".png,.jpg",
    welcomeMessage: "Pick an image");

if (path is null)
    Console.WriteLine("Cancelled.");
else
    Console.WriteLine($"Selected: {path}");

What you get

  • Directory listing with [D] / [F] markers.
  • Extension filter (e.g. ".png,.jpg,.jpeg", or "*" for everything).
  • Up/Down command history.
  • Absolute and relative paths supported for cd and select.

Commands

Command What it does
cd <folder> Enter a subdirectory (relative or absolute).
cd .. or cd Go up one level.
cd / or cd \ Jump to the root of the current drive.
select <file> Pick a file and return its absolute path to the caller.
help / ? Show the command list.
exit / quit / q Cancel — SelectFile returns null.

API

public interface IConsoleFileBrowser
{
    string? SelectFile(
        string initialDirectory,
        string? fileExtensions = "*",
        string? welcomeMessage = "Welcome To ConsoleFileBrowser");
}

Returns the absolute path of the chosen file, or null if the user cancelled.

The ConsoleImage sample

The repo also contains a small utility that uses the browser to pick an image and then renders it as ANSI-truecolor ASCII art in the terminal. Build it from source/ConsoleImage and run it on a terminal that supports virtual terminal sequences (Windows Terminal, Windows 10+ conhost with VT enabled, any modern Linux/macOS terminal).

Build & test

dotnet build ConsoleImage.slnx
dotnet test  ConsoleImage.slnx

Release

Bump <Version> in source/ConsoleFileBrowser/ConsoleFileBrowser.csproj, commit, push to product. CI builds, packs, and publishes to nuget.org automatically.

License

MIT — see LICENSE.txt.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

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
0.2.1 99 5/12/2026
0.1.1 202 1/26/2025
0.1.0 185 12/21/2024

v0.2.0 — Major refactor.

Added:
 * Multi-target: net6.0, net8.0, net9.0, net10.0.
 * `help` / `?` command in the interactive loop.
 * Absolute-path support for `cd` and `select`.

Changed (breaking):
 * Type renamed: ConsoleFileSelector.Framework.ConsoleFileSelector -> TechTeaStudio.Console.FileSelector.ConsoleFileBrowser.
 * Interface renamed: IFileSelector -> IConsoleFileBrowser.
 * Namespace: ConsoleFileSelector.Framework -> TechTeaStudio.Console.FileSelector.
 * SelectFile parameter `firstMessage` renamed to `welcomeMessage`.
 * `fileExtensions` parameter is now optional (defaults to `*`).

Fixed:
 * Welcome message now renders on every redraw instead of from the second iteration on.
 * History/state no longer leaks between successive SelectFile calls on the same instance.
 * Backspace no longer crashes when the input buffer is empty.
 * Up/Down history navigation handles bounds correctly and does not push duplicate entries.

Full changelog: https://github.com/TechTeaStudio/ConsoleImage/blob/product/CHANGELOG.md