AppFlow CLI is a command-line tool built with Dart to help Flutter developers generate and manage scalable architecture using a simple configuration file.
It's perfect for bootstrapping projects with a clean, modular architecture β ideal for solo devs and teams alike.
- Generate folder/file structures using YAML config
- Add new modules or features on demand
- Overwrite existing files with a flag
- Clean/remove previously generated structures
- Generate custom boilerplate code
- Route management
Ideal for:
-
Flutter developers following clean architecture, feature-based architecture, or layered architecture.
-
Teams wanting a consistent and fast way to set up project scaffolding.
-
Projects needing custom boilerplate generation.
dart pub global activate app_flow_cli Or install a specific version using:
dart pub global activate app_flow_cli <version>If you haven't already, you might need to set up your path.
When that is not possible (eg: CI environments), run very_good commands via:
dart pub global run app_flow_cli [options] // e.g dart pub global run app_flow_cli --add structureapp_flow_cli [options]| Option | Description |
|---|---|
--config <path> |
Path to the YAML/JSON config file |
--add <module> |
Add a module/feature to the structure |
--overwrite |
Overwrite existing files |
--clean |
Remove previously generated structure |
--rm |
Removes a module |
--make-route <file> |
Updates a route file with new screen pages |
--workflow <options> |
Executes a structured process |
status |
Show all files & folders generated by AppFlow |
--help |
Display usage information |
Using the default structure.
// generate the default structure
app_flow_cli --add structureRemoving the default structure.
app_flow_cli --cleanUsing your own structure.
// pass your own config structure to generate
app_flow_cli --add structure --config appflow.yaml
// pass your config to remove the folders & files
app_flow_cli --clean --config appflow.yamlWhen using the default structure, three key files will be generated:
home.dart: This file serves as the entry point for your app's main screen. It will typically display the primary content for your app.splash.dart: A splash screen that is shown when the app is launched. It provides a smooth transition into the app.router.dart: This file manages routing setup, defining routes and handling navigation across the app.main.dart: This is the main file. The file is overriden only if the--overwriteoption is set when you runapp_flow_cli --add structure. For example,app_flow_cli --add structure --overwrite.
These files are automatically generated when you run app_flow_cli --add structure and provide a solid starting point for your app's UI and navigation flow.
A basic config:
folders:
# Main application code
- lib/src/app/ # App-wide configuration
- lib/src/app/config/ # Environment configurations (dev, staging, prod)"
- lib/src/app/constants/ # App constants (strings, routes, enums)"
- lib/src/app/di/ # Dependency injection setup"
- lib/src/app/theme/ # App theme data"
# Core functionality
- lib/src/core/ # Core functionality"
- lib/src/core/errors/ # Error handling classes"
- lib/src/core/network/ # Network clients and interceptors"
- lib/src/core/utils/ # Utilities (validators, extensions, formatters)"
- lib/src/core/widgets/ # Reusable app-wide widgets"
# Feature modules
- lib/src/features/auth/ # Example feature: Authentication"
- lib/src/features/auth/data/ # Data layer"
- lib/src/features/auth/data/datasources/ # Local/remote data sources"
- lib/src/features/auth/data/models/ # Data transfer objects"
- lib/src/features/auth/data/repositories/ # Repository implementations"
- lib/src/features/auth/domain/ # Domain layer"
- lib/src/features/auth/domain/entities/ # Business logic entities"
- lib/src/features/auth/domain/repositories/ # Repository interfaces"
- lib/src/features/auth/domain/usecases/ # Business logic use cases"
- lib/src/features/auth/presentation/ # UI layer"
- lib/src/features/auth/presentation/bloc/ # State management"
- lib/src/features/auth/presentation/pages/ # Full screens/views"
- lib/src/features/auth/presentation/widgets/ # Feature-specific widgets"
# Routing configuration
- lib/src/routes/ # Routing configuration"
# Localization
- lib/l10n/ # Localization files"
# Static files
- assets/icons/ # App icons"
- assets/images/ # Images"
- assets/fonts/ # Custom fonts"
- assets/translations/ # JSON translation files"
# Testing
- test/ # Test files"
- test/features/ # Feature tests"
- test/mock/ # Mock classes"
- test/test_helpers/ # Testing utilities"
# Other
- integration_test/ # Integration tests"
- scripts/ # Build/deployment scripts"
files:
"lib/src/routes/app_pages.dart": |
// Route definitions
class AppPages {
static const initial = '/';
}
"lib/src/routes/app_router.dart": |
// Router implementation
class AppRouter {}
"lib/l10n/app_en.arb": |
// Localization files
{
"appTitle": "My App",
"@appTitle": {
"description": "The title of the application"
}
}
"lib/firebase_options.dart": |
// Firebase configuration (if used)
class FirebaseOptions {}
".gitignore": |
# Version control ignore
/build/
"README.md": |
# Project documentation
## My Flutter App
A developer community application.To add a new directory, run:
app_flow_cli --add features:authThis will create a new auth directory inside the lib/features folder, and replicate the folder structure defined in your project's configuration or using the default structure. You can add multiple directories at once by separating them with commas, e.g.,
app_flow_cli --add features:auth,productThis command will create both auth and product directories inside lib/features, each following the project's predefined structure.
To remove directory, run:
app_flow_cli --rm features:authThis will delete the auth folder, including any subfolders and files inside it.
--make-route <file>
this command helps automate route management and keeps your routing setup clean and up to date with newly added screens.
Usage:
app_flow_cli --make-route router.dartScans the project for all Dart files ending with _screen.dart (excluding already tracked files), and automatically generates route entries for them in the provided <file> (e.g. router.dart *without the path). If the route file already exists, it updates it by injecting the new routes.
--workflow <options> this tool allows you to execute a sequence of predefined git commands based on a configuration file and dynamic key-value inputs. For example:
app_flow_cli --workflow git:message="initial commit" --config app_flow_cli.ymlExplanation of:
git:message="initial commit"Given the config:
workflow:
git:
- add .
- commit -m "{message}"
- pushThis input tells the workflow system to:
- Select the git workflow.
- Replace the {message} placeholder in the command template with "initial commit".
Note: You can specify your own keys (e.g., {message}, {branch}) as long as they match placeholders defined in the command templates.
For example:
git:message="initial commit",branch=devSeparate by , for multiple keys.
Example of the config:
workflow:
git:
- add .
- commit -m "{message}"
- push origin {branch}This package is available under the MIT License.


