Skip to content

LokaHQ/loka_flutter_cli

 
 

Repository files navigation

Loka Flutter CLI

Loka

Developed with 💙 by Loka

ci coverage style: very good analysis


Loka Command-Line Interface for Dart/Flutter.

Installing

dart pub global activate -sgit https://github.com/LokaHQ/loka_flutter_cli

Commands

loka_flutter create

Create a project in seconds based on the provided template. The Loka Core template is used by default.

Loka Create

Creates a new project in the specified directory.

Usage: loka_flutter create <project name>
-h, --help                    Print this usage information.
-o, --output-directory        The desired output directory when creating a new project.
    --desc                    The description for this new project.
                              (defaults to "Project created by Loka CLI.")
    --executable-name         Used by the dart_cli template, the CLI executable name (defaults to the project name)
    --org-name                The organization for this new project.
                              (defaults to "com.example.lokacore")
-t, --template                The template used to generate this new project.

          [core] (default)    Generate a Loka Flutter application.
          [dart_cli]          Generate a Loka Dart CLI application.
          [dart_pkg]          Generate a reusable Dart package.
          [flutter_pkg]       Generate a reusable Flutter package.
          [flutter_plugin]    Generate a reusable Flutter plugin.

    --android                 The plugin supports the Android platform.
                              (defaults to "true")
    --ios                     The plugin supports the iOS platform.
                              (defaults to "true")
    --web                     The plugin supports the Web platform.
                              (defaults to "true")
    --linux                   The plugin supports the Linux platform.
                              (defaults to "true")
    --macos                   The plugin supports the macOS platform.
                              (defaults to "true")
    --windows                 The plugin supports the Windows platform.
                              (defaults to "true")

Usage

# Create a new Flutter app named my_app
loka_flutter create my_app --desc "My new Flutter app"

# Create a new Flutter app named my_app with a custom org
loka_flutter create my_app --desc "My new Flutter app" --org "com.custom.org"

# Create a new Flutter package named my_flutter_package
loka_flutter create my_flutter_package -t flutter_pkg --desc "My new Flutter package"

# Create a new Dart package named my_dart_package
loka_flutter create my_dart_package -t dart_pkg --desc "My new Dart package"

# Create a new Dart CLI application named my_dart_cli
loka_flutter create my_dart_cli -t dart_cli --desc "My new Dart CLI package"

# Create a new Dart CLI application named my_dart_cli with a custom executable name
loka_flutter create my_dart_cli -t dart_cli --desc "My new Dart CLI package" --executable-name my_executable_name

# Create a new Flutter plugin named my_flutter_plugin (all platforms enabled)
loka_flutter create my_flutter_plugin -t flutter_plugin --desc "My new Flutter plugin"

# Create a new Flutter plugin named my_flutter_plugin (some platforms disabled)
loka_flutter create my_flutter_plugin -t flutter_plugin --desc "My new Flutter plugin" --windows false --macos false --linux false

What's Included in Loka Core? 📦

Out of the box, Loka Core includes:

✅  Cross Platform Support - Built-in support for iOS, Android, Web, and Windows (MacOS/Linux coming soon!)

✅  Build Flavors - Multiple flavor support for development, staging, and production

✅  Internationalization Support - Internationalization support using synthetic code generation to streamline the development process

✅  Sound Null-Safety - No more null-dereference exceptions at runtime. Develop with a sound, static type system.

✅  Bloc - Integrated bloc architecture for scalable, testable code which offers a clear separation between business logic and presentation

✅  Testing - Unit and Widget Tests with 100% line coverage (Integration Tests coming soon!)

✅  Logging - Built-in, extensible logging to capture uncaught Flutter and Dart Exceptions

✅  Very Good Analysis - Strict Lint Rules which are used at Loka

✅  Continuous Integration - Lint, format, test, and enforce code coverage using GitHub Actions


loka_flutter packages get

Get packages in a Dart or Flutter project.

# Install packages in the current directory
loka_flutter packages get

# Install packages in ./some/other/directory
loka_flutter packages get ./some/other/directory

# Install packages recursively
loka_flutter packages get --recursive

# Install packages recursively (shorthand)
loka_flutter packages get -r

Complete Usage

Get packages in a Dart or Flutter project.

Usage: loka_flutter packages get [arguments]
-h, --help         Print this usage information.
-r, --recursive    Install dependencies recursively for all nested packages.

Run "loka_flutter help" to see global options.

loka_flutter test

Run tests in a Dart or Flutter project.

# Run all tests
loka_flutter test

# Run all tests and collect coverage
loka_flutter test --coverage

# Run all tests and enforce 100% coverage
loka_flutter test --coverage --min-coverage 100

# Run only tests in ./some/other/directory
loka_flutter test ./some/other/directory

# Run tests recursively
loka_flutter test --recursive

# Run tests recursively (shorthand)
loka_flutter test -r

Complete Usage

Run tests in a Dart or Flutter project.

Usage: loka_flutter test [arguments]
-h, --help                            Print this usage information.
    --coverage                        Whether to collect coverage information.
-r, --recursive                       Run tests recursively for all nested packages.
    --[no-]optimization               Whether to apply optimizations for test performance.
                                      (defaults to on)
    --exclude-coverage                A glob which will be used to exclude files that match from the coverage.
-x, --exclude-tags                    Run only tests that do not have the specified tags.
    --min-coverage                    Whether to enforce a minimum coverage percentage.
    --test-randomize-ordering-seed    The seed to randomize the execution order of test cases within test files.
    --update-goldens                  Whether "matchesGoldenFile()" calls within your test methods should update the golden files.

Run "loka_flutter help" to see global options.

loka_flutter --help

See the complete list of commands and usage information.

 Loka Command-Line Interface

Usage: loka_flutter <command> [arguments]

Global options:
-h, --help           Print this usage information.
    --version        Print the current version.
    --analytics      Toggle anonymous usage statistics.

          [false]    Disable anonymous usage statistics
          [true]     Enable anonymous usage statistics

Available commands:
  create     loka_flutter create <output directory>
             Creates a new project in the specified directory.
  packages   Command for managing packages.
  test       Run tests in a Dart or Flutter project.

Run "loka_flutter help <command>" for more information about a command.

About

A Command-Line Interface for Dart

Resources

Stars

Watchers

Forks

Languages

  • Dart 99.7%
  • Shell 0.3%