{"id":13414911,"url":"https://github.com/jden123/JustCli","last_synced_at":"2025-03-14T22:32:27.555Z","repository":{"id":142997366,"uuid":"48795805","full_name":"jden123/JustCli","owner":"jden123","description":"Just a quick way to create your own command line tool","archived":false,"fork":false,"pushed_at":"2021-02-23T04:20:15.000Z","size":1211,"stargazers_count":29,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-13T09:27:35.803Z","etag":null,"topics":[],"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/jden123.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}},"created_at":"2015-12-30T10:33:23.000Z","updated_at":"2024-08-23T16:25:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"8a75ec01-4b73-480a-933a-f86657abd9e5","html_url":"https://github.com/jden123/JustCli","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jden123%2FJustCli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jden123%2FJustCli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jden123%2FJustCli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jden123%2FJustCli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jden123","download_url":"https://codeload.github.com/jden123/JustCli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243658057,"owners_count":20326459,"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-07-30T21:00:39.772Z","updated_at":"2025-03-14T22:32:27.085Z","avatar_url":"https://github.com/jden123.png","language":"C#","funding_links":[],"categories":["CLI"],"sub_categories":[],"readme":"JustCli\n===\nThat’s just a quick way to create your own command line tool. \n\nThe idea is to have one command in one class. A set of attributes helps you to map command line arguments to the command class properties and provide additional information. JustCli scans your project, generates help and allows you to run the commands.\n\nDownload\n---\nYou can install it using [NuGet](https://www.nuget.org/packages/JustCli/).\n\nExample\n---\nLet’s create a “*sayhello*” command.\nFirst of all we need a console application with JustCli entry point.\n```csharp\nstatic int Main(string[] args)\n{\n    return CommandLineParser.Default.ParseAndExecuteCommand(args);\n}\n```\nCreate SayHelloCommand class and implement command logic.\n```csharp\n[Command(\n    \"sayhello\",\n    \"Prints a greeting.\",\n    @\"Very useful command that print hello to the output with the word you provide.\nThis command is greatly described in this help text so you should be able to use it properly after you read it.\nMore examples at http://hello.world/greetings/examples\")]\nclass SayHelloCommand : ICommand\n{\n    [CommandArgument(\"n\", \"name\", Description = \"The someone to greet.\", DefaultValue = \"World\")]\n    public string Name { get; set; }\n\n    [CommandOutput]\n    public IOutput Output { get; set; }\n\n    public int Execute()\n    {\n        Output.WriteInfo(\"Hello {0}!\", Name);\n        return ReturnCode.Success;\n    }\n}\n```\nCommandOutput attribute marks property where the common output is injected. Colored console is used by default.\n\nWhen run the command line tool we can see command list.\n```\ncmd\u003e TestApp.exe\nCommand list:\nsayhello - Prints a greeting.\n```\nAlso you can get help for a special command.\n```\ncmd\u003e TestApp.exe sayhello ? \nsayhello - Prints a greeting.\n  Very useful command that print hello to the output with the word you provide.\n  This command is greatly described in this help text so you should be able to use it properly after you read it.\n  More examples at http://hello.world/greetings/examples\nOptions:\n  -n  --name  [string]  The someone to greet. [default: World]  \n```\nThat is what JustCli makes for you.\n\nLet's test \"*sayhello*\" command.\n```\ncmd\u003e TestApp.exe sayhello\nHello World!\ncmd\u003e TestApp.exe sayhello -n Bob\nHello Bob!\n```\nNow you know how to create command line tool quickly and easily! :)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjden123%2FJustCli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjden123%2FJustCli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjden123%2FJustCli/lists"}