Very Good CLI Documentation

repository·main·Indexed 25 days ago

https://github.com/verygoodopensource/very_good_cli

A command-line interface for Dart and Flutter development designed to accelerate project creation and management. Features include high-quality templates, dependency management via `very_good packages`, test optimization with the `test_optimizer` brick, and an experimental Model Context Protocol (MCP) server for AI assistant integration.

Tokens
21.1K
Snippets
65
Records
122
Agent score
79%

What's inside Very Good CLI

  1. Tutorials for Very Good CLI templates and commands

    main

    Very Good CLI provides several step-by-step tutorials for using its specialized templates and optimizing developer workflows. These include:

    Flutter Starter App (Core)

    • Core Template + Supabase: Build a Flutter app with Supabase as the backend.
    • Core Template + Stream: Build a location sharing chat app using the Stream Chat SDK.

    Specialized Templates

    • Flame Game: Generate a Flutter game powered by the Flame Game Engine.
    • Dart CLI: Create command-line applications using the Dart CLI template.
    • Plugin Template: Generate a plugin following a federated architecture.

    Developer Experience

    • Test Command: Learn how to run tests with performance optimizations and improved developer experience.
  2. Understand the generated .test_optimizer.dart structure

    main

    The test_optimizer brick generates a file named .test_optimizer.dart inside your test directory. This file is intended to be a single entrypoint that runs all tests in your package.

    Important Notes:

    • The file contains // GENERATED CODE - DO NOT MODIFY BY HAND.
    • It is recommended to add .test_optimizer.dart to your .gitignore.

    The generated code follows this pattern, importing test files as prefixed aliases and executing their main() functions within group blocks:

    // GENERATED CODE - DO NOT MODIFY BY HAND
    // Consider adding this file to your .gitignore.
    
    import 'app/view/app_test.dart' as _a;
    import 'counter/cubit/counter_cubit_test.dart' as _b;
    import 'counter/view/counter_page_test.dart' as _c;
    
    void main() {
      group('app_view_app_test_dart', () { _a.main(); });
      group('counter_cubit_counter_cubit_test_dart', () { _b.main(); });
      group('counter_view_counter_page_test_dart', () { _c.main(); });
    }
  3. Configure supported platforms for a Flutter plugin

    main

    By default, the flutter_plugin template enables all platforms. To restrict the plugin to specific platforms, use the --platforms option with a comma-separated list of supported platform identifiers.

    Supported platform values:

    • android
    • ios
    • web
    • macos
    • linux
    • windows
    # Create a new Flutter plugin named my_flutter_plugin (supports only android, iOS and web)
    very_good create flutter_plugin my_flutter_plugin --desc "My new Flutter plugin" --platforms android,ios,web
  4. Generate a Dart SPDX License enumeration

    main

    Use the spdx_license brick to generate a Dart enumeration of SPDX licenses. This command should be run from within your project root.

    Command Syntax:

    mason make spdx_license -o <output_directory> [--on-conflict=overwrite]

    Arguments & Flags:

    • -o <output_directory>: Specifies the directory where the generated code will be placed (e.g., lib/src/pub_license/).
    • --on-conflict=overwrite: Overwrites existing files if they already exist in the output directory.

    License Selection Behavior:

    • Default: If no licenses are specified via the prompt, the brick fetches the full list from the SPDX GitHub repository.
    • Custom: If you provide specific licenses during the prompt, only those user-specified licenses will be used, and the full SPDX list will not be fetched.
    mason make spdx_license -o lib/src/pub_license/ --on-conflict=overwrite
  5. Update App Icons using flutter_launcher_icons

    main

    Very Good Core uses separate icons for each flavor (development, staging, production). The recommended way to manage these is using the flutter_launcher_icons package, which automates icon generation from a single source image.

    Steps to configure:

    1. Install the package: Add flutter_launcher_icons to your dev_dependencies.
    2. Prepare source image: Place your icon (e.g., assets/icon/icon.png) in your project.
    3. Create flavor configurations: Create a dedicated YAML configuration file for each flavor: flutter_launcher_icons-development.yaml, flutter_launcher_icons-staging.yaml, and flutter_launcher_icons-production.yaml.
    4. Generate icons: Run the generation command for each flavor.
    5. Verify: Run the app using the corresponding flavor and target file to ensure icons are correct.
    # 1. Install
    flutter pub add --dev flutter_launcher_icons
    
    # 2. Generate for all flavors
    for flavor in production staging development; do
      dart run flutter_launcher_icons -f flutter_launcher_icons-${flavor}.yaml
    done
    
    # 3. Verify
    flutter run --flavor development --target lib/main_development.dart
    flutter run --flavor staging --target lib/main_staging.dart
    flutter run --flavor production --target lib/main_production.dart
  6. Install the Very Good CLI

    main

    To install the Very Good CLI globally using Dart, run the following command. If you need a specific version, append the version number to the end of the command.

    If the very_good command is not found in your terminal after installation, you may need to set up your system PATH as described in the Dart documentation.

    In environments where global activation is not possible (such as certain CI environments), you can execute commands using dart pub global run.

  7. Configure the Very Good CLI MCP Server for AI Assistants

    main

    To enable AI assistants to use Very Good CLI tools, add the very_good_cli server configuration to your specific tool's configuration file. The command and arguments are always command: "very_good" and args: ["mcp"].

    {
      "mcpServers": {
        "very_good_cli": {
          "command": "very_good",
          "args": ["mcp"]
        }
      }
    }
  8. Create a new Flutter project with Very Good Core

    main

    The very_good create flutter_app command generates a Flutter starter application following VGV best practices. You can specify a description, a custom organization name, a custom application ID, or use the current directory as the output.

    # Create a new Flutter app named my_app
    very_good create flutter_app my_app --desc "My new Flutter app"
    
    # Create a new Flutter app named my_app with a custom org
    very_good create flutter_app my_app --desc "My new Flutter app" --org "com.custom.org"
    
    # Create a new Flutter app named my_app with a custom application id
    very_good create flutter_app my_app --application-id "com.custom.app.id"
    
    # Create a new Flutter app named with the name of the current directory
    very_good create flutter_app .