{"id":18708521,"url":"https://github.com/alimozdemir/promptcli","last_synced_at":"2025-04-12T10:34:26.246Z","repository":{"id":56306191,"uuid":"253242953","full_name":"alimozdemir/PromptCLI","owner":"alimozdemir","description":"Interactive command line interface library","archived":false,"fork":false,"pushed_at":"2020-11-28T18:47:29.000Z","size":1691,"stargazers_count":36,"open_issues_count":0,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-05T18:55:40.137Z","etag":null,"topics":["cli","csharp","inquirer","prompt"],"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/alimozdemir.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}},"created_at":"2020-04-05T13:35:34.000Z","updated_at":"2024-04-04T19:36:56.000Z","dependencies_parsed_at":"2022-08-15T16:20:43.946Z","dependency_job_id":null,"html_url":"https://github.com/alimozdemir/PromptCLI","commit_stats":null,"previous_names":["lyzerk/promptcli"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alimozdemir%2FPromptCLI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alimozdemir%2FPromptCLI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alimozdemir%2FPromptCLI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alimozdemir%2FPromptCLI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alimozdemir","download_url":"https://codeload.github.com/alimozdemir/PromptCLI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223511587,"owners_count":17157547,"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","csharp","inquirer","prompt"],"created_at":"2024-11-07T12:23:51.315Z","updated_at":"2024-11-07T12:23:51.969Z","avatar_url":"https://github.com/alimozdemir.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PromptCLI\n\n![Nuget](https://img.shields.io/nuget/v/PromptCLI) [![Azure DevOps builds](https://img.shields.io/azure-devops/build/almozdmr/PromptCLI/1)](https://dev.azure.com/almozdmr/PromptCLI/_build?definitionId=1\u0026_a=summary) ![Coverage](https://img.shields.io/azure-devops/coverage/almozdmr/PromptCLI/1)\n\nPromptCLI is inspired from inquirer.js and enquirer.js. It is a interactive command line interface library.\n\n![Basics](https://github.com/lyzerk/PromptCLI/raw/master/assets/gifs/basics.gif \"Basics\")\n\n# Usage\n\n```csharp\npublic class TestClass\n{\n    [Input(\"Project Name ?\")]\n    public string ProjectName { get; set; }\n\n    [Select(typeof(string), \"License Type ?\", \"MIT\", \"GNU\", \"Apache\")]\n    public string License { get; set; }\n\n    [Checkbox(typeof(int), \"Level ?\", 1, 2, 3, 4)]\n    public IEnumerable\u003cint\u003e Level { get; set; }\n\n    [Input(\"Briefly explain ?\")]\n    public string Description { get; set; }\n}\n\nstatic void Main(string[] args)\n{\n    var prompt = new Prompt();\n\n    var obj = prompt.Run\u003cTestClass\u003e(obj);\n}\n\n```\n\n## Without POCO class (Callback Action)\n\nYou can handle a callback action after each step\n\n```csharp\nvar project = new Project();\n\nvar prompt = new Prompt();\nprompt.Add(new InputComponent(\"Project Name\", \"Project1\"))\n        .Callback(i =\u003e project.ProjectName = i)\n    .Add(new SelectComponent\u003cstring\u003e(\"License Type\", new List\u003cstring\u003e() { \"MIT\", \"Apache\", \"GNU\" } ))\n        .Callback(i =\u003e project.License = i)\n    .Add(new CheckboxComponent\u003cstring\u003e(\"Features\", new List\u003cstring\u003e() { \"Linter\", \"Router\", \"Other\" }))\n        .Callback(i =\u003e project.Features = i)\n    .Add(new InputComponent(\"Description\"))\n        .Callback(i =\u003e project.Description = i);\nprompt.Begin();\n```\n\n## Config\n\n```csharp\npublic class PromptConfig\n{\n    public ConsoleColor QuestionColor { get; } = ConsoleColor.Gray;\n    public ConsoleColor AnswerColor { get; } = ConsoleColor.Cyan;\n    public ConsoleColor CursorColor { get; } = ConsoleColor.Red;\n    public string Cursor { get; } = \"\u003e \";\n}\n```\n# Contributions\n\nAll contributions are welcome if well described.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falimozdemir%2Fpromptcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falimozdemir%2Fpromptcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falimozdemir%2Fpromptcli/lists"}