ForgeTrust.AppSurface.Console 0.1.0-preview.2

This is a prerelease version of ForgeTrust.AppSurface.Console.
There is a newer version of this package available.
See the version list below for details.
dotnet add package ForgeTrust.AppSurface.Console --version 0.1.0-preview.2
                    
NuGet\Install-Package ForgeTrust.AppSurface.Console -Version 0.1.0-preview.2
                    
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="ForgeTrust.AppSurface.Console" Version="0.1.0-preview.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ForgeTrust.AppSurface.Console" Version="0.1.0-preview.2" />
                    
Directory.Packages.props
<PackageReference Include="ForgeTrust.AppSurface.Console" />
                    
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 ForgeTrust.AppSurface.Console --version 0.1.0-preview.2
                    
#r "nuget: ForgeTrust.AppSurface.Console, 0.1.0-preview.2"
                    
#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 ForgeTrust.AppSurface.Console@0.1.0-preview.2
                    
#: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=ForgeTrust.AppSurface.Console&version=0.1.0-preview.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=ForgeTrust.AppSurface.Console&version=0.1.0-preview.2&prerelease
                    
Install as a Cake Tool

ForgeTrust.AppSurface.Console

Modular bootstrapping for .NET Console applications using CliFx.

Overview

ForgeTrust.AppSurface.Console provides a structured way to build command-line tools. It automatically discovers and registers CliFx commands from modules, runs them inside the .NET Generic Host, and now exposes a startup options seam for console-specific behavior such as command-first output.

Usage

Create a startup class that inherits from ConsoleStartup<TModule>:

public class MyConsoleStartup : ConsoleStartup<MyRootModule> { }

In your Program.cs:

await ConsoleApp<MyRootModule>.RunAsync(args);

You can also customize console startup behavior at the entry point:

using ForgeTrust.AppSurface.Core;

await ConsoleApp<MyRootModule>.RunAsync(
    args,
    options =>
    {
        options.OutputMode = ConsoleOutputMode.CommandFirst;
    });

If you are using a custom startup type directly, the same configuration can be applied fluently:

await new MyConsoleStartup()
    .WithOptions(options => options.OutputMode = ConsoleOutputMode.CommandFirst)
    .RunAsync(args);

Features

  • Command Discovery: Automatically registers classes implementing ICommand from the entry point assembly and dependent modules.
  • Hosted Runner: Integrates with the .NET Generic Host to manage service lifecycles during command execution.
  • Console Options: ConsoleOptions lets entry points configure shared console behavior before the host is built.

ConsoleOptions

ConsoleOptions is the public startup configuration surface for AppSurface console apps.

  • OutputMode defaults to ConsoleOutputMode.Default.
  • ConsoleOutputMode.Default preserves the standard Generic Host experience, including lifecycle output that may appear alongside command output.
  • ConsoleOutputMode.CommandFirst suppresses ambient host and command-runner lifecycle information so help, validation, and command-owned progress remain the primary console experience.
  • CustomRegistrations runs after AppSurface's built-in console registrations so advanced hosts and tests can override services such as CliFx.Infrastructure.IConsole or add extra logging providers.

Use CommandFirst for public CLIs where first-touch output is part of the product surface. Leave the default in place for internal tools or apps where host lifecycle logs are useful operational context.

Pitfalls

  • CommandFirst suppresses ambient lifecycle information, not command-owned progress. Your command still needs to log or write the progress messages users should see.
  • Console options are applied before host creation. Configure them at the entry point or through WithOptions(...), not inside command handlers.
  • CustomRegistrations overrides services late in the startup pipeline. Use it intentionally for host-level customization, not as a replacement for normal module service registration.
  • If you override console startup behavior in a derived startup class, keep the shared options path intact so entry-point configuration still reaches the host.

📂 Back to Console List | 🏠 Back to Root

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ForgeTrust.AppSurface.Console:

Package Downloads
ForgeTrust.AppSurface.Aspire

ForgeTrust.AppSurface.Aspire package for AppSurface application composition.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0-preview.4 171 7/18/2026
0.2.0-preview.2 525 7/3/2026
0.2.0-preview.1 294 6/28/2026
0.1.0 113 7/2/2026
0.1.0-rc.4 271 6/16/2026
0.1.0-rc.3 182 6/8/2026
0.1.0-rc.2 75 6/3/2026
0.1.0-rc.1 66 5/31/2026
0.1.0-preview.4 69 5/25/2026
0.1.0-preview.3 68 5/20/2026
0.1.0-preview.2 68 5/14/2026