#prompt #cli #cli-prompt #answer

nightly bin+lib ask-cli

Ask CLI offers a simple way to ask a yes or no question

10 releases

0.3.0 Feb 16, 2024
0.2.1 Nov 19, 2023
0.2.0 Sep 11, 2023
0.1.6 Jul 12, 2023
0.1.1 Oct 31, 2022

#14 in #cli-prompt

Download history 35/week @ 2025-10-21 9/week @ 2025-10-28 8/week @ 2025-11-04 3/week @ 2025-11-11 3/week @ 2025-11-18 1/week @ 2025-11-25 23/week @ 2025-12-09 27/week @ 2025-12-16 5/week @ 2025-12-23 14/week @ 2025-12-30 11/week @ 2026-01-06 17/week @ 2026-01-13 11/week @ 2026-01-20 20/week @ 2026-01-27 4/week @ 2026-02-03

55 downloads per month
Used in 2 crates

Apache-2.0

17KB
185 lines

Ask CLI

ask offers a simple way to ask a yes or no question on the CLI, returning exit code 0 on "yes" and 1 on "no".

Installation

Use prebuilt binaries

Binaries for a number of platforms are available on the release page.

Build from source

$ cargo +nightly install ask-cli

To install cargo, follow these instructions.

Usage

Ask the user a question:

$ ask Do you want to continue?
Do you want to continue? [Y/n] yes
$ echo $?
0

$ ask Do you want to continue?
Do you want to continue? [Y/n] n
$ echo $?
1

No runtime deps