promptly 1.0.0-alpha.8 copy "promptly: ^1.0.0-alpha.8" to clipboard
promptly: ^1.0.0-alpha.8 copied to clipboard

A collection of customizable interactive command-line components.

promptly

Developed by 🦏 zoocityboy

Pub pub points release Coverage License: MIT

Dart

Important

This project is currently in pre-production. Breaking changes may occur. Use with caution.

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.

class MyRunner extends CommandRunner {
  MyRunner(super.executableName, super.description, {super.version, super.theme, super.logLevel, super.printer}) {
    addCommand(TestCommand());
    addCommand(SecondCommand());
    addCommand(ThirdCommand());
    addCommand(ThirdoCommand());
    addCommand(ThirmoCommand());
  }
}
Future<void> main(List<String> args) => MyRunner(
    'promptly',
    'Runner test',
    version: '0.0.1',
    theme: Theme.defaultTheme,
    // printer: defaultPrinter,
  ).safeRun(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.