Devlead.Console
2026.2.11.575
Prefix Reserved
dotnet add package Devlead.Console --version 2026.2.11.575
NuGet\Install-Package Devlead.Console -Version 2026.2.11.575
<PackageReference Include="Devlead.Console" Version="2026.2.11.575" />
<PackageVersion Include="Devlead.Console" Version="2026.2.11.575" />
<PackageReference Include="Devlead.Console" />
paket add Devlead.Console --version 2026.2.11.575
#r "nuget: Devlead.Console, 2026.2.11.575"
#:package Devlead.Console@2026.2.11.575
#addin nuget:?package=Devlead.Console&version=2026.2.11.575
#tool nuget:?package=Devlead.Console&version=2026.2.11.575
Devlead.Console
Devlead.Console is a streamlined NuGet source package designed to accelerate the development of .NET console applications. By providing out-of-the-box configurations for Inversion of Control (IoC), command-line parsing, logging, and other essential utilities, Devlead.Console allows developers to focus on building business logic rather than setting up foundational components.
Features
- Dependency injection / IoC container via Microsoft.Extensions
- Command-line parsing via Spectre.Console
- Logging via Microsoft.Extensions.Logging.Console
- Configuration via Microsoft.Extensions.Configuration
- Source-link for GitHub (or Azure Repos by setting MSBuild property
AzureRepostotrue) - ...
Installation
dotnet add package Devlead.Console
Usage Example
Here's how to create a console application using Devlead.Console, which comes with sensible defaults to streamline your setup. Additionally, you can utilize optional partial methods to tailor the project to your specific needs:
public partial class Program
{
// Configure in-memory settings (useful for development/testing)
static partial void ConfigureInMemory(IDictionary<string, string?> configData)
{
configData.Add("TestService__Version", "1.0.0.0");
}
// Register your services
static partial void AddServices(IServiceCollection services)
{
services
.AddOptions<TestServiceSettings>()
.BindConfiguration(nameof(TestService));
services.AddSingleton<TestService>();
}
// Configure commands
static partial void ConfigureApp(AppServiceConfig appServiceConfig)
{
// Example: Add a root level command
appServiceConfig
.AddCommand<TestCommand>("test")
.WithDescription("Example test command.")
.WithExample(["test"]);
// Example: Add nested commands using branches
appServiceConfig
.AddBranch(
"yolo",
c => c.AddCommand<TestCommand>("test")
.WithDescription("Example test command.")
.WithExample(["yolo", "test"])
);
// Example: Set application name
appServiceConfig.SetApplicationName("myapp");
}
}
This example demonstrates:
- Setting up configuration values in memory for development
- Registering services with dependency injection
- Creating commands at both root and nested levels
- Adding command descriptions and usage examples
The resulting CLI will support commands like:
myapp test
myapp yolo test
MSBuild Properties
You can customize the build behavior using the following MSBuild properties:
UseDefaultProgram: Set tofalseto opt out of the default Program.cs file generation. This allows you to provide your own custom Program implementation.<PropertyGroup> <UseDefaultProgram>false</UseDefaultProgram> </PropertyGroup>
Example Projects
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 9.0.13)
- Microsoft.Extensions.Logging (>= 9.0.13)
- Microsoft.Extensions.Logging.Console (>= 9.0.13)
- Spectre.Console.Analyzer (>= 1.0.0)
- Spectre.Console.Cli (>= 0.53.1)
- Spectre.Console.Cli.Extensions.DependencyInjection (>= 0.23.0)
-
net8.0
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 8.0.0)
- Microsoft.Extensions.Logging (>= 8.0.1)
- Microsoft.Extensions.Logging.Console (>= 8.0.1)
- Spectre.Console.Analyzer (>= 1.0.0)
- Spectre.Console.Cli (>= 0.53.1)
- Spectre.Console.Cli.Extensions.DependencyInjection (>= 0.23.0)
- System.Linq.Async (>= 7.0.0)
-
net9.0
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 9.0.13)
- Microsoft.Extensions.Logging (>= 9.0.13)
- Microsoft.Extensions.Logging.Console (>= 9.0.13)
- Spectre.Console.Analyzer (>= 1.0.0)
- Spectre.Console.Cli (>= 0.53.1)
- Spectre.Console.Cli.Extensions.DependencyInjection (>= 0.23.0)
- System.Linq.Async (>= 7.0.0)
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 |
|---|---|---|
| 2026.2.11.575 | 233 | 2/11/2026 |
| 2026.1.14.558 | 7,229 | 1/14/2026 |
| 2025.12.17.530 | 8,914 | 12/17/2025 |
| 2025.11.25.507 | 7,082 | 11/25/2025 |
| 2025.11.23.501 | 973 | 11/23/2025 |
| 2025.11.23.493 | 452 | 11/23/2025 |
| 2025.11.4.431 | 6,194 | 11/4/2025 |
| 2025.10.15.396 | 7,417 | 10/15/2025 |
| 2025.10.12.373 | 1,317 | 10/12/2025 |
| 2025.9.11.330 | 10,002 | 9/11/2025 |
| 2025.9.10.320 | 991 | 9/10/2025 |
| 2025.9.7.308 | 1,340 | 9/7/2025 |
| 2025.9.7.305 | 456 | 9/7/2025 |
| 2025.8.6.269 | 4,059 | 8/6/2025 |
| 2025.7.9.244 | 799 | 7/9/2025 |
| 2025.6.11.218 | 936 | 6/11/2025 |
| 2025.6.11.215 | 670 | 6/11/2025 |
| 2025.5.28.191 | 783 | 5/28/2025 |
| 2025.5.14.181 | 888 | 5/14/2025 |
| 2025.5.12.165 | 703 | 5/12/2025 |