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

🛠 Basic Commands

FLX CLI āĻāϰ essential commands āϗ⧁āϞ⧋ āĻļāĻŋāϖ⧁āύ āϝāĻž āĻĻāĻŋāϝāĻŧ⧇ āφāĻĒāύāĻŋ 90% āĻ•āĻžāϜ āĻ•āϰāϤ⧇ āĻĒāĻžāϰāĻŦ⧇āύ!

📋 Command Structure​

flx [command] [subcommand] [name] [options]

🚀 Essential Commands​

1. Help & Information​

# āϏāĻŦ commands āĻĻ⧇āϖ⧁āύ
flx --help

# Specific command āĻāϰ help
flx gen --help
flx config --help

# Version check āĻ•āϰ⧁āύ
flx --version

2. Configuration Commands​

# Current config āĻĻ⧇āϖ⧁āύ
flx config --list

# State management set āĻ•āϰ⧁āύ
flx config --state getx
flx config --state bloc

# Local project config (current directory)
flx config --state getx --local

# Global config reset āĻ•āϰ⧁āύ
flx config --reset

3. Generation Commands​

Feature Generation (Most Important! 🌟)​

# Complete feature āϤ⧈āϰāĻŋ āĻ•āϰ⧁āύ
flx gen feature auth
flx gen feature user_profile
flx gen feature product

# With additional options
flx gen feature auth --with-test
flx gen feature product --state-management=bloc

Individual Component Generation​

# Model āϤ⧈āϰāĻŋ āĻ•āϰ⧁āύ
flx gen model user
flx gen model product --with-json

# Use case āϤ⧈āϰāĻŋ āĻ•āϰ⧁āύ
flx gen usecase login
flx gen usecase get_products

# Repository āϤ⧈āϰāĻŋ āĻ•āϰ⧁āύ
flx gen repository user
flx gen repository product --with-cache

# Screen/Page āϤ⧈āϰāĻŋ āĻ•āϰ⧁āύ
flx gen screen home
flx gen screen profile --with-form

đŸŽ¯ Quick Usage Examples​

Example 1: Auth Feature​

# 1. Auth feature āϤ⧈āϰāĻŋ āĻ•āϰ⧁āύ
flx gen feature auth

# Generated structure:
# lib/features/auth/
# ├── data/
# │ ├── models/auth_model.dart
# │ ├── repositories/auth_repository_impl.dart
# │ └── datasources/auth_remote_data_source.dart
# ├── domain/
# │ ├── entities/auth_entity.dart
# │ ├── repositories/auth_repository.dart
# │ └── usecases/login_usecase.dart
# └── presentation/
# ├── pages/auth_page.dart
# ├── controllers/auth_controller.dart
# └── bindings/auth_binding.dart

Example 2: Product Management​

# 1. Product feature
flx gen feature product

# 2. Additional models
flx gen model category
flx gen model cart_item

# 3. Additional use cases
flx gen usecase add_to_cart
flx gen usecase remove_from_cart

# 4. Additional screens
flx gen screen product_details
flx gen screen cart

Example 3: User Profile​

# 1. User feature with BLoC
flx config --state bloc
flx gen feature user_profile

# 2. Additional screens
flx gen screen edit_profile --with-form
flx gen screen settings

📝 Command Options​

Global Options​

OptionDescriptionExample
--helpShow helpflx gen --help
--versionShow versionflx --version
--verboseDetailed outputflx gen feature auth --verbose

Generation Options​

OptionDescriptionDefaultExample
--state-managementState management typegetx--state-management=bloc
--with-testInclude test filesfalse--with-test
--with-jsonInclude JSON serializationfalse--with-json
--with-formInclude form widgetsfalse--with-form
--with-cacheInclude caching logicfalse--with-cache

Config Options​

OptionDescriptionExample
--localProject-specific configflx config --state getx --local
--globalGlobal config (default)flx config --state getx --global
--resetReset configurationflx config --reset
--listShow current configflx config --list

🔄 Workflow Commands​

Typical Development Flow​

# 1. Project setup
flutter create my_app
cd my_app

# 2. Configure FLX CLI
flx config --state getx

# 3. Create core features
flx gen feature auth
flx gen feature home
flx gen feature profile

# 4. Add additional components
flx gen model settings
flx gen usecase logout
flx gen screen splash

# 5. Check what you've built
ls lib/features/

Quick Feature Addition​

# āĻāĻ•āϟāĻŋ complete feature āĻŽāĻžāĻ¤ā§āϰ āĻāĻ• āĻ•āĻŽāĻžāĻ¨ā§āĻĄā§‡
flx gen feature notification --with-test

# Result: āϏāĻŦ Clean Architecture layers āϏāĻš complete feature!

💡 Pro Tips​

1. Config First​

# āĻĒā§āϰāĻĨāĻŽā§‡ config set āĻ•āϰ⧁āύ, āϤāĻžāϰāĻĒāϰ generate āĻ•āϰ⧁āύ
flx config --state getx
flx gen feature auth # GetX āĻĻāĻŋāϝāĻŧ⧇ āϤ⧈āϰāĻŋ āĻšāĻŦ⧇

2. Batch Generation​

# Multiple features āĻāĻ•āϏāĻžāĻĨ⧇
flx gen feature auth
flx gen feature product
flx gen feature user

3. Check Generated Files​

# Generate āĻ•āϰāĻžāϰ āĻĒāϰ check āĻ•āϰ⧁āύ
tree lib/features/ # Unix/Linux/Mac
dir lib\features\ /s # Windows

4. Consistent Naming​

# Snake case āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰ⧁āύ
flx gen feature user_profile # ✅ Good
flx gen feature UserProfile # ❌ Avoid

🆘 Quick Troubleshooting​

Common Commands for Issues​

# 1. Command not found
where flx # Windows
which flx # Unix/Linux/Mac

# 2. Permission issues
dart pub cache repair

# 3. Config problems
flx config --reset
flx config --state getx

# 4. Check installation
flx --version
dart pub global list

📚 Next Steps​

āĻāχ basic commands āĻĻāĻŋāϝāĻŧ⧇ āφāĻĒāύāĻŋ:

  1. ✅ Features āϤ⧈āϰāĻŋ āĻ•āϰāϤ⧇ āĻĒāĻžāϰāĻŦ⧇āύ
  2. ✅ Individual components generate āĻ•āϰāϤ⧇ āĻĒāĻžāϰāĻŦ⧇āύ
  3. ✅ Config manage āĻ•āϰāϤ⧇ āĻĒāĻžāϰāĻŦ⧇āύ
  4. ✅ Basic troubleshooting āĻ•āϰāϤ⧇ āĻĒāĻžāϰāĻŦ⧇āύ

āĻāϰāĻĒāϰ: đŸŽ¯ Your First Feature āϤ⧈āϰāĻŋ āĻ•āϰ⧁āύ

Learning time: ~10 minutes âąī¸