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, and README.md files
  • 🏷️ 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

  1. Copies Template: Creates a complete copy of your template project
  2. Updates Project Name: Replaces the old project name in:
    • pubspec.yaml
    • All .dart files
    • README.md
    • Test files
  3. Updates Package IDs: Configures Android and iOS bundle identifiers:
    • Android: build.gradle, AndroidManifest.xml, MainActivity.kt
    • iOS: Info.plist, project.pbxproj

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

  1. Create your perfect template project with all your preferred packages, folder structure, and configurations
  2. 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.