{"id":24961723,"url":"https://github.com/frodehus/quicli","last_synced_at":"2025-04-10T21:37:50.080Z","repository":{"id":241397718,"uuid":"806264442","full_name":"FrodeHus/QuiCLI","owner":"FrodeHus","description":"A lightweight framework for creating CLI applications with the primary focus of being compatible with AOT and trimming. This is to generate small and fast self-contained executables.","archived":false,"fork":false,"pushed_at":"2025-04-07T06:24:32.000Z","size":242,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T07:26:13.394Z","etag":null,"topics":["cli","dotnet","framework"],"latest_commit_sha":null,"homepage":"","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/FrodeHus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-26T20:23:22.000Z","updated_at":"2025-04-07T06:24:35.000Z","dependencies_parsed_at":"2024-05-28T05:59:16.606Z","dependency_job_id":"d4bfe04d-3136-4f89-a5fd-1db282695bf4","html_url":"https://github.com/FrodeHus/QuiCLI","commit_stats":null,"previous_names":["frodehus/quicli"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrodeHus%2FQuiCLI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrodeHus%2FQuiCLI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrodeHus%2FQuiCLI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FrodeHus%2FQuiCLI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FrodeHus","download_url":"https://codeload.github.com/FrodeHus/QuiCLI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247613788,"owners_count":20967019,"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":["cli","dotnet","framework"],"created_at":"2025-02-03T08:56:10.704Z","updated_at":"2025-04-10T21:37:50.058Z","avatar_url":"https://github.com/FrodeHus.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QuiCLI\n\n[![.NET](https://github.com/FrodeHus/QuiCLI/actions/workflows/dotnet.yml/badge.svg)](https://github.com/FrodeHus/QuiCLI/actions/workflows/dotnet.yml)\n[![Publish](https://github.com/FrodeHus/QuiCLI/actions/workflows/nuget.yml/badge.svg)](https://github.com/FrodeHus/QuiCLI/actions/workflows/nuget.yml)\n[![CodeQL](https://github.com/FrodeHus/QuiCLI/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/FrodeHus/QuiCLI/actions/workflows/github-code-scanning/codeql)\n\nA lightweight framework for creating CLI applications with the primary focus of being compatible with AOT and trimming. This is to generate small and fast self-contained executables.\n\nBecause of the restrictions imposed by trimming and AOT, the framework is designed to be as simple as possible. This means that it does not support certain features that are common in other CLI frameworks that requires extensive reflection.\n\nThe framework is built on top of Microsoft.Extensions.DependencyInjection and Microsoft.Extensions.Configuration, which means that it is possible to use the same configuration and dependency injection system as in ASP.NET Core.\n\nAs an example of an application that uses QuiCLI, see [SecurityCenterCLI](https://github.com/FrodeHus/SecurityCenterCLI) and [RFDump](https://github.com/FrodeHus/RFDump).\n\n## Features\n\n- Dependency injection\n- Command line argument parsing\n- Command line argument help generation\n- Command line argument type conversion\n- Nested command groups\n\n## Quick start\n\n_Note:_ The framework is still in early development, and the API is subject to change.\n\nThe only supported returns types for asynchronous commands are `Task\u003cobject\u003e`, `Task\u003cstring\u003e` and `Task` due to reflection restrictions. For synchronous commands, everything is supported.\n\nRegistration of commands is explicit by design to make the code as efficient and clear as possible without heavy reflection usage.\n\n`dotnet add package QuiCLI`\n\n```csharp\n\nusing Microsoft.Extensions.DependencyInjection;\nusing QuiCLI;\nusing SampleApp;\n\nvar builder = QuicApp.CreateBuilder();\nbuilder.Configure(config =\u003e config.CustomBanner = () =\u003e \"Welcome to SampleApp!\");\nbuilder.Services.AddTransient\u003cGreeterService\u003e();\n\nbuilder.Commands.Add\u003cHelloCommand\u003e()\n    .WithCommand(\"hello\", x =\u003e x.Hello)\n    .WithCommand(\"bye\", x =\u003e x.Bye);\n\nvar informalGroup = builder.Commands.WithGroup(\"informal\");\n\ninformalGroup\n    .Add\u003cInformalGreetings\u003e()\n    .WithCommand(\"sup\", x =\u003e x.Sup)\n    .WithCommand(\"hey\", x =\u003e x.Hey);\n\ninformalGroup\n    .Add\u003cInformalGoodbyes\u003e()\n    .WithCommand(\"cya\", x =\u003e x.Cya)\n    .WithCommand(\"later\", x =\u003e x.Later);\n\nvar app = builder.Build();\n\napp.Run();\n\n\n\n```\n\n```csharp\nusing QuiCLI.Command;\n\nnamespace SampleApp;\n\ninternal class HelloCommand(GreeterService greeterService)\n{\n    private readonly GreeterService _greeterService = greeterService;\n\n    public string Hello(\n        [Parameter(help: \"Which name to greet\")] string name,\n        [Parameter(help: \"Define which year should be displayed\")] int year = 2024)\n    {\n        return $\"Hello, {name}! Welcome to {year}!\";\n    }\n\n    public string Bye(string name)\n    {\n        return _greeterService.SayGoodbye(name);\n    }\n}\n```\n\n```cmd\nmyapp hello --name \"World\"\n```\n\n```cmd\nsampleapp.exe --help\n\nWelcome to SampleApp!\nUsage:\n  \u003ccommand\u003e [arguments]\n\nCommands:\n        hello\n        bye\n\nNested Commands:\n        informal\n\nGlobal Arguments:\n        --help          :       Show help information\n        --output        :       Output format\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrodehus%2Fquicli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrodehus%2Fquicli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrodehus%2Fquicli/lists"}