Skip to content
pubscout

dcli

10.4.7, released 3 weeks ago by onepub.dev

A Dart SDK for building cross‑platform command line applications and scripts.

$ flutter pub add dcli
Source repository

What it does

Provides APIs for creating CLI tools, handling arguments, I/O, compilation to native executables, and remote deployment. Includes utilities like ask, file handling, and system interactions.

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

Use it when

  • You need to write a Dart based CLI tool or script.
  • You want to compile Dart scripts into single‑file executables.
  • Cross‑platform console apps are required (Windows, macOS, Linux).

Skip it when

  • You only need simple shell commands without a Dart runtime.
  • You require a GUI or Flutter widget library.

Strengths

  • Cross‑platform support with native compilation.
  • Rich set of console utilities (prompt, file ops, permissions).
  • Integrates with Dart's ecosystem and null‑safety.

Weaknesses

  • Relies on Dart SDK; adds size overhead for compiled binaries.
  • Limited to console use; not suitable for UI or web.

Setup

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

void main() {
  var name = ask('name:', required: true, validator: Ask.alpha);
  print('Hello $name');
}

Alternatives

Packages that do the same job and could replace dcli.

  • ansix

    Provides ANSI color, text styling, grid, and tree view tools for Dart and Flutter.

  • cli_script

    Write shell-like scripts in Dart with support for subprocesses, pipelining, and streams.

Works with

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