Bosun is a library for building organized command line applications in Dart.

Overview

Bosun

A library for parsing CLI input and structuring CLI commands

Features

  • Structure CLI commands in a nice, uniform fashion.
  • Parse args and flag information from a command tree.
  • [EVENTUALLY] auto generate meaningful output when nonsensical commands are ran.
  • [EVENTUALLY] meaningful feature suggestions from you!

Getting started

Add Bosun to your dependencies. See example for more information. Additional information coming soon.

Usage

Bosun is simple to use! You'll leverage Bosun's Command class to structure your own commands. Additionally, you'll new up one BosunCommand and pass arguments to it. This is usually done directly in your main method, but doesnt have to be.

import 'package:bosun/bosun.dart';

class AppCmd extends Command {
  AppCmd() : super(command: 'app', description: 'run as an app shell');

  @override
  void run(List<String> args, Map<String, dynamic> flags) {
    print("in the app command callback");
  }
}

class RunCmd extends Command {
  RunCmd()
      : super(
            command: 'run',
            description: 'Run a command in a shell',
            subcommands: [AppCmd()]);

  @override
  void run(List<String> args, Map<String, dynamic> flags) {
    print("in the run command callback");
  }
}

void main(List<String> args) {
  execute(BosunCommand('donker', subcommands: [RunCmd()]), args);
}
You might also like...

A beautiful drawing view for a your flutter application with single line of code

A beautiful drawing view for a your flutter application with single line of code

Flutter Draw A beautiful drawing view for a your flutter application with single line of code. To start with this, we need to simply add the dependenc

Dec 26, 2022

A Flutter package for building custom skeleton widgets to mimic the page's layout while loading.

A Flutter package for building custom skeleton widgets to mimic the page's layout while loading.

Skeletons A Flutter package for building custom skeleton widgets to mimic the page's layout while loading. Examples Items ListView (Default) ListView

Dec 17, 2022

Building a Chat App with Firebase, Image Upload, Push Notifications

chat_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this

Nov 15, 2021

Experiment for building file system.

experiment_file_system A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you s

Nov 15, 2021

A Dice App for flutter beginners when building with State

dicee A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this is

Nov 15, 2021

We are building an open database of COVID-19 cases with chest X-ray or CT images.

We are building an open database of COVID-19 cases with chest X-ray or CT images.

🛑 Note: please do not claim diagnostic performance of a model without a clinical study! This is not a kaggle competition dataset. Please read this pa

Jan 7, 2023

Run asynchronous code before building your widget

Loader Sometimes you need to load some data before building your widget. Because initState doesn't support asynchronous loading you need to find anoth

Apr 17, 2022

Ready for Building Production-Ready Healthcare/ Doctor Consult Android and iOS app UI using Flutter.

Ready for Building Production-Ready Healthcare/ Doctor Consult Android and iOS app UI using Flutter.

Production-Ready Doctor Consultant App - Flutter UI Packages we are using: flutter_svg: link In this full series, we will show you how to Building Pro

Nov 28, 2022

Flutter SDK for building a realtime broadcaster using the Millicast platform

Flutter SDK for building a realtime broadcaster using the Millicast platform. This Software Development Kit (SDK) for Flutter allows developers to simplify Millicast services integration into their own Android and iOS apps.

Oct 29, 2022
Comments
  • feat: Create 'help' command

    feat: Create 'help' command

    Creates a simple 'help' command that will print out commands available given the current context.

    Executing 'help' without specifying a known command will show you the top level commands available.

    image

    Executing 'help' after a command will display the available subcommands.

    image

    enhancement question 
    opened by Daeluse 5
  • Need to support nested usecases with a default

    Need to support nested usecases with a default

    We're working on Steward's CLI and finding that we cant support both of the following:

    steward new App
    steward new controller MyController
    

    It would be ideal yo support this. To do this, I think we need to keep the previous match in memory until we dont have a match, then call the previous match with the remaining tokens as arguments. I dont think this should be bad to implement, but I could be wrong.

    bug enhancement good first issue 
    opened by bradcypert 1
  • Commands should allow you to specify which flags they support

    Commands should allow you to specify which flags they support

    I'm envisioning this as a a map Map<String, String> on the command that specifies the flags that are supported and a description of what they mean to that command.

    opened by bradcypert 1
  • Bosun command's run method should probably support async operations.

    Bosun command's run method should probably support async operations.

    There are a lot of opportunities to leverage async operations inside commands (HTTP requests, async file IO, etc). Not supporting this is doing a huge disservice to people building CLIs with Bosun.

    opened by bradcypert 0
Owner
null
A task manager app made with flutter where you can mark your tasks for specific days and keep your life organized!

task_manager_app A task manager app made with flutter where you can mark your tasks for specific days and keep your life organized! Getting Started Th

null 2 Sep 1, 2021
A command-line tool which simplifies the task of updating your Flutter app's launcher name

flutter_launcher_name A command-line tool which simplifies the task of updating your Flutter app's launcher name. If you user this package, You don't

null 44 Nov 13, 2022
A declarative library with an easy-to-use interface for building Flutter applications on AWS.

Amplify Flutter AWS Amplify provides a declarative and easy-to-use interface across different categories of cloud operations. Our default implementati

AWS Amplify 1.1k Jan 5, 2023
A guideline for building scalable Flutter applications.

Scalable flutter app You probably need to read this article before inspecting the repo's code. Building scalable Flutter apps (Architecture, Styling,

Nour El-Din Shobier 36 Nov 23, 2022
An application of learning outcomes from the Mastering Flutter 2.0 class: Building Travel and Aircraft Applications Buildwithangga

An application of learning outcomes from the Mastering Flutter 2.0 class: Building Travel and Aircraft Applications Buildwithangga

Latoe 2 Aug 29, 2022
building a timer application using the bloc library

flutter_timer A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if

Simon Wambua 0 Nov 4, 2021
Dart grocery store / cashier line simulation implementation

Grocery Store Cashier Line Simulation Quick Read Dart implementation of a grocery store cashier line simulation. $ dart bin/grocerysimulator.dart inpu

Danilo 0 Jan 13, 2022
Ping command utility app made with Flutter

Pinger Ping command utility app made with Flutter. Used libraries, tools and services: (some) community packages: mobx freezed injectable fl_chart Fir

Tomasz Wyrowiński 90 Nov 23, 2022
Dart HTTP server framework for building REST APIs. Includes PostgreSQL ORM and OAuth2 provider.

Aqueduct is a modern Dart HTTP server framework. The framework is composed of libraries for handling and routing HTTP requests, object-relational mapp

Stable Kernel 2.4k Jan 5, 2023
Advanced exception handling and logging for dart/flutter applications

Talker Advanced exception handling and logging for dart/flutter applications ?? Log your app actions, catch and handle your app exceptions and errors

Stanislav Ilin 103 Dec 27, 2022