flg 1.2.2 copy "flg: ^1.2.2" to clipboard
flg: ^1.2.2 copied to clipboard

A CLI tool for generating Flutter projects with Clean Architecture, feature-first organization, and modern state management (Riverpod, Bloc, Provider).

Changelog #

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

1.2.2 - 2026-01-29 #

Documentation #

  • Fixed MCP global configuration to use flg_mcp executable directly
    • Global config now uses flg_mcp command (installed via dart pub global activate flg)
    • Per-project config can use either global flg_mcp or dart run flg:flg_mcp as dev dependency
    • Added PATH configuration note for pub-cache bin

1.2.1 - 2026-01-29 #

Documentation #

  • Expanded MCP integration documentation in README
    • Added clear instructions for global vs per-project configuration
    • Added Gemini CLI configuration examples alongside Claude Code
    • Added CLI commands (claude mcp add, gemini mcp add) for easy setup
    • Added flg_init tool to the MCP tools table
    • Added usage examples showing natural language interactions
    • Added verification commands for both AI assistants

1.2.0 - 2026-01-29 #

Added #

  • flg_init MCP tool - Create Flutter projects directly from Claude Code

    • Automatically triggered when users ask to "create a Flutter project"
    • Replaces need for flutter create when FLG is available
    • Supports all flg init options: state management, router, organization
  • ValidationUtils - New security validation module

    • validatePath() - Prevents path traversal attacks
    • validateProjectName() - Enhanced validation with reserved names check
    • validateTaskName() - Safe alphanumeric validation for git worktrees
    • validateBranchName() - Git-compliant branch name validation
    • sanitizeForConsole() - Removes ANSI escape codes and control characters

Security #

  • Fixed path traversal vulnerability in MCP flg_info tool
  • Added input validation to all MCP tool handlers
  • Added branch name validation in GitService before git operations
  • Added task name validation in TaskCommand to prevent directory escape
  • Enhanced project name validation with reserved names and length limits
  • Use path.join() instead of string interpolation for file paths

Changed #

  • MCP server instructions now explicitly guide Claude to use FLG for Flutter project creation
  • Skill description updated to indicate proactive usage for project creation

1.1.0 - 2026-01-29 #

Added #

  • task command (alias: t) - Manage git worktrees for AI agent workflows

    • task add <name> - Create a new task worktree with a dedicated branch
      • --type (-t): Branch prefix (feat, fix, ref) - default: feat
      • --agent (-a): Setup for AI agent (runs flutter pub get, creates .claude/TASK.md)
      • --base (-b): Base branch to create from - default: main
      • --dry-run: Preview without creating files
    • task list (alias: ls) - List all active task worktrees
    • task remove (alias: rm) - Remove a task worktree
      • --force (-f): Force remove even with uncommitted changes
      • --keep-branch: Keep the branch after removing worktree
    • task status (alias: st) - Show status dashboard with commits ahead/behind
  • GitService - New service for git operations (worktrees, branches, status)

  • TaskInfo model - Data model for task worktree information

Technical Details #

  • Worktrees are created in ../[project-name]-tasks/ as sibling directories
  • Branch naming convention: {type}/{name} (e.g., feat/auth-feature)
  • AI agent setup creates .claude/TASK.md template for task context

1.0.0 - 2026-01-28 #

Added #

  • init command - Create new Flutter projects with Clean Architecture

    • Interactive configuration prompts
    • Support for Riverpod (with @riverpod annotation), Bloc, and Provider
    • Support for GoRouter and AutoRoute
    • Optional Freezed integration with sealed class syntax
    • Optional Dio HTTP client
    • Multi-platform support (Android, iOS, Web, macOS, Windows, Linux)
    • Localization (l10n) support
    • Automatic build_runner execution after project creation
  • setup command - Configure flg in existing Flutter projects

    • Detects existing pubspec.yaml and extracts project name
    • Adds required dependencies automatically
    • Creates Clean Architecture directory structure
    • Generates core files (exceptions, failures, usecase base, router)
    • Optional initial feature generation
    • Runs pub get and build_runner automatically
  • generate command with subcommands:

    • feature (alias: f) - Generate complete feature modules
    • screen (alias: s) - Generate screen widgets
    • widget (alias: w) - Generate widgets (stateless, stateful, card, list_tile, form)
    • provider (alias: p) - Generate providers/notifiers/blocs
    • usecase (alias: u) - Generate use cases (single or CRUD)
    • repository (alias: r) - Generate repositories with data sources
  • Core templates:

    • Exceptions and Failures classes
    • Base UseCase classes with Either<Failure, T> pattern
    • App Router configuration (GoRouter or AutoRoute)
    • Main.dart with state management setup
  • Feature templates:

    • Entity classes with Equatable
    • Repository interfaces
    • Model classes with Freezed sealed class syntax
    • Repository implementations
    • Remote data sources (Dio or http)
    • Riverpod notifiers using @riverpod annotation with code generation
    • Bloc classes with events and states
    • Provider classes with ChangeNotifier
    • Screen widgets with state management integration
    • Widget templates (card, list tile, form)
  • Configuration:

    • flg.json file for project settings persistence
    • Automatic configuration detection in existing projects
  • Developer experience:

    • --dry-run flag to preview changes without creating files
    • --verbose flag for detailed output
    • --no-color flag for CI/CD environments
    • Colored console output with progress indicators

Technical Details #

  • Written in pure Dart with no Flutter dependency
  • Uses absolute package imports (package:project_name/...)
  • Modern Riverpod with riverpod_annotation and code generation
  • Modern Freezed with sealed class syntax
  • Comprehensive test suite (81 tests)
2
likes
140
points
266
downloads

Publisher

unverified uploader

Weekly Downloads

A CLI tool for generating Flutter projects with Clean Architecture, feature-first organization, and modern state management (Riverpod, Bloc, Provider).

Repository (GitHub)
View/report issues

Topics

#cli #flutter #clean-architecture #code-generator #scaffolding

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

args, dart_mcp, path, recase, yaml

More

Packages that depend on flg