Skip to content
pubscout

prompts

2.0.0, released 5 years ago by an unverified publisher

Synchronous command-line prompt library for Dart with pretty colors.

Repository archived
$ flutter pub add prompts
Source repository

What it does

Provides synchronous utility functions to get user input, booleans, integers, passwords, and choices from the command line. Supports default values, multiline input, and validation.

AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are building a command-line interface (CLI) tool in Dart
  • You need synchronous user input prompts with validation and default values

Skip it when

  • You are building a Flutter GUI application
  • You need asynchronous event-driven streams for inputs

Strengths

  • Simple and synchronous API
  • Supports default values, multiline input, and ANSI colors
  • Built-in methods for booleans, integers, and choice selection

Weaknesses

  • Interactive selection is completely disabled on Windows
  • Synchronous blocking calls are not suitable for async event loops

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
2
import 'package:prompts/prompts.dart' as prompts;

void main() {
  var name = prompts.get('Enter your name');
  print('Hello, $name!');
}

Alternatives

Packages that do the same job and could replace prompts.

  • cli_util

    Utilities to help build Dart command-line apps, find the SDK, and display progress.

  • git

    Git command line wrapper for inspecting and manipulating local Git repositories.

  • dart_console

    A helper library for command-line applications requiring advanced control over input/output.

  • cli_completion

    Completion functionality for Dart Command-Line Interfaces built using CommandRunner.

Works with

Packages commonly used together with prompts: ones it builds on, ones built on it, and its own family.