https://github.com/zoocityboy/promptly
Dart CLI interactive console
https://github.com/zoocityboy/promptly
cli dartlang interactive
Last synced: about 1 year ago
JSON representation
Dart CLI interactive console
- Host: GitHub
- URL: https://github.com/zoocityboy/promptly
- Owner: zoocityboy
- License: mit
- Created: 2024-12-28T20:52:14.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-20T05:10:45.000Z (about 1 year ago)
- Last Synced: 2025-05-20T06:23:14.711Z (about 1 year ago)
- Topics: cli, dartlang, interactive
- Language: Dart
- Homepage: https://pub.dev/packages/promptly/
- Size: 7 MB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README

Developed by 🦏 [zoocityboy](https://zoocityboy.github.io/)
[](https://pub.dev/packages/promptly)
[](https://pub.dev/packages/promptly/score)
[](https://github.com/zoocityboy/promptly/actions/workflows/release.yaml)
[](https://github.com/zoocityboy/promptly/actions/workflows/pull-request.yml)
[](https://opensource.org/licenses/MIT)

> [!IMPORTANT]
> This project is currently in pre-production. Breaking changes may occur. Use with caution.
[Documentation](https://zoocityboy.github.io/promptly/)
## Features
- [x] Argument parser
- [x] CommandRunner, Command definition
- [x] Command flow [components](#components)
- [x] Process helpers (executors)
- [x] Tracing, Logging
- [x] Themable
### Command Runner
A simple way to write command-line applications in Dart with styling and command loading capabilities.
```dart
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 main(List 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](#api-documentation) section will cover all about them.
As an overview, you can make a `Select` component like this.
```dart
final languages = ['Rust', 'Dart', 'TypeScript'];
final selection = selectOne(
'Your favorite programming language',
options: languages,
);
print('${languages[selection]}');
```
It will result in something like this,

## Installation
Install the latest version of Promptly as a dependency as shown in [pub.dev](https://pub.dev/packages/promptly).
## API Documentation
### Components
These are the snippets of components with their properties and arguments. Check the [pub documentation](https://pub.dev/documentation/promptly/latest/) to get to know more about them in detail.
## License
This project is licensed under the [MIT License](LICENSE) as provided in the original repository.