The repo contains a collection of packages that will assist you in developing CLI applications in Dart. Please feel free to update this list as there may be packages that I am unaware of.
Generate a Dart CLI with Very Good CLI. If you are making a CLI package for the first time this is the needed tool for you. They also have pretty good documentation about using this template.
The package is more than just a logger and allows you to accept user inputs and will help you to build lot of other cool things.
Some feature are:
- Show progress to user.
- Allows users to select from different options.
- Prompts to accept user inputs.
This library lets you define parsers for parsing raw command-line arguments into a set of options and values using GNU and POSIX style options.
note: If you are using very_good_cli then by default this package will be included in the boilerplate.
A Dart package which enables checking whether packages are up to date and supports updating them. Intended for use in CLIs for prompting users to auto-update.
Simple package for parsing pubspec.yaml files with a type-safe API and rich error reporting. You may not be able to find the documentation in their README. I am adding a snippet that will helpe you to use this package.
final rawString = await rootBundle.loadString("pubspec.yaml");
final pubspec = Pubspec.parse(rawString);
This library contains a variety of useful functions for console application development, including:
- Reading the current window dimensions (height, width)
- Reading and setting the cursor location
- Setting foreground and background colors
- Manipulating the console into "raw mode", which allows more advanced keyboard input processing than the default dart:io library.
- Reading keys and control sequences from the keyboard
- Writing aligned text to the screen
- Tabular data display, including month calendar
The example folder of this pacakge contains all the necessary implementations to understand the pacakge.
Dart package that aims to enable Dart CLI applications to receive shell completions with minimal setup. This package helps you to enhance the user experiance of your CLI tools.
It works on bash and zsh on Linux, macOS, and Windows.
Parses raw command-line arguments into a set of options and values. This library supports GNU and POSIX style options, and it works in both server-side and client-side apps.
In particular, cli_util provides a simple, standardized way to get the current SDK directory. Useful, especially, when building client applications that interact with the Dart SDK
This package can also be used to help CLI tools display output and progress. It has a logging mechanism which can help differentiate between regular tool output and error messages, and can facilitate having a more verbose (-v) mode for output.
In addition, it can display an indeterminate progress spinner for longer running tasks, and optionally display the elapsed time when finished: