Skip to content
pubscout

cli_tools

0.14.0, released 5 days ago by serverpod.dev

Utilities for building command‑line interfaces, including argument parsing, analytics, and progress reporting.

$ flutter pub add cli_tools
Source repository

What it does

Provides a set of helper libraries for CLI applications such as a configurable command runner, analytics base class, and progress display. It also includes experimental command‑line completion support. The package is framework‑agnostic and can be used in any Dart project.

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

Use it when

  • You need a ready‑made command runner with built‑in analytics and progress UI for a Dart CLI tool
  • You want easy integration of command‑line completion and configurable logging

Skip it when

  • You are building a GUI or web app
  • You require a full‑featured CLI framework with sub‑command scaffolding beyond what this package offers

Strengths

  • Simple, opinionated API for common CLI needs
  • Built‑in analytics flushing and progress streams
  • Experimental completion support

Weaknesses

  • Limited to command‑line use; no UI components
  • Breaking changes in recent versions may require migration

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
9
import 'package:cli_tools/cli_tools.dart';

void main() async {
  final runner = BetterCommandRunner('my_cli', 'Example CLI');
  runner.addCommand(EchoCommand());
  await runner.run(arguments);
}

class EchoCommand extends Command {
  @override final name = 'echo';
  @override final description = 'Prints the given text.';
  EchoCommand() { argParser.addOption('text', abbr: 't'); }
  @override void run() => print(argResults!['text']);
}

Alternatives

Packages that do the same job and could replace cli_tools.

  • cli_util

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

  • cli_completion

    Completion functionality for Dart Command-Line Interfaces built using CommandRunner.

  • dart_style

    Provides an API and CLI to format Dart source code automatically.

  • git

    Git command line wrapper for inspecting and manipulating local Git repositories.

Works with

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