{"id":17446005,"url":"https://github.com/jamen/pull-prompt","last_synced_at":"2025-09-25T02:31:05.378Z","repository":{"id":96785129,"uuid":"87751264","full_name":"jamen/pull-prompt","owner":"jamen","description":"A CLI prompter for pull-streams","archived":false,"fork":false,"pushed_at":"2017-04-10T00:59:29.000Z","size":8,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-12T11:43:47.672Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/jamen.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":"2017-04-10T00:59:09.000Z","updated_at":"2021-12-19T15:39:10.000Z","dependencies_parsed_at":"2023-05-29T03:15:13.088Z","dependency_job_id":null,"html_url":"https://github.com/jamen/pull-prompt","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"5f67235839756529a3aa068dcead99792e1da9f4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fpull-prompt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fpull-prompt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fpull-prompt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fpull-prompt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamen","download_url":"https://codeload.github.com/jamen/pull-prompt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234146643,"owners_count":18786792,"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-10-17T18:20:11.056Z","updated_at":"2025-09-25T02:31:00.044Z","avatar_url":"https://github.com/jamen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pull-prompt\n\n\u003e A CLI prompter for pull-streams\n\nA [pull-stream](https://github.com/pull-stream/pull-stream) that maps questions to answers by prompting the user.  It relies on [`prompt-skeleton`](https://npmjs.com/prompt-skeleton) ecosystem.\n\n```js\npull(\n  values([\n    { type: 'text',\n      message: 'what is the first animal you think of?',\n      default: 'unicorn' },\n    { type: 'confirm',\n      message: 'is the animal awesome?',\n      default: true }\n  ]),\n  prompt(),\n  collect((err, answers) =\u003e {\n    // ...\n  })\n)\n```\n\nSee [`examples/`](examples/) for use with state management modules (like [`pull-stream-model`](https://npmjs.com/pull-stream-model) and [`redux`](https://npmjs.com/redux)).\n\n## Installation\n\n```sh\n# with npm\nnpm i -s pull-prompt\n\n# with yarn\nyarn add pull-prompt\n```\n\n## Usage\n\n### `prompt()`\n\nA [through stream](https://github.com/pull-stream/pull-stream#through) that maps [questions](#questions) to what the user inputs.\n\n```js\npull(\n  questions(),\n  prompt(),\n  collect((err, answers) =\u003e {\n    // ...\n  })\n)\n```\n\n### Questions\n\nQuestions are objects which have a minimum of `{ type, message }`.  They may contain extra properties from the prompt type (e.g. `default`, `suggest`) or the user (e.g. `name: 'license'`)\n\n### `'text'` question\n\n```js\n{\n  type: 'text',\n  message: 'What is your name?',\n  default: 'John Doe' // optional\n}\n```\n\n### `'confirm'` question\n\n```js\n{\n  type: 'confirm',\n  message: 'Do you agree to the terms?',\n  default: false, // optional\n}\n```\n\n### `'autocomplete'` question\n\n```js\n{\n  type: 'autocomplete',\n  message: 'What country do you live in?',\n  suggest: function (input) {\n    // ...\n  }\n}\n```\n\nThe `suggest` function returns `Promise\u003cArray\u003e`. See [`cli-autocomplete`](https://github.com/derhuerst/cli-autocomplete) for more info\n\n---\n\n_Maintained by [Jamen Marz](https://git.io/jamen) (See on [Twitter](https://twitter.com/jamenmarz) and [GitHub](https://github.com/jamen) for questions \u0026 updates)_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamen%2Fpull-prompt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamen%2Fpull-prompt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamen%2Fpull-prompt/lists"}