{"id":15629934,"url":"https://github.com/seldaek/cli-prompt","last_synced_at":"2025-04-12T15:36:06.161Z","repository":{"id":31312481,"uuid":"34874840","full_name":"Seldaek/cli-prompt","owner":"Seldaek","description":"Allows you to prompt for user input on the command line, and optionally hide the characters they type","archived":false,"fork":false,"pushed_at":"2020-12-15T21:34:18.000Z","size":11,"stargazers_count":243,"open_issues_count":0,"forks_count":7,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-05-17T07:42:12.981Z","etag":null,"topics":["cli","hidden","password","php","prompt","shell"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"LinArcX/Gnulium","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Seldaek.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}},"created_at":"2015-04-30T20:21:20.000Z","updated_at":"2024-02-24T11:06:42.000Z","dependencies_parsed_at":"2022-08-27T12:01:23.820Z","dependency_job_id":null,"html_url":"https://github.com/Seldaek/cli-prompt","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seldaek%2Fcli-prompt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seldaek%2Fcli-prompt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seldaek%2Fcli-prompt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seldaek%2Fcli-prompt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Seldaek","download_url":"https://codeload.github.com/Seldaek/cli-prompt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248590275,"owners_count":21129773,"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","hidden","password","php","prompt","shell"],"created_at":"2024-10-03T10:29:38.589Z","updated_at":"2025-04-12T15:36:06.133Z","avatar_url":"https://github.com/Seldaek.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"CLI-Prompt\n==========\n\nWhile prompting for user input using `fgets()` is quite easy, sometimes you\nneed to prompt for sensitive information. In these cases, the characters typed\nin by the user should not be directly visible, and this is quite a pain to\ndo in a cross-platform way.\n\nThis tiny package fixes just that for you:\n\n```php\n\u003c?php\n\necho 'Say hello: ';\n\n$answer = Seld\\CliPrompt\\CliPrompt::hiddenPrompt();\n\necho 'You answered: '.$answer . PHP_EOL;\n\n// Output in the CLI:\n// \n// Say hello:\n// You answered: hello\n```\n\nInstallation\n------------\n\n`composer require seld/cli-prompt`\n\nAPI\n---\n\n- `Seld\\CliPrompt\\CliPrompt::hiddenPrompt($allowFallback = false);`\n\n  \u003e Prompts the user for input and hides what they type. If this fails for any\n  \u003e reason and `$allowFallback` is set to `true` the prompt will be done using\n  \u003e the usual `fgets()` and characters will be visible.\n\n- `Seld\\CliPrompt\\CliPrompt::prompt();`\n\n  \u003e Regular user prompt for input with characters being shown on screen.\n\nIn both cases, the trailing newline the user enters when submitting the answer\nis trimmed.\n\nRequirements\n------------\n\nPHP 5.3 and above\n\nLicense\n-------\n\nCLI-Prompt is licensed under the MIT License - see the LICENSE file for details\n\nAcknowledgments\n---------------\n\n- This project uses hiddeninput.exe to prompt for passwords on Windows, sources\n  and details can be found on the [github page of the project](https://github.com/Seldaek/hidden-input).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseldaek%2Fcli-prompt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseldaek%2Fcli-prompt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseldaek%2Fcli-prompt/lists"}