Flutter development environment setup CLI tool for macOS and Linux
Project description
Flutter Setup CLI
A modern Python CLI tool for setting up complete Flutter development environments on macOS and Linux. This tool automates Flutter SDK setup, prerequisite checks, and project bootstrapping with practical defaults.
Features
- ๐ Automated Setup: Complete Flutter development environment setup in minutes
- ๐ฆ Flutter SDK Management: Install, update, and manage Flutter SDK with multiple channels
- ๐ ๏ธ Prerequisites Installation: Platform-aware prerequisite checks and installation flows for macOS and Linux
- ๐ฑ Multi-Platform Support: Create projects for iOS, Android, macOS, Linux, Windows, and Web
- ๐ง Development Environment: Pre-configured VS Code/Cursor settings, testing framework, and CI/CD
- ๐ฏ Best Practices: Industry-standard project structure with linting, testing, and analysis tools
- ๐งช Testing Ready: Built-in test structure for unit, widget, and integration tests
- ๐ฆ Easy Deployment: Simple Python package that can be easily installed on any developer machine
Quick Start
Installation
# Clone the repository
git clone <your-repo-url>
cd flutter-setup
# Install the package
uv pip install -e .
# Or install directly from GitHub (when published)
uv pip install git+https://github.com/markcallen/flutter-setup.git
Linux Prerequisites (Ubuntu/Debian)
For Linux hosts, ensure APT is available and sudo is configured:
sudo apt-get update
sudo apt-get install -y git curl unzip xz-utils zip libglu1-mesa clang cmake ninja-build pkg-config libgtk-3-dev libayatana-appindicator3-dev liblzma-dev openjdk-17-jdk
Configuration Setup
Before your first use, initialize your configuration:
# Interactive configuration setup
flutter-setup init
This will:
- Detect Flutter location from environment variables or PATH
- Prompt for Flutter channel (stable/beta)
- Prompt for organization ID
- Create config file at
~/.config/flutter-setup/config.yaml
You can run flutter-setup init again anytime to update your configuration.
Basic Usage
# Create a new Flutter app with iOS, Android, and Web support
flutter-setup setup MyAwesomeApp ios android web
# Create a plugin with specific language preferences
flutter-setup setup MyPlugin --template plugin --ios-language objc --android-language java ios android
# Use beta channel and custom organization
flutter-setup setup MyApp --channel beta --org com.mycompany ios android macos
# Preview what would happen (dry run)
flutter-setup setup MyApp --dry-run ios android
Commands
init - Configuration Setup
Initialize or update your configuration file:
flutter-setup init # Create or update config interactively
flutter-setup init --force # Overwrite existing config
The config file is stored at ~/.config/flutter-setup/config.yaml (or $XDG_CONFIG_HOME/flutter-setup/config.yaml).
setup - Project Setup
Set up a new Flutter project:
flutter-setup setup MyApp ios android web
Command Line Options
| Option | Description | Default | Config File |
|---|---|---|---|
--org |
Organization identifier | com.example |
โ |
--channel |
Flutter channel (stable/beta) | stable |
โ |
--dir |
Output directory | Current directory | โ |
--template |
Project template (app/plugin) | app |
โ |
--architecture |
Application architecture scaffold (basic/clean) | basic |
โ |
--database |
Local persistence scaffold (none/sqlite) | none |
โ |
--testing |
Testing starter scaffold (standard/mocktail) | standard |
โ |
--auth-provider |
Auth integration scaffold (none/firebase) | none |
โ |
--cloud-database |
Cloud database scaffold (none/firestore) | none |
โ |
--notifications-provider |
Push notifications scaffold (none/firebase) | none |
โ |
--ios-language |
iOS language for plugins (swift/objc) | swift |
โ |
--android-language |
Android language for plugins (kotlin/java) | kotlin |
โ |
--flutter-update |
Flutter update mode (reset/reclone/skip) | reset |
โ |
--dry-run |
Preview actions without executing | false |
โ |
--verbose |
Enable verbose output | false |
โ |
Note: Options marked with โ
can be set in the config file via flutter-setup init. Command-line arguments override config file values.
What Gets Set Up
1. System Prerequisites
- โ macOS: Xcode Command Line Tools + Homebrew + CocoaPods
- โ
Linux (Ubuntu/Debian): APT-managed packages (
git,curl,unzip,xz-utils,zip,libglu1-mesa,clang,cmake,ninja-build,pkg-config,libgtk-3-dev,libayatana-appindicator3-dev,liblzma-dev,openjdk-17-jdk) - โ Android development tools when Android platform is selected
- โ iOS development tools only on macOS when iOS platform is selected
2. Flutter SDK
- โ Flutter SDK installation/update
- โ Channel management (stable/beta)
- โ PATH configuration
- โ Flutter doctor validation
3. Project Structure
- โ Flutter project creation with specified platforms
- โ Package name sanitization
- โ Template-specific configuration
- โ Optional Clean Architecture scaffold
- โ Optional SQLite/Drift local persistence scaffold
- โ Optional Firebase Auth, Firestore, and Firebase Messaging scaffolds
- โ Optional Mocktail testing starter
4. Development Environment
- โ VS Code/Cursor configuration
- โ Makefile with common commands
- โ Testing framework structure
- โ Code analysis and linting setup
- โ GitHub Actions CI pipeline
- โ Environment variable support
- โ Comprehensive README
Project Structure
MyAwesomeApp/
โโโ .vscode/ # VS Code/Cursor configuration
โโโ .github/workflows/ # CI/CD pipeline
โโโ lib/ # Flutter source code
โโโ test/ # Test files
โ โโโ unit/ # Unit tests
โ โโโ widget/ # Widget tests
โโโ integration_test/ # Integration tests
โโโ Makefile # Common development commands
โโโ analysis_options.yaml # Linting and analysis rules
โโโ .env # Environment variables
โโโ README.md # Project documentation
Development Commands
After setup, use these commands in your project:
# Run the app
make run # Chrome (default)
make run_ios # iOS simulator
make run_android # Android emulator
# Testing
make test # Unit + widget tests
make integration # Integration tests
# Code quality
make analyze # Flutter analyze
Configuration
The tool uses a YAML-based configuration file that stores your preferences:
Location: ~/.config/flutter-setup/config.yaml (or $XDG_CONFIG_HOME/flutter-setup/config.yaml)
Example config:
flutter:
location: ~/development/flutter
channel: stable
update_mode: reset
project:
org: com.mycompany
template: app
architecture: basic
database: none
testing: standard
auth_provider: none
cloud_database: none
notifications_provider: none
ios_language: swift
android_language: kotlin
Configuration Features:
- โ XDG Base Directory Specification compliant
- โ Automatic Flutter location detection from environment
- โ
Interactive setup via
flutter-setup init - โ Command-line arguments override config values
- โ Persistent settings across sessions
Architecture
The package is built with modern Python best practices:
- Modular Design: Separate modules for different concerns
- Type Safety: Full type hints with mypy support
- Error Handling: Comprehensive exception handling
- Rich CLI: Beautiful terminal output with progress indicators
- Configuration: Flexible configuration system with XDG support
- Testing: Built-in test structure and CI/CD
Development
Prerequisites
- Python 3.12+
- uv package manager
Supported Hosts
- macOS (Darwin)
- Linux (Ubuntu/Debian via APT)
Known Limitations
- Fedora/DNF support is planned but not yet implemented.
- iOS setup is not available on Linux hosts.
Setup Development Environment
# Clone and install
git clone <repo-url>
cd flutter-setup
uv pip install -e ".[dev]"
# Run tests
uv run pytest
# Format code
uv run black .
# Lint code
uv run ruff check .
# Type checking
uv run mypy .
Project Structure
flutter-setup/
โโโ flutter_setup/ # Main package
โ โโโ __init__.py
โ โโโ cli.py # CLI entry point
โ โโโ config.py # Configuration management
โ โโโ core.py # Main orchestration
โ โโโ exceptions.py # Custom exceptions
โ โโโ prerequisites.py # System prerequisites
โ โโโ flutter_manager.py # Flutter SDK management
โ โโโ project_creator.py # Project creation
โ โโโ bootstrap.py # Development environment setup
โโโ pyproject.toml # Package configuration
โโโ README.md # This file
โโโ test_cli.py # Simple test script
Comparison with Bash Script
This Python CLI package provides several advantages over the original bash script:
| Feature | Bash Script | Python CLI |
|---|---|---|
| Installation | Manual download | pip install |
| Dependencies | Manual management | Automatic with uv |
| Error Handling | Basic | Comprehensive |
| Testing | None | Full test suite |
| Type Safety | None | Full mypy support |
| Packaging | Manual | Standard Python package |
| Distribution | Manual | PyPI ready |
| Maintenance | Harder | Easier with Python tools |
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
For issues and questions:
- Create an issue on GitHub
- Check the documentation
- Review the PRD.md for detailed requirements
Built with โค๏ธ for the Flutter community
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flutter_setup-2.1.1.tar.gz.
File metadata
- Download URL: flutter_setup-2.1.1.tar.gz
- Upload date:
- Size: 56.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24262ad998160d167d3678e6a1fd031ba8aa8ca64461c18ba68892c982514ca8
|
|
| MD5 |
cb88361b566cb1e2767c6726c397f50c
|
|
| BLAKE2b-256 |
dd4fa94982c1c832612e7133735403b92622375caf6cd93c5c665e9cfd536ef1
|
Provenance
The following attestation bundles were made for flutter_setup-2.1.1.tar.gz:
Publisher:
publish.yml on markcallen/flutter-setup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flutter_setup-2.1.1.tar.gz -
Subject digest:
24262ad998160d167d3678e6a1fd031ba8aa8ca64461c18ba68892c982514ca8 - Sigstore transparency entry: 2187921773
- Sigstore integration time:
-
Permalink:
markcallen/flutter-setup@7f36637f98bb2cb3365ea8e8ee09c3e5e2ab8e26 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/markcallen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7f36637f98bb2cb3365ea8e8ee09c3e5e2ab8e26 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file flutter_setup-2.1.1-py3-none-any.whl.
File metadata
- Download URL: flutter_setup-2.1.1-py3-none-any.whl
- Upload date:
- Size: 41.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6af2d2c9011693f7edd99beec1c57ea9fac1e9feb7c88d95c560ea4c670fb3c
|
|
| MD5 |
8fc57d59057d8ac35a97ea262bc46e9a
|
|
| BLAKE2b-256 |
fe6be1829e93bca168adaaa4acce6c3db7739c4a38bdaa5a5b8b69388411236b
|
Provenance
The following attestation bundles were made for flutter_setup-2.1.1-py3-none-any.whl:
Publisher:
publish.yml on markcallen/flutter-setup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flutter_setup-2.1.1-py3-none-any.whl -
Subject digest:
c6af2d2c9011693f7edd99beec1c57ea9fac1e9feb7c88d95c560ea4c670fb3c - Sigstore transparency entry: 2187921784
- Sigstore integration time:
-
Permalink:
markcallen/flutter-setup@7f36637f98bb2cb3365ea8e8ee09c3e5e2ab8e26 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/markcallen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7f36637f98bb2cb3365ea8e8ee09c3e5e2ab8e26 -
Trigger Event:
workflow_dispatch
-
Statement type: