Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seldaek/cli-prompt
Allows you to prompt for user input on the command line, and optionally hide the characters they type
https://github.com/seldaek/cli-prompt
cli hidden password php prompt shell
Last synced: 5 days ago
JSON representation
Allows you to prompt for user input on the command line, and optionally hide the characters they type
- Host: GitHub
- URL: https://github.com/seldaek/cli-prompt
- Owner: Seldaek
- License: mit
- Created: 2015-04-30T20:21:20.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2020-12-15T21:34:18.000Z (about 4 years ago)
- Last Synced: 2024-05-17T07:42:12.981Z (7 months ago)
- Topics: cli, hidden, password, php, prompt, shell
- Language: PHP
- Size: 10.7 KB
- Stars: 243
- Watchers: 6
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
CLI-Prompt
==========While prompting for user input using `fgets()` is quite easy, sometimes you
need to prompt for sensitive information. In these cases, the characters typed
in by the user should not be directly visible, and this is quite a pain to
do in a cross-platform way.This tiny package fixes just that for you:
```php
Prompts the user for input and hides what they type. If this fails for any
> reason and `$allowFallback` is set to `true` the prompt will be done using
> the usual `fgets()` and characters will be visible.- `Seld\CliPrompt\CliPrompt::prompt();`
> Regular user prompt for input with characters being shown on screen.
In both cases, the trailing newline the user enters when submitting the answer
is trimmed.Requirements
------------PHP 5.3 and above
License
-------CLI-Prompt is licensed under the MIT License - see the LICENSE file for details
Acknowledgments
---------------- This project uses hiddeninput.exe to prompt for passwords on Windows, sources
and details can be found on the [github page of the project](https://github.com/Seldaek/hidden-input).