Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Command line utility for stylish interactive prompts

License

NotificationsYou must be signed in to change notification settings

termapps/enquirer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZulipCrates.io

Command line utility for stylish interactive prompts
(usesdialoguer underneath)

Getting started

  1. Install
  2. Usage
    1. Command Line Utility
  3. Prompts
    1. Confirm Prompt
    2. Input Prompt
    3. Secret Prompt
    4. Select Prompt
    5. Multi Select Prompt
    6. Sort Prompt
  4. Changelog

Install

enquirer is available on Linux, macOS

$ brew install termapps/tap/enquirer

Withcargo

$ cargo install enquirer

Direct

Pre-built binary executables are available atreleases page for macOS (64bit), Linux (64bit, 32bit).

Download and unarchive the binary then put the executable in$PATH.

Usage

Command Line Utility

The main reason I created this tool is to use it as an stylish interactive and user-friendly prompt for bash scripting.

#!/bin/bashconfirm=$(enquirer confirm -m"Do you want to continue?" -d)if ["$confirm"="true" ];thenecho"Continuing ..."elseecho"Thanks for using this tool. Quitting ..."exitfi

Seeprompts for more information on subcommands.

enquirer 0.5.1Command Line Utility for Stylish Interactive PromptsUSAGE:    enquirer [FLAGS] <SUBCOMMAND>FLAGS:    -h, --help        Prints help information        --no-color    Disable colors in the prompt    -V, --version     Prints version informationSUBCOMMANDS:    confirm         Prompt that returns `true` or `false` (as strings)    help            Prints this message or the help of the given subcommand(s)    input           Prompt that takes user input and returns a string    multi-select    Prompt that allows the user to select multiple items from a list of options    secret          Prompt that takes user input, hides it from the terminal, and returns a string    select          Prompt that allows the user to select from a list of options    sort            Prompt that allows the user to sort items in a list

Prompts

Confirm Prompt

Prompt that returnstrue orfalse (as strings)

Enquirer Confirm Prompt

Usage

enquirer-confirm 0.5.1Prompt that returns `true` or `false` (as strings)USAGE:    enquirer confirm [FLAGS] --message <message>FLAGS:    -c, --cancel     Makes the prompt cancellable with 'Esc' or 'q'    -d, --default    Sets the default value for the prompt as `true`    -h, --help       Prints help informationOPTIONS:    -m, --message <message>    Message for the prompt

Input Prompt

Prompt that takes user input and returns a string

Enquirer Input Prompt

Usage

enquirer-input 0.5.1Prompt that takes user input and returns a stringUSAGE:    enquirer input [FLAGS] [OPTIONS] --message <message>FLAGS:    -a, --allow-empty    Allow empty input. Conflicts with `default`    -h, --help           Prints help informationOPTIONS:    -d, --default <default>    Default value for the prompt    -m, --message <message>    Message for the prompt

Secret Prompt

Prompt that takes user input, hides it from the terminal, and returns a string

Enquirer Secret Prompt

Usage

enquirer-secret 0.5.1Prompt that takes user input, hides it from the terminal, and returns a stringUSAGE:    enquirer secret [FLAGS] [OPTIONS] --message <message>FLAGS:    -a, --allow-empty    Allow empty secret    -h, --help           Prints help informationOPTIONS:    -c, --confirm <confirm>    Enable confirmation prompt with this message    -e, --error <error>        Error message when secrets doesn't match during confirmation    -m, --message <message>    Message for the prompt

Select Prompt

Prompt that allows the user to select from a list of options

Enquirer Select Prompt

Usage

enquirer-select 0.5.1Prompt that allows the user to select from a list of optionsUSAGE:    enquirer select [FLAGS] [OPTIONS] --message <message> [items]...FLAGS:    -c, --cancel    Makes the prompt cancellable with 'Esc' or 'q'    -h, --help      Prints help information    -i, --index     Returns index of the selected item instead of item itselfOPTIONS:    -m, --message <message>      Message for the prompt    -s, --selected <selected>    Specify number of the item that will be selected by defaultARGS:    <items>...    Items that can be selected

Multi Select Prompt

Prompt that allows the user to select multiple items from a list of options

Enquirer Multi Select Prompt

Usage

enquirer-multi-select 0.5.1Prompt that allows the user to select multiple items from a list of optionsUSAGE:    enquirer multi-select [FLAGS] [OPTIONS] --message <message> [--] [items]...FLAGS:    -c, --cancel       Makes the prompt cancellable with 'Esc' or 'q'    -h, --help         Prints help information    -i, --index        Returns index of the selected items instead of items itself        --no-inline    Do not print the selected items on the prompt line    -d, --default      Makes the prompt return default values as given if --cancel option is presentOPTIONS:    -m, --message <message>         Message for the prompt    -s, --selected <selected>...    Specify numbers of items that will be selected by defaultARGS:    <items>...    Items that can be selected

Sort Prompt

Prompt that allows the user to sort items in a list

Enquirer Sort Prompt

Usage

enquirer-sort 0.5.1Prompt that allows the user to sort items in a listUSAGE:    enquirer sort [FLAGS] --message <message> [items]...FLAGS:    -c, --cancel       Makes the prompt cancellable with 'Esc' or 'q'    -h, --help         Prints help information    -i, --index        Returns index of the sorted items instead of items itself        --no-inline    Do not print the sorted items on the prompt line    -d, --default      Makes the prompt return default order as given if --cancel option is presentOPTIONS:    -m, --message <message>    Message for the promptARGS:    <items>...    Items that can be sorted

Contributors

Here is a list ofContributors

TODO

Changelog

Please seeCHANGELOG.md.

License

MIT/X11

Bug Reports

Reporthere.

Creator

Pavan Kumar Sunkara (pavan.sss1991@gmail.com)

Follow me ongithub,twitter

About

Command line utility for stylish interactive prompts

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp