Flutter Clone CLI
A command-line tool to create Flutter projects from custom templates. Similar to flutter create, but uses your own project as a template with automatic package ID and project name updates.
Features
- π§© Create Flutter projects from templates β reuse your own pre-configured Flutter apps
- πͺ Automatically updates project name in all
.dart,.yaml, andREADME.mdfiles - π·οΈ Update Android & iOS package IDs automatically
- π§± Manage Flutter SDK versions β switch between channels or versions using FVM or SDK directly
- π¨ Change app icons easily via
flutter_launcher_icons - βοΈ CI/CD ready β integrates smoothly into automated pipelines
- π§Ή Excludes build artifacts & hidden files automatically
- π¬ Clean, developer-friendly CLI interface using
mason_logger
Installation
Global Installation
dart pub global activate flutter_clone_cli
From Source
git clone https://github.com/yourusername/flutter_clone_cli.git
cd flutter_clone_cli
dart pub global activate --source path .
Usage
Commands
| Command | Description |
|---|---|
create |
Create a new Flutter project from a template |
icon |
Configure or update the app icon using flutter_launcher_icons |
help |
Show usage information |
create Options
| Option | Description |
|---|---|
-t, --template |
Path to the template Flutter project (required) |
-o, --org |
Organization identifier (default: com.example) |
-n, --app-name |
Custom application display name |
-v, --flutter-version |
Flutter version to use (e.g., 3.16.0, stable) |
-h, --help |
Show help for create command |
Example:
ftcreate create my_app -t /path/to/template -o com.mycompany -n "My App" -v stable
π₯οΈ Platform Support
flutter_clone_cli is a command-line utility designed for desktop platforms:
- β Windows
- β macOS
- β Linux
- β Not supported on Web, Android, or iOS (uses
dart:io)
How It Works
- Copies Template: Creates a complete copy of your template project
- Updates Project Name: Replaces the old project name in:
pubspec.yaml- All
.dartfiles README.md- Test files
- Updates Package IDs: Configures Android and iOS bundle identifiers:
- Android:
build.gradle,AndroidManifest.xml,MainActivity.kt - iOS:
Info.plist,project.pbxproj
- Android:
Project Name Rules
Project names must:
- Start with a lowercase letter
- Contain only lowercase letters, numbers, and underscores
- Examples:
my_app,awesome_project,app2
What Gets Excluded
The following are automatically excluded from copying:
- Hidden files and folders (
.git,.idea, etc.) - Build artifacts (
build/,.dart_tool/) - Flutter plugin files
Example Workflow
- Create your perfect template project with all your preferred packages, folder structure, and configurations
- Use it to generate new projects:
# Navigate to where you want the new project
cd ~/projects
# Create from template
ftcreate create shopping_app -t ~/templates/my_flutter_template -o com.mycompany
# Start developing
cd shopping_app
flutter pub get
flutter run
Requirements
- Dart SDK >=3.0.0
- Flutter (for the template and generated projects)
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE file for details
Support
For issues, questions, or contributions, please visit the GitHub repository.