{"id":17501905,"url":"https://github.com/calvinmclean/survey","last_synced_at":"2025-07-12T01:39:45.332Z","repository":{"id":229278831,"uuid":"776314760","full_name":"calvinmclean/survey","owner":"calvinmclean","description":"A Gleam library to easily create rich and interactive prompts in the terminal for user input","archived":false,"fork":false,"pushed_at":"2024-03-24T00:21:17.000Z","size":17,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T10:15:58.869Z","etag":null,"topics":["cli","gleam","gleam-lang","prompt","terminal","user-input"],"latest_commit_sha":null,"homepage":"","language":"Gleam","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/calvinmclean.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":"2024-03-23T06:47:39.000Z","updated_at":"2025-02-18T17:02:47.000Z","dependencies_parsed_at":"2024-03-23T07:47:02.353Z","dependency_job_id":"07fb55f3-12c2-44c5-a1ba-2e577bdb2bfb","html_url":"https://github.com/calvinmclean/survey","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"eb2d50f0fc081e7432f9568274a28c5324a55e4c"},"previous_names":["calvinmclean/survey"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmclean%2Fsurvey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmclean%2Fsurvey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmclean%2Fsurvey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmclean%2Fsurvey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/calvinmclean","download_url":"https://codeload.github.com/calvinmclean/survey/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246085939,"owners_count":20721275,"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","gleam","gleam-lang","prompt","terminal","user-input"],"created_at":"2024-10-19T20:16:31.009Z","updated_at":"2025-03-28T19:22:50.447Z","avatar_url":"https://github.com/calvinmclean.png","language":"Gleam","funding_links":[],"categories":[],"sub_categories":[],"readme":"# survey\n\n[![Package Version](https://img.shields.io/hexpm/v/survey)](https://hex.pm/packages/survey)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/survey/)\n\nA library to easily create rich and interactive prompts in the terminal.\n\nInpired by [`AlecAivazis/survey`](https://github.com/AlecAivazis/survey)\n\nUse `survey.Question` for `String` input and `survey.Confirmation` for `Bool` input.\n\n```sh\ngleam add survey\n```\n```gleam\nimport survey\nimport gleam/option.{type Option, None, Some}\n\npub fn main() {\n  let assert [\n    #(\"first_name\", survey.StringAnswer(first_name)),\n    #(\"last_name\", survey.StringAnswer(last_name)),\n    #(\"survey_fan\", survey.BoolAnswer(survey_fan)),\n  ] =\n    [\n      #(\n        \"first_name\",\n        survey.new_question(\n          prompt: \"First Name:\",\n          help: Some(\"Please enter your first name\"),\n          default: None,\n          validate: None,\n          transform: None,\n        ),\n      ),\n      #(\n        \"last_name\",\n        survey.new_question(\n          prompt: \"Last Name:\",\n          help: Some(\"Please enter your last name\"),\n          default: None,\n          validate: None,\n          transform: None,\n        ),\n      ),\n      #(\n        \"survey_fan\",\n        survey.new_confirmation(\n          prompt: \"Are you a survey fan?:\",\n          help: Some(\"It's a great library\"),\n          default: Some(True),\n          transform: Some(fn(_: Bool) -\u003e Bool { True }),\n        ),\n      ),\n    ]\n    |\u003e survey.ask_many(help: False)\n\n  case survey_fan {\n    True -\u003e io.println(\"Hello, \" \u003c\u003e first_name \u003c\u003e \" \" \u003c\u003e last_name \u003c\u003e \"!\")\n    False -\u003e io.println(\"I don't believe you\")\n  }\n}\n```\n\n```sh\n⟩ gleam run\n   Compiled in 0.02s\n    Running survey.main\nFirst Name: Survey\nLast Name: User\nAre you a survey fan?: [Y/n] \nHello, Survey User!\n```\n\nFurther documentation can be found at \u003chttps://hexdocs.pm/survey\u003e.\n\n## Development\n\n```sh\ngleam run   # Run the project\ngleam test  # Run the tests\ngleam shell # Run an Erlang shell\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalvinmclean%2Fsurvey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalvinmclean%2Fsurvey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalvinmclean%2Fsurvey/lists"}