An open API service indexing awesome lists of open source software.

https://github.com/anhoder/colorful_cmd

A library for quickly building command-line applications by dart.
https://github.com/anhoder/colorful_cmd

color command command-line-app console cross-platform dart dart-library dartlang notifier notify progress progress-bar ubuntu window

Last synced: over 1 year ago
JSON representation

A library for quickly building command-line applications by dart.

Awesome Lists containing this project

README

          

A library for building a beautiful command line application in dart.

![GitHub repo size](https://img.shields.io/github/repo-size/anhoder/colorful_cmd)
![GitHub](https://img.shields.io/github/license/anhoder/colorful_cmd)
![Last Tag](https://badgen.net/github/tag/anhoder/colorful_cmd)
![GitHub last commit](https://badgen.net/github/last-commit/anhoder/colorful_cmd)

![Support](https://badgen.net/pub/dart-platform/colorful_cmd)
![Pub Version](https://img.shields.io/pub/v/colorful_cmd)

![GitHub stars](https://img.shields.io/github/stars/anhoder/colorful_cmd?style=social)
![GitHub forks](https://img.shields.io/github/forks/anhoder/colorful_cmd?style=social)

## Dependency

* console
* args

## Preview

### Diff OS

* Ubuntu
![Ubuntu](./example/preview/ubuntu.png)
* Windows
![Windows](./example/preview/windows.png)
* Mac
![Mac](./example/preview/mac.png)

### ColorText

![ColorText](./example/preview/color_text.png)

### Command

![Command](./example/preview/command.png)

### RainbowProgress

![RainbowProgress](./example/preview/rainbow_progress.png)

### WindowUI

![WindowUI](./example/preview/window_ui.png)
![WindowUI2](./example/preview/window_ui2.png)

## Usage

A simple usage example:

```dart
import 'package:dart_command/command.dart';
import 'package:dart_command/logger.dart';

void main(List args) {
var kernel = ConsoleKernel();
kernel.addCommands([RootCommand()])
.run(args);
}

class RootCommand extends ICmd {

@override
String name = 'root';

@override
String description = 'root command, without group';

@override
List get flags => null;

@override
List get logHandlers => null;

@override
List get options => null;

@override
void run() {
warning(description);
var colorText = ColorText();
colorText
.gold('\n\n\ngold\n')
.green('green\n')
.blue('blue\n')
.cyan('cyan\n')
.darkBlue('darkBlue\n')
.darkRed('darkRed\n')
.gray('gray\n')
.lightCyan('lightCyan\n')
.lightGray('lightGray\n')
.lightMagenta('lightMagenta\n')
.lime('lime\n')
.magenta('magenta\n')
.red('red\n')
.white('white\n')
.black('black\n')
.yellow('yellow\n')
.print();
}
}
```

**For more examples, see the example folder.**