{"id":23376345,"url":"https://github.com/devlead/devlead.console","last_synced_at":"2025-08-03T13:13:52.290Z","repository":{"id":268959247,"uuid":"905650415","full_name":"devlead/Devlead.Console","owner":"devlead","description":"An opinionated .NET source package simplifying bootstrapping console applications with IoC, command-line parsing, logging, and more.","archived":false,"fork":false,"pushed_at":"2025-02-11T06:56:50.000Z","size":46,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-02-11T07:32:42.684Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devlead.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"devlead"}},"created_at":"2024-12-19T08:57:17.000Z","updated_at":"2025-02-11T06:56:21.000Z","dependencies_parsed_at":"2025-02-11T07:38:33.456Z","dependency_job_id":null,"html_url":"https://github.com/devlead/Devlead.Console","commit_stats":null,"previous_names":["devlead/devlead.console"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlead%2FDevlead.Console","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlead%2FDevlead.Console/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlead%2FDevlead.Console/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlead%2FDevlead.Console/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devlead","download_url":"https://codeload.github.com/devlead/Devlead.Console/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238772150,"owners_count":19527880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-21T17:47:58.654Z","updated_at":"2025-02-14T03:15:05.858Z","avatar_url":"https://github.com/devlead.png","language":"C#","readme":"# Devlead.Console\n\nDevlead.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.\n\n## Features\n\n- Dependency injection / IoC container via Microsoft.Extensions\n- Command-line parsing via Spectre.Console\n- Logging via Microsoft.Extensions.Logging.Console\n- Configuration via Microsoft.Extensions.Configuration\n- Source-link for GitHub (or Azure Repos by setting MSBuild property `AzureRepos` to `true`)\n- ...\n\n## Installation\n\n```\ndotnet add package Devlead.Console\n```\n\n## Usage Example\n\nHere'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:\n\n```csharp\npublic partial class Program\n{\n    // Configure in-memory settings (useful for development/testing)\n    static partial void ConfigureInMemory(IDictionary\u003cstring, string?\u003e configData)\n    {\n        configData.Add(\"TestService__Version\", \"1.0.0.0\");\n    }\n\n    // Register your services\n    static partial void AddServices(IServiceCollection services)\n    {\n        services\n            .AddOptions\u003cTestServiceSettings\u003e()\n            .BindConfiguration(nameof(TestService));\n\n        services.AddSingleton\u003cTestService\u003e();\n    }\n\n    // Configure commands\n    static partial void ConfigureApp(AppServiceConfig appServiceConfig)\n    {\n        // Example: Add a root level command\n        appServiceConfig\n            .AddCommand\u003cTestCommand\u003e(\"test\")\n                .WithDescription(\"Example test command.\")\n                .WithExample([\"test\"]);\n\n        // Example: Add nested commands using branches\n        appServiceConfig\n            .AddBranch(\n                \"yolo\",\n                c =\u003e c.AddCommand\u003cTestCommand\u003e(\"test\")\n                        .WithDescription(\"Example test command.\")\n                        .WithExample([\"yolo\", \"test\"])\n            );\n\n        // Example: Set application name\n        appServiceConfig.SetApplicationName(\"myapp\");\n    }\n}\n```\n\nThis example demonstrates:\n- Setting up configuration values in memory for development\n- Registering services with dependency injection\n- Creating commands at both root and nested levels\n- Adding command descriptions and usage examples\n\nThe resulting CLI will support commands like:\n```bash\nmyapp test\nmyapp yolo test\n```\n\n## MSBuild Properties\n\nYou can customize the build behavior using the following MSBuild properties:\n\n- `UseDefaultProgram`: Set to `false` to opt out of the default Program.cs file generation. This allows you to provide your own custom Program implementation.\n  ```xml\n  \u003cPropertyGroup\u003e\n    \u003cUseDefaultProgram\u003efalse\u003c/UseDefaultProgram\u003e\n  \u003c/PropertyGroup\u003e\n  ```\n\n## Example Projects\n\n- [ARI](https://github.com/devlead/ARI)\n- [Blobify](https://github.com/devlead/Blobify)\n- [BRI](https://github.com/devlead/bri)\n- [DPI](https://github.com/devlead/DPI)\n- [UnpackDacPac](https://github.com/devlead/UnpackDacPac)\n\n\n\n","funding_links":["https://github.com/sponsors/devlead"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevlead%2Fdevlead.console","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevlead%2Fdevlead.console","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevlead%2Fdevlead.console/lists"}