Skip to content
pubscout

cli_util

0.6.0, released 3 months ago by tools.dart.dev

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

$ flutter pub add cli_util
Source repository

What it does

Provides helper functions to locate the Dart SDK and executable directories, manage application configuration directories, and output rich text and progress spinners to the CLI.

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

Use it when

  • You are building a command-line application in Dart
  • You need to locate the Dart SDK or application settings path from code
  • You want to display standard or verbose logging and progress indicators in the terminal

Skip it when

  • You are building a Flutter GUI or mobile application
  • You do not need command-line specific utilities or logging

Strengths

  • Simplifies locating the Dart SDK across various execution contexts
  • Built-in logging mechanisms supporting standard and verbose modes
  • Includes progress indicators and spinners for long-running tasks

Weaknesses

  • Limited applicability outside of command-line tools

Setup

Kind
FFI (native library)
Effort
Low
Code generation
No
Direct dependencies
3
import 'package:cli_util/cli_logging.dart';

void main(List<String> args) async {
  var logger = Logger.standard();
  var progress = logger.progress('doing some work');
  await Future.delayed(Duration(seconds: 2));
  progress.finish(showTiming: true);
  logger.stdout('All done.');
}

Alternatives

Packages that do the same job and could replace cli_util.

  • args

    If you specifically need command-line argument and option parsing.

  • io

    If you need core Dart I/O utilities rather than CLI-specific helpers.

Works with

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