git404hub

what is prompts fr?

terkelg/prompts — explained in plain English

Analysis updated 2026-06-24

9,275JavaScriptAudience · developerComplexity · 2/5Setup · easy

tl;dr

A lightweight Node.js library for adding interactive questions to command-line tools, text, multiple choice, date pickers, autocomplete, with built-in support for injecting answers in automated tests.

vibe map

mindmap
  root((repo))
    What It Does
      Interactive CLI prompts
      Collect user answers
      Return answer object
    Input Types
      Text and numbers
      Single or multi select
      Date picker
      Autocomplete
    Features
      Answer injection
      Dynamic prompt chains
      No big dependencies
    Use Cases
      Setup wizards
      Automated testing
      Branching questions
    Audience
      CLI tool developers
      Node.js developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Build a CLI setup wizard that asks users for project name, language, and options before generating files.

VIBE 2

Test a CLI tool without keyboard interaction by injecting pre-supplied answers programmatically.

VIBE 3

Create a branching questionnaire where follow-up questions only appear based on how the user answered a previous one.

VIBE 4

Add input validation to any prompt so users must provide a valid answer before the script continues.

what's the stack?

JavaScriptNode.js

how it stacks up fr

terkelg/promptsjsx-eslint/eslint-plugin-reactanvaka/city-roads
Stars9,2759,2809,269
LanguageJavaScriptJavaScriptJavaScript
Setup difficultyeasyeasyeasy
Complexity2/52/52/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · easy time til it works · 5min
License not mentioned in the explanation.

in plain english

Prompts is a Node.js library for building interactive command-line interfaces. When you run a command-line tool and it asks you to type something, choose from a list, or confirm a choice before continuing, that interaction is usually powered by a library like this one. Prompts handles the input and display so developers do not have to write that logic from scratch. The library supports a range of input types: plain text, numbers, passwords, yes or no confirmations, single selections from a list, multiple selections from a list, date pickers, and autocomplete fields. Each prompt type is self-contained, so you can use just the ones you need. Prompts are defined as plain JavaScript objects with properties like the question text, the type of input expected, and optional validation logic. You pass one prompt or a list of prompts to the main function and it returns an object containing all the user's answers. One notable feature is programmatic injection, where you can pre-supply answers in code. This is intended for automated testing: instead of having a test script interact with the terminal manually, you inject the expected answers ahead of time and the prompts resolve without waiting for keyboard input. The library also supports dynamic prompt chains, where whether a particular question appears at all can depend on how the user answered a previous one. This is useful for wizards or setup flows where some follow-up questions are only relevant in certain situations. Prompts has no large dependencies and works with modern JavaScript async syntax. It supports Node 14 and above and is installed via npm. It is designed for developers building command-line tools who want to add interactive input collection without taking on a heavyweight dependency.

prompts (copy fr)

prompt 1
Build a Node.js CLI setup wizard using the prompts library that asks for project name, framework choice, and whether to add TypeScript, then logs the result.
prompt 2
How do I inject answers programmatically into prompts for automated testing so the script doesn't wait for keyboard input?
prompt 3
Create a dynamic prompts chain where a follow-up question only appears if the user selects yes to the previous one.
prompt 4
Add validation to a prompts text field so users can't submit an empty string or an invalid email address.
prompt 5
How do I collect answers from multiple prompts at once and use the result object to generate a config file?

Frequently asked questions

what is prompts fr?

A lightweight Node.js library for adding interactive questions to command-line tools, text, multiple choice, date pickers, autocomplete, with built-in support for injecting answers in automated tests.

What language is prompts written in?

Mainly JavaScript. The stack also includes JavaScript, Node.js.

What license does prompts use?

License not mentioned in the explanation.

How hard is prompts to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is prompts for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.