https://github.com/youngcet/app_flow_cli
AppFlow CLI is a Dart-based command-line tool designed to automate the creation, management, and cleanup of scalable Flutter project structures.
https://github.com/youngcet/app_flow_cli
cli codegen dart files folder-creator folder-structure folders spring structure
Last synced: about 1 month ago
JSON representation
AppFlow CLI is a Dart-based command-line tool designed to automate the creation, management, and cleanup of scalable Flutter project structures.
- Host: GitHub
- URL: https://github.com/youngcet/app_flow_cli
- Owner: youngcet
- License: mit
- Created: 2025-04-04T23:36:00.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-12-10T21:48:57.000Z (6 months ago)
- Last Synced: 2025-12-28T18:31:19.601Z (6 months ago)
- Topics: cli, codegen, dart, files, folder-creator, folder-structure, folders, spring, structure
- Language: Dart
- Homepage:
- Size: 45.3 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 🧱 AppFlow CLI – Flutter Architecture Generator
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.
[](https://pub.dev/packages/app_flow_cli)
[](https://github.com/youngcet/app_flow_cli/blob/main/LICENSE)

---
Using the default project structure
Using your own project structure config
## ✨ Features
- 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
---
## Use Case
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.
## 📦 Installation
```dart
dart pub global activate app_flow_cli
```
Or install a specific version using:
```dart
dart pub global activate app_flow_cli
```
If you haven't already, you might need to [set up your path](https://dart.dev/tools/pub/cmd/pub-global#running-a-script-from-your-path).
When that is not possible (eg: CI environments), run very_good commands via:
```dart
dart pub global run app_flow_cli [options] // e.g dart pub global run app_flow_cli --add structure
```
# Usage
```dart
app_flow_cli [options]
```
## Options
| Option | Description |
|-----------------------|--------------------------------------------------------|
| `--config ` | Path to the YAML/JSON config file |
| `--add ` | Add a module/feature to the structure |
| `--overwrite` | Overwrite existing files |
| `--clean` | Remove previously generated structure |
| `--rm` | Removes a module |
| `--make-route ` | Updates a route file with new screen pages |
| `--workflow `| Executes a structured process |
| `status` | Show all files & folders generated by AppFlow |
| `--help` | Display usage information |
# Example
Using the default structure.
```dart
// generate the default structure
app_flow_cli --add structure
```
Removing the default structure.
```dart
app_flow_cli --clean
```
Using your own structure.
```dart
// 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.yaml
```
## Default Structure
When using the default structure, three key files will be generated:
1. **`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.
2. **`splash.dart`**: A splash screen that is shown when the app is launched. It provides a smooth transition into the app.
3. **`router.dart`**: This file manages routing setup, defining routes and handling navigation across the app.
4. **`main.dart`**: This is the main file. The file is overriden only if the `--overwrite` option is set when you run `app_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.
# Configuration Example (appflow.yaml)
A basic config:
```yaml
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.
```
## Adding new directories in `lib`
To add a new directory, run:
```dart
app_flow_cli --add features:auth
```
This 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.,
```dart
app_flow_cli --add features:auth,product
```
This command will create both `auth` and `product` directories inside `lib/features`, each following the project's predefined structure.
## Removing directories in `lib`
To remove directory, run:
```dart
app_flow_cli --rm features:auth
```
This will delete the `auth` folder, including any subfolders and files inside it.
## Generating Routes
**`--make-route `**
this command helps automate route management and keeps your routing setup clean and up to date with newly added screens.
Usage:
```dart
app_flow_cli --make-route router.dart
```
Scans the project for all Dart files ending with _screen.dart (excluding already tracked files), and automatically generates route entries for them in the provided `` (e.g. router.dart *without the path). If the route file already exists, it updates it by injecting the new routes.
## Git Workflows
**`--workflow `** this tool allows you to execute a sequence of predefined `git` commands based on a configuration file and dynamic key-value inputs. For example:
```dart
app_flow_cli --workflow git:message="initial commit" --config app_flow_cli.yml
```
Explanation of:
```dart
git:message="initial commit"
```
Given the config:
```yaml
workflow:
git:
- add .
- commit -m "{message}"
- push
```
This input tells the workflow system to:
1) Select the **git** workflow.
2) 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:
```dart
git:message="initial commit",branch=dev
```
Separate by , for multiple keys.
Example of the config:
```yaml
workflow:
git:
- add .
- commit -m "{message}"
- push origin {branch}
```
## License
This package is available under the [MIT License](https://github.com/youngcet/app_flow_cli/blob/main/LICENSE).