cli_completion 0.3.0 icon indicating copy to clipboard operation
cli_completion: ^0.3.0 copied to clipboard

Completion functionality for Dart Command-Line Interfaces built using CommandRunner. Built by Very Good Ventures.

CLI Completion #

Very Good Ventures

ci coverage pub package style: very good analysis License: MIT


screen

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

Developed with πŸ’™ by Very Good Ventures πŸ¦„

Installation πŸ’» #

❗ In order to start using CLI Completion you must have the Dart SDK installed on your machine.

flutter pub add cli_completion

Usage ✨ #

On your CommandRunner class, extend CompletionCommandRunner :

import 'package:cli_completion/cli_completion.dart';

class ExampleCommandRunner extends CompletionCommandRunner<int> {
...

This will make the first command run to install the completion files automatically. To disable that behavior, set enableAutoInstall to false:

class ExampleCommandRunner extends CompletionCommandRunner<int> {
  
  @override
  bool get enableAutoInstall => false;
...

When enableAutoInstall is set to false, users will have to call install-completion-files to install these files manually.

$ example_cli install-completion-files

Documentation πŸ“ #

For an overview of how this package works, check out the documentation.


⚠️ Using analytics #

Handling completion requests should be straightforward.

If there are any checks (like analytics, telemetry, or anything that you may have on run or runCommand overrides) before running subcommands, make sure you fast track the completion command to skip all of the unnecessary computations.

Example:

@override
Future<int?> runCommand(ArgResults topLevelResults) async {
  if (topLevelResults.command?.name == 'completion') {
    super.runCommand(topLevelResults);
      return;
  }
  // ... analytics and other unrelated stuff 
23
likes
140
pub points
89%
popularity
screenshot
image

Publisher

verified publisher iconverygood.ventures

Completion functionality for Dart Command-Line Interfaces built using CommandRunner. Built by Very Good Ventures.

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

args, equatable, mason_logger, meta, path

More

Packages that depend on cli_completion