Skip to content

zoocityboy/promptly

Repository files navigation

promptly

Developed by 🦏 zoocityboy

Pub pub points release Coverage License: MIT

Dart

Documentation

Features

  • Argument parser
  • CommandRunner, Command definition
  • Command flow components
  • Process helpers (executors)
  • Tracing, Logging
  • Themable

Command Runner

A simple way to write command-line applications in Dart with styling and command loading capabilities.

Future<void> main(List<String> args) async {
  (await Promptly.init('app','MyAppDescription', theme: Theme.make(Theme.defaultColors)))
    ..addCommand(TestCommand())
    ..addCommand(SecondCommand())
    ..addCommand(ThirdCommand());
  .run(args);
}

Components

A collection of customizable interactive command-line components.

The library contains a bunch of command-line components that are easy to use and customizable, including text and password inputs, radio or select inputs, checkbox or multiple select inputs, spinners, and progress bars. Examples for all the available components can be found in the example folder, and the API Documentation section will cover all about them.

As an overview, you can make a Select component like this.

final languages = ['Rust', 'Dart', 'TypeScript'];
final selection = selectOne<String>(
  'Your favorite programming language',
  options: languages,

);

print('${languages[selection]}');

It will result in something like this,

Demo


Installation

Install the latest version of Promptly as a dependency as shown in pub.dev.


API Documentation

Components

These are the snippets of components with their properties and arguments. Check the pub documentation to get to know more about them in detail.


## License

This project is licensed under the MIT License as provided in the original repository.