All Projects → Seldaek → Cli Prompt

Seldaek / Cli Prompt

Licence: mit
Allows you to prompt for user input on the command line, and optionally hide the characters they type

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Cli Prompt

Prompts
❯ Lightweight, beautiful and user-friendly interactive prompts
Stars: ✭ 6,970 (+2957.02%)
Mutual labels:  cli, prompt
Node Promptly
Simple command line prompting utility for nodejs
Stars: ✭ 140 (-38.6%)
Mutual labels:  cli, prompt
Inquirer Checkbox Plus Prompt
Checkbox with autocomplete and other additions for Inquirer
Stars: ✭ 25 (-89.04%)
Mutual labels:  cli, prompt
Readline Sync
Synchronous Readline for interactively running to have a conversation with the user via a console(TTY).
Stars: ✭ 601 (+163.6%)
Mutual labels:  prompt, password
Staticrypt
Password protect a static HTML page
Stars: ✭ 2,280 (+900%)
Mutual labels:  cli, password
Bit
Bit is a modern Git CLI
Stars: ✭ 5,723 (+2410.09%)
Mutual labels:  cli, prompt
Tty Prompt
A beautiful and powerful interactive command line prompt
Stars: ✭ 1,210 (+430.7%)
Mutual labels:  cli, prompt
Go Prompt
Building powerful interactive prompts in Go, inspired by python-prompt-toolkit.
Stars: ✭ 4,255 (+1766.23%)
Mutual labels:  cli, prompt
Passw0rd
🔑securely checks a password to see if it has been previously exposed in a data breach
Stars: ✭ 159 (-30.26%)
Mutual labels:  cli, password
Deno Cliffy
Command line framework for deno 🦕 Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...
Stars: ✭ 149 (-34.65%)
Mutual labels:  cli, prompt
Xonsh
🐚 Python-powered, cross-platform, Unix-gazing shell
Stars: ✭ 5,327 (+2236.4%)
Mutual labels:  cli, prompt
Sharprompt
Interactive command line interface toolkit for C#
Stars: ✭ 197 (-13.6%)
Mutual labels:  cli, prompt
Upash
🔒Unified API for password hashing algorithms
Stars: ✭ 484 (+112.28%)
Mutual labels:  cli, password
Terjira
Terjira is a very interactive and easy to use CLI tool for Jira.
Stars: ✭ 713 (+212.72%)
Mutual labels:  cli, prompt
Gopass
getpasswd for Go
Stars: ✭ 424 (+85.96%)
Mutual labels:  prompt, password
Prompt Password
This repository has been archived, use the built-in password prompt in Enquirer instead.
Stars: ✭ 8 (-96.49%)
Mutual labels:  prompt, password
prompt-password-strength
Custom mask function for prompt-password that adds a 'strength progress meter' that changes color as the password strength increases. Uses zxcvbn, the popular password strength estimation tool brought to you by dropbox.
Stars: ✭ 18 (-92.11%)
Mutual labels:  prompt, password
Pick
A secure and easy-to-use CLI password manager for macOS and Linux
Stars: ✭ 359 (+57.46%)
Mutual labels:  cli, password
Gitin
commit/branch/workdir explorer for git
Stars: ✭ 1,815 (+696.05%)
Mutual labels:  cli, prompt
Dcipher Cli
🔓Crack hashes using online rainbow & lookup table attack services, right from your terminal.
Stars: ✭ 193 (-15.35%)
Mutual labels:  cli, password

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

echo 'Say hello: ';

$answer = Seld\CliPrompt\CliPrompt::hiddenPrompt();

echo 'You answered: '.$answer . PHP_EOL;

// Output in the CLI:
// 
// Say hello:
// You answered: hello

Installation

composer require seld/cli-prompt

API

  • Seld\CliPrompt\CliPrompt::hiddenPrompt($allowFallback = false);

    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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].