flg 1.2.2
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_mcpexecutable directly- Global config now uses
flg_mcpcommand (installed viadart pub global activate flg) - Per-project config can use either global
flg_mcpordart run flg:flg_mcpas dev dependency - Added PATH configuration note for pub-cache bin
- Global config now uses
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_inittool 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_initMCP tool - Create Flutter projects directly from Claude Code- Automatically triggered when users ask to "create a Flutter project"
- Replaces need for
flutter createwhen FLG is available - Supports all
flg initoptions: state management, router, organization
-
ValidationUtils- New security validation modulevalidatePath()- Prevents path traversal attacksvalidateProjectName()- Enhanced validation with reserved names checkvalidateTaskName()- Safe alphanumeric validation for git worktreesvalidateBranchName()- Git-compliant branch name validationsanitizeForConsole()- Removes ANSI escape codes and control characters
Security #
- Fixed path traversal vulnerability in MCP
flg_infotool - Added input validation to all MCP tool handlers
- Added branch name validation in
GitServicebefore git operations - Added task name validation in
TaskCommandto 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 #
-
taskcommand (alias:t) - Manage git worktrees for AI agent workflowstask 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 (runsflutter 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 worktreestask 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.mdtemplate for task context
1.0.0 - 2026-01-28 #
Added #
-
initcommand - Create new Flutter projects with Clean Architecture- Interactive configuration prompts
- Support for Riverpod (with
@riverpodannotation), Bloc, and Provider - Support for GoRouter and AutoRoute
- Optional Freezed integration with
sealed classsyntax - Optional Dio HTTP client
- Multi-platform support (Android, iOS, Web, macOS, Windows, Linux)
- Localization (l10n) support
- Automatic
build_runnerexecution after project creation
-
setupcommand - Configure flg in existing Flutter projects- Detects existing
pubspec.yamland 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 getandbuild_runnerautomatically
- Detects existing
-
generatecommand with subcommands:feature(alias:f) - Generate complete feature modulesscreen(alias:s) - Generate screen widgetswidget(alias:w) - Generate widgets (stateless, stateful, card, list_tile, form)provider(alias:p) - Generate providers/notifiers/blocsusecase(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 classsyntax - Repository implementations
- Remote data sources (Dio or http)
- Riverpod notifiers using
@riverpodannotation 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.jsonfile for project settings persistence- Automatic configuration detection in existing projects
-
Developer experience:
--dry-runflag to preview changes without creating files--verboseflag for detailed output--no-colorflag 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_annotationand code generation - Modern Freezed with
sealed classsyntax - Comprehensive test suite (81 tests)