āĻ¸ā§āĻ•āĻŋāĻĒ āĻ•āϰ⧇ āĻŽā§‚āϞ āĻ•āĻ¨ā§āĻŸā§‡āĻ¨ā§āϟ āĻ āϝāĻžāύ

đŸ“Ļ 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​

OptionTypeDefaultDescription
useFreezedbooleantrueFreezed annotations āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰāĻŦ⧇ āĻ•āĻŋ āύāĻž
useEquatablebooleanfalseEquatable āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰāĻŦ⧇ āĻ•āĻŋ āύāĻž
defaultStateManagerstring"getx"Default state manager ("getx" āĻŦāĻž "bloc")
authorstring"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 āϏāĻĢāϞ āĻšāϝāĻŧ⧇āϛ⧇! āĻāĻ–āύ āφāĻĒāύāĻŋ:

  1. Configuration Guide āĻĒāĻĄāĻŧ⧁āύ
  2. CLI Commands āĻļāĻŋāϖ⧁āύ
  3. First Feature āϤ⧈āϰāĻŋ āĻ•āϰ⧁āύ
  4. 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 āϤ⧈āϰāĻŋ āĻ•āϰ⧁āύ!