{"id":32491311,"url":"https://github.com/utopleman/kingpinnet","last_synced_at":"2025-10-27T09:20:57.555Z","repository":{"id":113006976,"uuid":"178447083","full_name":"UtopleMan/KingpinNet","owner":"UtopleMan","description":"Kingpin style command line arguments parser and UI goodies for .NET","archived":false,"fork":false,"pushed_at":"2024-09-14T10:07:48.000Z","size":744,"stargazers_count":3,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T19:44:27.925Z","etag":null,"topics":["arguments-parser","command-line","csharp","kingpin"],"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/UtopleMan.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-29T17:13:21.000Z","updated_at":"2024-09-14T10:07:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"4144cce3-08e8-440e-b2d6-dc37ec88c9fd","html_url":"https://github.com/UtopleMan/KingpinNet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/UtopleMan/KingpinNet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UtopleMan%2FKingpinNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UtopleMan%2FKingpinNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UtopleMan%2FKingpinNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UtopleMan%2FKingpinNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UtopleMan","download_url":"https://codeload.github.com/UtopleMan/KingpinNet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UtopleMan%2FKingpinNet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281244059,"owners_count":26467812,"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","status":"online","status_checked_at":"2025-10-27T02:00:05.855Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["arguments-parser","command-line","csharp","kingpin"],"created_at":"2025-10-27T09:20:51.991Z","updated_at":"2025-10-27T09:20:57.548Z","avatar_url":"https://github.com/UtopleMan.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Latest version](https://img.shields.io/badge/nuget-v0.2-blue.svg)](https://www.nuget.org/packages/KingpinNet)\n# Kingpin.Net style command line arguments parser and command line UI goodies for .NET \n\n\u003c!-- MarkdownTOC --\u003e\n- [Overview](#overview)\n- [Features](#features)\n- [Usage](#usage)\n  - [Bare-bone example](#bare-bone-example)\n  - [Example integrating into Microsoft.Extensions.Configuration](#example-integrating-into-microsoft.extensions.configuration)\n- [Reference documentation](#reference-documentation)\n  - [General configuration](#general-configuration)\n  - [Commands](#commands)\n  - [Flags](#flags)\n  - [Arguments](#arguments)\n  - [Custom help](#custom-help)\n- [Changelog](#changelog)\n\u003c!-- /MarkdownTOC --\u003e\n\n## Overview\n\nKingpin.Net is a free interpretation of the glorious Kingpin golang project, found [here](https://github.com/alecthomas/kingpin).\n\nUsing coding fluent style, you can easily build a consistent commandline interface for your tool. Kingpin.Net supports type safety on arguments and flags, and supports nested commands.\n\nInstall the Kingpin.Net nuget package using the following command in the package manager console window\n\n```\nPM\u003e Install-Package KingpinNet\n```\n\nThe Nuget package can be found [here](https://www.nuget.org/packages/Newtonsoft.Json)\n\n \n## Features\n\n- Fluent style API\n- Rich support for commmands, sub-commands, arguments and flags\n- Deep integration into Microsoft.Extensions.Configuration\n- Type safe arguments and flags\n- Beautiful console help\n- POSIX Style short flags\n- Customizable console help using the awesome [Liquid syntax](https://shopify.github.io/liquid/basics/introduction/)\n- Context sensitive help output\n- TAB Auto-completion on ZSH, Bash and Powershell\n- Arguments containing lists of values\n\n## Usage\n\nHere is the two major ways to add rich support for command line aruments into your application\n\n### Bare-bone example\n\nIn order just to get the simplest command line parsing up and running \n\n```csharp\nclass Program\n{\n    static void Main(string[] args)\n    {\n        Kingpin.Version(\"0.0.1\");\n        Kingpin.Author(\"Joe Malone\");\n        Kingpin.ExitOnHelp();\n        Kingpin.ShowHelpOnParsingErrors();\n\n        FlagItem debug = Kingpin.Flag(\"debug\", \"Enable debug mode.\").IsBool();\n        FlagItem timeout = Kingpin.Flag(\"timeout\", \"Timeout waiting for ping.\")\n            .IsRequired().Short('t').IsDuration();\n        ArgumentItem ip = Kingpin.Argument(\"ip\", \"IP address to ping.\").IsRequired().IsIp();\n        ArgumentItem count = Kingpin.Argument(\"count\", \"Number of packets to send\").IsInt();\n\n        var result = Kingpin.Parse(args);\n        Console.WriteLine($\"Would ping: {ip} with timeout {timeout} and count {count} with debug = {debug}\");\n        Console.ReadLine();\n    }\n}\n```\n\n### Example integrating into Microsoft.Extensions.Configuration\n\nIntegrating with the configuration system build into .NET Core is equally easy. Just add .AddKingpinNetCommandLine(args) to your configuration builder\n\n```csharp\nclass Program\n{\n    static void Main(string[] args)\n    {\n        Kingpin.Version(\"1.0\").Author(\"Peter Andersen\").ApplicationName(\"curl\")\n            .ApplicationHelp(\"An example implementation of curl.\");\n        Kingpin.ShowHelpOnParsingErrors();\n        var get = Kingpin.Command(\"get\", \"GET a resource.\").IsDefault();\n        get.Argument(\"url\", \"Retrieve a URL.\").IsDefault();\n        var post = Kingpin.Command(\"post\", \"POST a resource.\");\n        post.Argument(\"url\", \"URL to POST to.\").IsRequired().IsUrl();\n\n\n        var configuration = new ConfigurationBuilder().AddEnvironmentVariables()\n            .AddKingpinNetCommandLine(args).Build();\n\n        switch (configuration[\"command\"])\n        {\n            case \"get:url\":\n                Console.WriteLine($\"Getting URL {configuration[\"get:url\"]}\");\n                break;\n\n            case \"post\":\n                Console.WriteLine($\"Posting to URL {configuration[\"post:url\"]}\");\n                break;\n        }\n\n        Console.ReadLine();\n    }\n}\n```\n### Auto-completion in Powershell, Bash and ZSH\n\nKingpinNet supports auto completion on all the three major terminals. Just run the following commands with your tool:\n\nFor ZSH:\n```\neval \"$({Your-tool-executable} --suggestion-script-zsh)\"\n```\nFor Bash:\n```\neval \"$({Your-tool-executable} --suggestion-script-bash)\"\n```\nFor Powershell:\n```\niex \"$({Your-tool-executable} --suggestion-script-pwsh)\"\n```\n\nAfter you run the script, you are able to have TAB auto complete on your tool.\n\n## Changelog\n - 1.1.15\n   - Added argument containing list of values\n - 1.1\n   - Various clean ups\n - 1.0\n   - Removed TT templates help generation\n   - Added default DotLiquid help template\n   - Cleaned up IConsole usage\n - 0.9\n   - Added auto completion scripts for ZSH, Bash and Powershell\n - 0.8\n   - Added first attempt on auto completions for PowerShell, BASH and ZSH\n - 0.7\n   - Added KingpinNet.UI\n   - Added ProgressBar and Spinner widgets\n   - Removed all references to Microsofts static Console object and used the mockable IConsole interface instead\n   - Updated tests\n - 0.6\n   - Bug fixes    \n - 0.5\n   - Bug fixes\n - 0.4\n   - Added parse method to the KingpinApplication class\n - 0.2\n   - Added support for Linux newlines\n   - Added documentation\n   - Refactored the help flag code\n - 0.1\n   - Initial project structure setup\n   - Help on nested commands\n   - Added example applications\n   - Added template help using T4 templates\n\n## Reference documentation (WIP)\n### General configuration\n### Commands\n### Flags\n### Arguments\n### Custom help\n## Integration into .NET Core Options and Configuration\n\n## Mentions\n * Check out this fantastic ASCII font library https://github.com/drewnoakes/figgle\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futopleman%2Fkingpinnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Futopleman%2Fkingpinnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futopleman%2Fkingpinnet/lists"}