Skip to content
pubscout

capp

2.3.2, released 5 weeks ago by finchdart.com

A Dart package for building interactive console applications with widgets, input handling, and progress indicators.

$ flutter pub add capp
Source repository

What it does

Capp provides a set of console widgets such as tables, progress bars, spinners, and input prompts. It also manages command-line arguments, options, and automatic help generation, allowing developers to create rich CLI tools in Dart.

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

Use it when

  • Need to build a command-line tool with interactive prompts
  • Want built-in progress indicators and table output
  • Require automatic help generation for commands
  • Need to capture or hook into console output for logging or testing

Skip it when

  • Building a GUI or web application
  • Requiring cross-platform mobile UI
  • Working in environments without a terminal

Strengths

  • Rich set of console widgets out of the box
  • Built-in argument and option management
  • Automatic help generation
  • Support for capturing console output via hooks

Weaknesses

  • Limited to console environments
  • No support for graphical UI
  • Not a state-management or networking library

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0

Add "capp: ^2.3.2" to pubspec and import package:capp/capp.dart

import "package:capp/capp.dart";

void main() {
  var app = CappManager(
    main: CappController(
      '',
      options: [CappOption(name: 'help', shortName: 'h', description: 'Show help')],
      run: (c) async {
        if (c.existsOption('help')) {
          return CappConsole(c.manager.getHelp());
        }
        return CappConsole('Hello, world!');
      },
    ),
    args: [],
    controllers: [],
  );
  app.process();
}

Alternatives

Packages that do the same job and could replace capp.

  • yaml

    For parsing YAML configuration files, not a direct replacement for console widgets

  • clock

    For time utilities, not a replacement for console UI

Works with

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