đĻ Installation Guide
FLX CLI install āĻāϰā§āύ āĻāĻŦāĻ āĻāĻĒāύāĻžāϰ Flutter development workflow-āĻā§ supercharge āĻāϰā§āύ!
⥠Quick Installationâ
đ¯ Prerequisitesâ
1. Dart SDKâ
FLX CLI āĻāĻžāĻ āĻāϰāĻžāϰ āĻāύā§āϝ Dart SDK āĻĒā§āϰāϝāĻŧā§āĻāύāĨ¤
# Check Dart version
dart --version
# Expected output:
# Dart SDK version: 3.0.0 (stable)
2. Flutter SDK (Optional)â
Flutter projects-āĻ āĻāĻžāĻ āĻāϰāĻžāϰ āĻāύā§āϝāĨ¤
# Check Flutter version
flutter --version
# Expected output:
# Flutter 3.13.0 âĸ channel stable
đ Install via Dart Pubâ
# Global activation
dart pub global activate flx_cli
# â
Success message:
# Activated flx_cli 1.0.0.
đ Verify Installationâ
# Check if FLX CLI is working
flx --version
# Expected output:
# FLX CLI version 1.0.0
# Show help menu
flx --help
# Expected output:
# FLX CLI - Flutter Clean Architecture Generator
#
# Usage: flx <command> [arguments]
# ...
đ Advanced Installationâ
đ PATH Configurationâ
āϝāĻĻāĻŋ flx
command āĻāĻžāĻ āύāĻž āĻāϰā§, PATH configure āĻāϰā§āύ:
Windowsâ
# Check current PATH
echo $env:PATH
# Add Dart pub global bin to PATH
$env:PATH += ";$env:USERPROFILE\AppData\Local\Pub\Cache\bin"
# Permanently add to PATH via System Properties
# System Properties > Environment Variables > PATH > Add:
# %USERPROFILE%\AppData\Local\Pub\Cache\bin
macOS/Linuxâ
# Check current PATH
echo $PATH
# Add to ~/.bashrc or ~/.zshrc
echo 'export PATH="$PATH:$HOME/.pub-cache/bin"' >> ~/.bashrc
# Reload shell
source ~/.bashrc
đ Update FLX CLIâ
# Update to latest version
dart pub global activate flx_cli
# Force reinstall
dart pub global activate flx_cli --force
đ Uninstallâ
# Deactivate FLX CLI
dart pub global deactivate flx_cli
# â
Success message:
# Deactivated package flx_cli.
đ¨ Post-Installation Setupâ
1. Initialize Configurationâ
# Create .flxrc.json config file
flx config init
# â
Output:
# â
Successfully created .flxrc.json config file
# You can now edit this file to customize your preferences.
2. Configure State Managerâ
# Set BLoC as state manager
flx config --state bloc
# â
Output:
# â
State manager set to: bloc
# Set GetX as state manager
flx config --state getx
# â
Output:
# â
State manager set to: getx
3. Test First Feature Generationâ
# Create a test project
flutter create flx_test_app
cd flx_test_app
# Generate your first feature
flx gen feature auth
# â
Output:
# â
Generated feature "auth" with files:
# - lib/features/auth/domain/entities/auth_entity.dart
# - lib/features/auth/data/models/auth_model.dart
# - ... (more files)
đ§ Configuration File Detailsâ
.flxrc.json Structureâ
{
"useFreezed": true,
"useEquatable": false,
"defaultStateManager": "getx",
"author": "Your Name"
}
Configuration Optionsâ
Option | Type | Default | Description |
---|---|---|---|
useFreezed | boolean | true | Freezed annotations āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāĻŦā§ āĻāĻŋ āύāĻž |
useEquatable | boolean | false | Equatable āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāĻŦā§ āĻāĻŋ āύāĻž |
defaultStateManager | string | "getx" | Default state manager ("getx" āĻŦāĻž "bloc" ) |
author | string | "Developer" | Code comments-āĻ author name |
Edit Configurationâ
# Manual edit
# Open .flxrc.json in your editor and modify:
{
"useFreezed": true,
"useEquatable": false,
"defaultStateManager": "bloc",
"author": "Rakibul Haque"
}
đ Troubleshootingâ
â Command not found: flxâ
# Solution 1: Check if dart pub global bin is in PATH
echo $PATH | grep pub-cache
# Solution 2: Add to PATH manually
export PATH="$PATH:$HOME/.pub-cache/bin"
# Solution 3: Reinstall
dart pub global deactivate flx_cli
dart pub global activate flx_cli
â Permission denied (macOS/Linux)â
# Make sure you have write permissions
sudo chown -R $(whoami) ~/.pub-cache/
# Reinstall
dart pub global activate flx_cli
â Dart SDK not foundâ
# Install Dart SDK
# Visit: https://dart.dev/get-dart
# Or install via Flutter
flutter --version
â .flxrc.json not foundâ
# Initialize config manually
flx config init
# Or create manually:
echo '{"useFreezed": true, "useEquatable": false, "defaultStateManager": "getx", "author": "Developer"}' > .flxrc.json
đ Development Installationâ
Clone from GitHubâ
# Clone repository
git clone https://github.com/flx-cli/flx.git
cd flx
# Install dependencies
dart pub get
# Run locally
dart bin/flx.dart --help
Build from Sourceâ
# Build executable
dart compile exe bin/flx.dart -o flx
# Make executable (Linux/macOS)
chmod +x flx
# Move to PATH
sudo mv flx /usr/local/bin/
đ Installation Verificationâ
â Full System Checkâ
# 1. Check Dart
dart --version
# 2. Check FLX CLI
flx --version
# 3. Check PATH
which flx
# 4. Test command
flx gen feature test_feature
# 5. Clean up test
rm -rf lib/features/test_feature
đ Performance Testâ
# Time the feature generation
time flx gen feature performance_test
# Expected: ~2-3 seconds
# real 0m2.156s
# user 0m1.234s
# sys 0m0.234s
đ Success! Next Stepsâ
đ Ready to Useâ
āĻāĻĒāύāĻžāϰ FLX CLI installation āϏāĻĢāϞ āĻšāϝāĻŧā§āĻā§! āĻāĻāύ āĻāĻĒāύāĻŋ:
- Configuration Guide āĻĒāĻĄāĻŧā§āύ
- CLI Commands āĻļāĻŋāĻā§āύ
- First Feature āϤā§āϰāĻŋ āĻāϰā§āύ
- Best Practices follow āĻāϰā§āύ
đĄ Pro Tipsâ
- āĻĒā§āϰāϤāĻŋāĻāĻŋ āύāϤā§āύ project-āĻ
flx config init
run āĻāϰā§āύ - Team projects-āĻ
.flxrc.json
share āĻāϰā§āύ - Regular updates check āĻāϰā§āύ:
dart pub global activate flx_cli
Installation complete! đ āĻāĻāύ Configuration Guide āĻĻā§āĻā§āύ āĻŦāĻž āϏāϰāĻžāϏāϰāĻŋ First Feature āϤā§āϰāĻŋ āĻāϰā§āύ!