{"id":13416844,"url":"https://github.com/manifoldco/promptui","last_synced_at":"2025-05-14T09:06:22.053Z","repository":{"id":37265655,"uuid":"107154646","full_name":"manifoldco/promptui","owner":"manifoldco","description":"Interactive prompt for command-line applications","archived":false,"fork":false,"pushed_at":"2024-08-06T06:39:41.000Z","size":172,"stargazers_count":6223,"open_issues_count":88,"forks_count":342,"subscribers_count":56,"default_branch":"master","last_synced_at":"2025-05-14T09:03:53.377Z","etag":null,"topics":["cli","command-line","golang","input","interface"],"latest_commit_sha":null,"homepage":"https://www.manifold.co","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/manifoldco.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2017-10-16T16:35:21.000Z","updated_at":"2025-05-14T02:34:47.000Z","dependencies_parsed_at":"2024-06-18T10:51:54.957Z","dependency_job_id":"d267284e-c3d8-4e52-9b77-dc36cbdf6388","html_url":"https://github.com/manifoldco/promptui","commit_stats":{"total_commits":111,"total_committers":36,"mean_commits":"3.0833333333333335","dds":0.7027027027027026,"last_synced_commit":"c2e487d3597f59bcf76b24c9e80679740a72212b"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manifoldco%2Fpromptui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manifoldco%2Fpromptui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manifoldco%2Fpromptui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manifoldco%2Fpromptui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manifoldco","download_url":"https://codeload.github.com/manifoldco/promptui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254110374,"owners_count":22016391,"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","command-line","golang","input","interface"],"created_at":"2024-07-30T22:00:23.388Z","updated_at":"2025-05-14T09:06:22.027Z","avatar_url":"https://github.com/manifoldco.png","language":"Go","funding_links":[],"categories":["Popular","Go","Prompt \u0026 Input","Command Line","HarmonyOS","cli","lib"],"sub_categories":["Windows Manager"],"readme":"# promptui\n\nInteractive prompt for command-line applications.\n\nWe built Promptui because we wanted to make it easy and fun to explore cloud\nservices with [manifold cli](https://github.com/manifoldco/manifold-cli).\n\n[Code of Conduct](./CODE_OF_CONDUCT.md) |\n[Contribution Guidelines](./.github/CONTRIBUTING.md)\n\n[![GitHub release](https://img.shields.io/github/tag/manifoldco/promptui.svg?label=latest)](https://github.com/manifoldco/promptui/releases)\n[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/github.com/manifoldco/promptui)\n[![Travis](https://img.shields.io/travis/manifoldco/promptui/master.svg)](https://travis-ci.org/manifoldco/promptui)\n[![Go Report Card](https://goreportcard.com/badge/github.com/manifoldco/promptui)](https://goreportcard.com/report/github.com/manifoldco/promptui)\n[![License](https://img.shields.io/badge/license-BSD-blue.svg)](./LICENSE.md)\n\n## Overview\n\n![promptui](https://media.giphy.com/media/xUNda0Ngb5qsogLsBi/giphy.gif)\n\nPromptui is a library providing a simple interface to create command-line\nprompts for go. It can be easily integrated into\n[spf13/cobra](https://github.com/spf13/cobra),\n[urfave/cli](https://github.com/urfave/cli) or any cli go application.\n\nPromptui has two main input modes:\n\n- `Prompt` provides a single line for user input. Prompt supports\n  optional live validation, confirmation and masking the input.\n\n- `Select` provides a list of options to choose from. Select supports\n  pagination, search, detailed view and custom templates.\n\nFor a full list of options check [GoDoc](https://godoc.org/github.com/manifoldco/promptui).\n\n## Basic Usage\n\n### Prompt\n\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n\n\t\"github.com/manifoldco/promptui\"\n)\n\nfunc main() {\n\tvalidate := func(input string) error {\n\t\t_, err := strconv.ParseFloat(input, 64)\n\t\tif err != nil {\n\t\t\treturn errors.New(\"Invalid number\")\n\t\t}\n\t\treturn nil\n\t}\n\n\tprompt := promptui.Prompt{\n\t\tLabel:    \"Number\",\n\t\tValidate: validate,\n\t}\n\n\tresult, err := prompt.Run()\n\n\tif err != nil {\n\t\tfmt.Printf(\"Prompt failed %v\\n\", err)\n\t\treturn\n\t}\n\n\tfmt.Printf(\"You choose %q\\n\", result)\n}\n```\n\n### Select\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/manifoldco/promptui\"\n)\n\nfunc main() {\n\tprompt := promptui.Select{\n\t\tLabel: \"Select Day\",\n\t\tItems: []string{\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\",\n\t\t\t\"Saturday\", \"Sunday\"},\n\t}\n\n\t_, result, err := prompt.Run()\n\n\tif err != nil {\n\t\tfmt.Printf(\"Prompt failed %v\\n\", err)\n\t\treturn\n\t}\n\n\tfmt.Printf(\"You choose %q\\n\", result)\n}\n```\n\n### More Examples\n\nSee full list of [examples](https://github.com/manifoldco/promptui/tree/master/_examples)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanifoldco%2Fpromptui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanifoldco%2Fpromptui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanifoldco%2Fpromptui/lists"}