{"id":13432544,"url":"https://github.com/wobsoriano/bun-promptx","last_synced_at":"2025-04-13T08:30:38.353Z","repository":{"id":49354927,"uuid":"515752670","full_name":"wobsoriano/bun-promptx","owner":"wobsoriano","description":"Terminal prompt library for the Bun runtime","archived":false,"fork":false,"pushed_at":"2023-09-19T03:54:01.000Z","size":110,"stargazers_count":112,"open_issues_count":5,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-13T05:35:03.699Z","etag":null,"topics":["bun","bunjs","cli","go","prompt","tui"],"latest_commit_sha":null,"homepage":"","language":"Go","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/wobsoriano.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":"2022-07-19T21:57:45.000Z","updated_at":"2025-03-12T11:08:28.000Z","dependencies_parsed_at":"2024-06-19T13:33:27.862Z","dependency_job_id":null,"html_url":"https://github.com/wobsoriano/bun-promptx","commit_stats":{"total_commits":45,"total_committers":1,"mean_commits":45.0,"dds":0.0,"last_synced_commit":"f91e0c0c7889b07e0f3ff5fa5e5d745e437414b7"},"previous_names":["wobsoriano/promptx"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wobsoriano%2Fbun-promptx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wobsoriano%2Fbun-promptx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wobsoriano%2Fbun-promptx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wobsoriano%2Fbun-promptx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wobsoriano","download_url":"https://codeload.github.com/wobsoriano/bun-promptx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245183393,"owners_count":20573997,"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":["bun","bunjs","cli","go","prompt","tui"],"created_at":"2024-07-31T02:01:13.175Z","updated_at":"2025-03-27T00:12:14.268Z","avatar_url":"https://github.com/wobsoriano.png","language":"Go","funding_links":[],"categories":["Go","Extensions","cli"],"sub_categories":["Utilities"],"readme":"# bun-promptx\n\nbun-promptx is a terminal prompt library based on [bubbles](https://github.com/mritd/bubbles) via `bun:ffi`.\n\n## Install\n\n```bash\nbun add bun-promptx\n```\n\n## Usage\n\n### createSelection\n\nThe `createSelection` function lets you create a terminal single-selection list prompt. It provides the functions of page up and down and key movement, and supports custom rendering methods.\n\n```js\nimport { createSelection } from 'bun-promptx'\n\nconst result = createSelection([\n  { text: 'feat', description: 'Introducing new features' },\n  { text: 'fix', description: 'Bug fix' },\n  { text: 'docs', description: 'Writing docs' },\n  { text: 'style', description: 'Improving structure/format of the code' },\n  { text: 'refactor', description: 'Refactoring code' },\n  { text: 'test', description: 'Refactoring code' },\n  { text: 'chore', description: 'When adding missing tests' },\n  { text: 'perf', description: 'Improving performance' }\n], {\n  headerText: 'Select Commit Type: ',\n  perPage: 5,\n  footerText: 'Footer here'\n})\n\nconsole.log(result)\n// { selectedIndex: 2, error: null }\n```\n\n\u003cimg src=\"https://i.imgur.com/yE0qKyA.gif\" alt=\"promptx demo\" width=\"500\" /\u003e\n\n### createPrompt\n\nThe `createPrompt` function is a terminal input prompt library. It provides CJK character support and standard terminal shortcut keys (such as ctrl+a, ctrl+e), password input echo and other functions.\n\n```js\nimport { createPrompt } from 'bun-promptx'\n\nconst username = createPrompt(\"Enter username: \")\n// { value: \"wobsoriano\", error: null }\n\nconst password = createPrompt(\"Enter password: \", {\n  echoMode: 'password'\n})\n// { value: \"123456\", error: null }\n```\n\n\u003cimg src=\"https://i.imgur.com/wx6BTUm.gif\" alt=\"promptx demo\" width=\"500\" /\u003e\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwobsoriano%2Fbun-promptx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwobsoriano%2Fbun-promptx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwobsoriano%2Fbun-promptx/lists"}