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.
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.
Works with
Packages commonly used together with cli_util: ones it builds on, ones built on it, and its own family.
- fficli_util depends on itUtilities for working with Foreign Function Interface (FFI) code in Dart.
- cli_configSame familyLibrary to read config from CLI args, env vars, and JSON/YAML files
- coverageBuilt on cli_utilCollects, manipulates, and formats code coverage data in Dart
- vector_graphics_compilerBuilt on cli_utilA compiler to convert SVGs to the binary format used by package:vector_graphics.
- flutter_launcher_iconsBuilt on cli_utilSimplifies the task of updating your Flutter app's launcher icon across platforms.
- melosBuilt on cli_utilA tool for managing Dart and Flutter monorepos with script execution, versioning, and publishing.
- drift_devBuilt on cli_utilGenerates Dart database code from Drift table definitions as a dev‑dependency.
- ffigenBuilt on cli_utilGenerator for FFI bindings, using LibClang to parse C, Objective-C, and Swift files.