Devlead.Console
2025.7.9.244
Prefix Reserved
See the version list below for details.
dotnet add package Devlead.Console --version 2025.7.9.244
NuGet\Install-Package Devlead.Console -Version 2025.7.9.244
<PackageReference Include="Devlead.Console" Version="2025.7.9.244" />
<PackageVersion Include="Devlead.Console" Version="2025.7.9.244" />
<PackageReference Include="Devlead.Console" />
paket add Devlead.Console --version 2025.7.9.244
#r "nuget: Devlead.Console, 2025.7.9.244"
#:package Devlead.Console@2025.7.9.244
#addin nuget:?package=Devlead.Console&version=2025.7.9.244
#tool nuget:?package=Devlead.Console&version=2025.7.9.244
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 was computed. 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. |
-
net8.0
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 9.0.7)
- Microsoft.Extensions.Logging (>= 9.0.7)
- Microsoft.Extensions.Logging.Console (>= 9.0.7)
- Spectre.Console.Analyzer (>= 1.0.0)
- Spectre.Console.Cli (>= 0.50.0)
- Spectre.Console.Cli.Extensions.DependencyInjection (>= 0.10.0)
- System.Linq.Async (>= 6.0.3)
- System.Text.Json (>= 9.0.7)
-
net9.0
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 9.0.7)
- Microsoft.Extensions.Logging (>= 9.0.7)
- Microsoft.Extensions.Logging.Console (>= 9.0.7)
- Spectre.Console.Analyzer (>= 1.0.0)
- Spectre.Console.Cli (>= 0.50.0)
- Spectre.Console.Cli.Extensions.DependencyInjection (>= 0.10.0)
- System.Linq.Async (>= 6.0.3)
- System.Text.Json (>= 9.0.7)
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 |
|---|---|---|
| 2025.11.4.431 | 4,941 | 11/4/2025 |
| 2025.10.15.396 | 7,084 | 10/15/2025 |
| 2025.10.12.373 | 1,214 | 10/12/2025 |
| 2025.9.11.330 | 9,901 | 9/11/2025 |
| 2025.9.10.320 | 892 | 9/10/2025 |
| 2025.9.7.308 | 1,247 | 9/7/2025 |
| 2025.9.7.305 | 355 | 9/7/2025 |
| 2025.8.6.269 | 3,959 | 8/6/2025 |
| 2025.7.9.244 | 697 | 7/9/2025 |
| 2025.6.11.218 | 841 | 6/11/2025 |
| 2025.6.11.215 | 568 | 6/11/2025 |
| 2025.5.28.191 | 681 | 5/28/2025 |
| 2025.5.14.181 | 785 | 5/14/2025 |
| 2025.5.12.165 | 603 | 5/12/2025 |
| 2025.4.11.154 | 725 | 4/11/2025 |
| 2025.4.10.149 | 436 | 4/10/2025 |
| 2025.4.8.142 | 529 | 4/8/2025 |
| 2025.3.13.105 | 1,308 | 3/13/2025 |
| 2025.2.25.86 | 788 | 2/25/2025 |
| 2025.2.19.80 | 479 | 2/19/2025 |
| 2025.2.19.78 | 276 | 2/19/2025 |
| 2025.2.18.76 | 215 | 2/18/2025 |
| 2025.2.18.72 | 228 | 2/18/2025 |
| 2025.2.18.70 | 212 | 2/18/2025 |
| 2025.2.12.66 | 555 | 2/12/2025 |
| 2025.1.20.36 | 1,059 | 1/20/2025 |
| 2025.1.20.34 | 213 | 1/20/2025 |
| 2025.1.20.32 | 204 | 1/20/2025 |
| 2025.1.20.30 | 248 | 1/20/2025 |
| 2025.1.20.26 | 211 | 1/20/2025 |
| 2025.1.20.24 | 215 | 1/20/2025 |
| 2025.1.17.22 | 226 | 1/17/2025 |
| 2025.1.2.20 | 293 | 1/2/2025 |
| 2024.12.30.15 | 216 | 12/30/2024 |
| 2024.12.20.13 | 213 | 12/20/2024 |
| 2024.12.20.11 | 212 | 12/20/2024 |
| 2024.12.20.9 | 217 | 12/20/2024 |
| 2024.12.19.5 | 215 | 12/19/2024 |
| 2024.12.19.2 | 214 | 12/19/2024 |