{"id":20980508,"url":"https://github.com/hyperjumptech/hyper-interactive","last_synced_at":"2025-10-05T18:33:35.385Z","repository":{"id":102269601,"uuid":"425545948","full_name":"hyperjumptech/hyper-interactive","owner":"hyperjumptech","description":"Small Golang Library to enable command line application interactive input","archived":false,"fork":false,"pushed_at":"2023-07-05T02:01:29.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-20T06:33:01.742Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyperjumptech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-11-07T15:48:36.000Z","updated_at":"2022-08-23T14:22:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"f9c9e63c-eae2-4364-b3f5-a60b9bc9d340","html_url":"https://github.com/hyperjumptech/hyper-interactive","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjumptech%2Fhyper-interactive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjumptech%2Fhyper-interactive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjumptech%2Fhyper-interactive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjumptech%2Fhyper-interactive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperjumptech","download_url":"https://codeload.github.com/hyperjumptech/hyper-interactive/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243382935,"owners_count":20282051,"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-11-19T05:28:57.763Z","updated_at":"2025-10-05T18:33:35.291Z","avatar_url":"https://github.com/hyperjumptech.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hyper-Interactive\n\nHyper-Interaction is a very small tiny library to help\nmaking a command line app become interactive. It allowes user to\nfill in qustionaire, making configuration or just a simple\ninformation input.\n\n```shell\ngo get -u github.com/hyperjumptech/hyper-interactive\n```\n\n## Simple text input\n\n```go\nimport (\n\t\"fmt\"\n\tinteractive \"github.com/hyperjumptech/hyper-interactive\"\n)\n\n...\nname := interactive.Ask(\"Whats your name ?\", \"Bruce Wayne\", false)\nfmt.Println(\"Hi \" + name)\n...\n```\n\nThe command line will look like\n\n```shell\n$ interact\nWhats your name ? [default \"Bruce Wayne\"] : Ferdinand\nHi Ferdinand\n```\n\n## Default Answer\n\nIf you see `[default __]`, simply hit `enter` will use the default value as your answer.\n\n## Confirming your Answer\n\nAll question type have a confirmation flag in their argument.\nFor example\n\n```go\n// the last argument is a confirmation flag\nname := interactive.Ask(\"Whats your name ?\", \"Bruce Wayne\", true) \nfmt.Println(\"Hi \" + name)\n```\n\nThis will result\n\n```shell\n$ interact\nWhats your name ? [default \"Bruce Wayne\"] : Ferdinand\n\"Ferdinand\", are you sure? (y/n/Y/N) [default : Y] ? Y\nHi Ferdinand\n```\n\n## You will get result\n\nThe logic in all of those ask function will make sure the\nuser fill in the correct answer.\n\n- User are ensured to choose valid option\n- User are ensured to specify valid number\n- User are ensured to specify valid time format\n- etc\n\n## Asking for Options\n\n```go\noptions := []string {\n    \"One\",\"Two\",\"Three\",\n    \"Four\",\"Five\",\"Six\",\n    \"Seven\",\"Eight\",\"Nine\",\n    \"Ten\",\n}\nchoosen := interactive.Select(\"Please choose\", options, 1,1, true)\nfmt.Printf(\"You choose number %d\\n\", choosen)\n```\n\nThis will be shown as\n\n```shell\n$ interact\nPlease choose :\n(1) One    (3) Three  (5) Five   (7) Seven  (9) Nine                         \n(2) Two    (4) Four   (6) Six    (8) Eight  (10) Ten                         \nChoose from number above [default : (1) One] ? 5\n(5) Five - Are you sure ?  (y/n/Y/N) [default : Y] ? Y\nYou choose number 5\n```\n\n## Supported Questions\n\n- `func Select(question string, options []string, startFrom, defaultOption int, confirm bool) int`\n- `func AskNumber(question string, from, to, def int, confirm bool) int`\n- `func AskTime(question string, def time.Time, confirm bool) time.Time`. The answer must follow format `2006-01-02 15:04:05 -0700`\n- `func Ask(question, defaultAnswer string, confirm bool) string`\n- `func Confirm(question string, def bool) bool`\n- more to come...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperjumptech%2Fhyper-interactive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperjumptech%2Fhyper-interactive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperjumptech%2Fhyper-interactive/lists"}