Devlead.Console
2026.1.14.558
Prefix Reserved
dotnet add package Devlead.Console --version 2026.1.14.558
NuGet\Install-Package Devlead.Console -Version 2026.1.14.558
<PackageReference Include="Devlead.Console" Version="2026.1.14.558" />
<PackageVersion Include="Devlead.Console" Version="2026.1.14.558" />
<PackageReference Include="Devlead.Console" />
paket add Devlead.Console --version 2026.1.14.558
#r "nuget: Devlead.Console, 2026.1.14.558"
#:package Devlead.Console@2026.1.14.558
#addin nuget:?package=Devlead.Console&version=2026.1.14.558
#tool nuget:?package=Devlead.Console&version=2026.1.14.558
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.12)
- Microsoft.Extensions.Logging (>= 9.0.12)
- Microsoft.Extensions.Logging.Console (>= 9.0.12)
- Spectre.Console.Analyzer (>= 1.0.0)
- Spectre.Console.Cli (>= 0.53.1)
- Spectre.Console.Cli.Extensions.DependencyInjection (>= 0.22.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.22.0)
- System.Linq.Async (>= 7.0.0)
-
net9.0
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 9.0.12)
- Microsoft.Extensions.Logging (>= 9.0.12)
- Microsoft.Extensions.Logging.Console (>= 9.0.12)
- Spectre.Console.Analyzer (>= 1.0.0)
- Spectre.Console.Cli (>= 0.53.1)
- Spectre.Console.Cli.Extensions.DependencyInjection (>= 0.22.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.1.14.558 | 1,000 | 1/14/2026 |
| 2025.12.17.530 | 8,884 | 12/17/2025 |
| 2025.11.25.507 | 7,054 | 11/25/2025 |
| 2025.11.23.501 | 941 | 11/23/2025 |
| 2025.11.23.493 | 419 | 11/23/2025 |
| 2025.11.4.431 | 6,163 | 11/4/2025 |
| 2025.10.15.396 | 7,387 | 10/15/2025 |
| 2025.10.12.373 | 1,288 | 10/12/2025 |
| 2025.9.11.330 | 9,972 | 9/11/2025 |
| 2025.9.10.320 | 964 | 9/10/2025 |
| 2025.9.7.308 | 1,313 | 9/7/2025 |
| 2025.9.7.305 | 424 | 9/7/2025 |
| 2025.8.6.269 | 4,031 | 8/6/2025 |
| 2025.7.9.244 | 771 | 7/9/2025 |
| 2025.6.11.218 | 908 | 6/11/2025 |
| 2025.6.11.215 | 639 | 6/11/2025 |
| 2025.5.28.191 | 756 | 5/28/2025 |
| 2025.5.14.181 | 855 | 5/14/2025 |
| 2025.5.12.165 | 673 | 5/12/2025 |
| 2025.4.11.154 | 800 | 4/11/2025 |
| 2025.4.10.149 | 505 | 4/10/2025 |
| 2025.4.8.142 | 594 | 4/8/2025 |
| 2025.3.13.105 | 1,376 | 3/13/2025 |
| 2025.2.25.86 | 861 | 2/25/2025 |
| 2025.2.19.80 | 551 | 2/19/2025 |
| 2025.2.19.78 | 350 | 2/19/2025 |
| 2025.2.18.76 | 281 | 2/18/2025 |
| 2025.2.18.72 | 298 | 2/18/2025 |
| 2025.2.18.70 | 282 | 2/18/2025 |
| 2025.2.12.66 | 621 | 2/12/2025 |
| 2025.1.20.36 | 1,129 | 1/20/2025 |
| 2025.1.20.34 | 284 | 1/20/2025 |
| 2025.1.20.32 | 272 | 1/20/2025 |
| 2025.1.20.30 | 317 | 1/20/2025 |
| 2025.1.20.26 | 282 | 1/20/2025 |
| 2025.1.20.24 | 278 | 1/20/2025 |
| 2025.1.17.22 | 296 | 1/17/2025 |
| 2025.1.2.20 | 368 | 1/2/2025 |
| 2024.12.30.15 | 289 | 12/30/2024 |
| 2024.12.20.13 | 282 | 12/20/2024 |
| 2024.12.20.11 | 278 | 12/20/2024 |
| 2024.12.20.9 | 283 | 12/20/2024 |
| 2024.12.19.5 | 281 | 12/19/2024 |
| 2024.12.19.2 | 278 | 12/19/2024 |