gexd 0.1.2
gexd: ^0.1.2 copied to clipboard
Modern CLI tool for Flutter projects using GetX and Clean Architecture. Generate models, screens, repositories, and services with SOLID principles.
π§© Gexd CLI #
A modern CLI tool for generating Flutter projects using GetX and Clean Architecture, designed for scalability, maintainability, and developer productivity.
π Complete Documentation | π Quick Start Guide
β‘ Overview #
Gexd helps Flutter developers scaffold complete applications using GetX + Clean Architecture, with strong typing, modular folder structure, and SOLID design principles.
β¨ Highlights #
- ποΈ Project Scaffolding β GetX and Clean Architecture templates
- π§ Typed Model Integration β Type-safe Repositories, Services, and Providers
- π§© Smart Code Generation β Models from JSON/API, Screens with state management
- π‘οΈ SOLID Principles β Clean folder hierarchy and separation of concerns
- π Advanced Localization β Multi-language with variables and pluralization
- π± Screen Templates β Basic, Form, and withState screen types
- π Repository Pattern β CRUD and custom repositories with interfaces
- π― Interactive CLI β Smart prompts and guided setup
π Installation #
# Install from pub.flutter-io.cn (Using Dart)
dart pub global activate gexd
# Alternative: Install using Flutter
flutter pub global activate gexd
# Verify installation
gexd --version
π¦ Pre-built Binaries #
| Platform | Download | Status |
|---|---|---|
| π§ Linux (x64) | π₯ gexd-linux-x64 | β Ready |
| πͺ Windows (x64) | π₯ gexd-windows-x64.exe | β Ready |
| π macOS (Intel) | π₯ gexd-macos-x64 | β Ready |
| π macOS (Apple Silicon) | π₯ gexd-macos-arm64 | β Ready |
π§ Quick Start #
Create a New Project #
gexd create my_app # Default GetX project
gexd create my_app --template clean
gexd create my_app --org com.example
Initialize Existing Project #
gexd init --template clean
π§± Core Commands #
ποΈ Create #
Create a new Flutter project.
gexd create <project_name> --template <getx|clean>
π¨ Make #
Generate code components for your project:
| Command | Example | Description |
|---|---|---|
| Entity | gexd make entity User --style immutable --with-model |
Domain entities for Clean Architecture |
| Model | gexd make model User --file user.json --immutable |
Smart models from JSON/API |
| Screen | gexd make screen Login --type form |
Complete screen components |
| Repository | gexd make repository User --type crud --interface |
Typed CRUD repositories |
| Service | gexd make service Auth --on auth |
Business logic services |
| Controller | gexd make controller Profile --type withState |
Reactive controllers |
| Binding | gexd make binding Home --location core |
Dependency injection |
| Provider | gexd make provider Api --model User |
Typed API providers |
| Interface | gexd make interface Repository --type crud |
Abstract interfaces |
| Middleware | gexd make middleware Auth |
Route middleware |
| Exception | gexd make exception ValidationError |
Custom exceptions |
π― Advanced Generation Features #
π± Smart Screen Generation
gexd make screen Login --type form # Form with validation
gexd make screen UserList --type withState # Reactive state management
gexd make screen Profile --has-model # Type-safe with User model
ποΈ Smart Model Generation
gexd make model User --file assets/user.json # From JSON file
gexd make model User --url https://api.com/user # From API endpoint
gexd make model User --immutable --copyWith # Immutable with features
gexd make model User --style freezed # Freezed-style models
ποΈ Repository Pattern
gexd make repository User --type crud --interface # Full CRUD with interface
gexd make repository User --model User # Type-safe repository
π― Flexible Organization
--on <subfolder> # Generate in subdirectory (auth/user)
--location <type> # Binding locations (core|shared|screen)
--model <ModelName> # Enable typed integration
--interface # Generate abstract interface
--force # Overwrite existing files
π Advanced Localization #
Generate powerful multi-language support with advanced features:
gexd locale generate assets/locales --key-style dot --sort-keys
π Localization Features #
π Variable Replacement
// Dynamic content with named variables
Text('welcome'.trVars({'name': 'John'})) // "Welcome John"
Text(LocaleKeys.welcome.trVars({'name': 'John'})) // Type-safe version
// Multiple variables
Text(LocaleKeys.greeting.trVars({'name': 'Ali', 'time': 'morning'})) // "Good morning, Ali!"
π’ Smart Pluralization
// Universal pluralization for all languages
Text('items'.trCount({'count': '0'})) // "No items"
Text(LocaleKeys.items.trCount({'count': '0'})) // Type-safe version
// Rich Arabic pluralization (zero, one, two, few, many, other)
Text(LocaleKeys.notifications.trCount({'count': '2'})) // "ΩΨ―ΩΩ Ψ₯Ψ΄ΨΉΨ§Ψ±Ψ§Ω"
Text(LocaleKeys.notifications.trCount({'count': '15'})) // "ΩΨ―ΩΩ 15 Ψ₯Ψ΄ΨΉΨ§Ψ±Ψ§Ω"
π Combined Features
// Pluralization with additional variables
Text(LocaleKeys.messages.trCount({'count': '5', 'sender': 'Ali'})) // "5 messages from Ali"
π Type-Safe Keys
// Generated LocaleKeys for compile-time safety
Text(LocaleKeys.welcome.tr) // Simple translation
Text(LocaleKeys.validation_required.trVars({'field': 'Email'})) // With variables
Text(LocaleKeys.items.trCount({'count': '10'})) // With pluralization
Supported Languages: English, Arabic (RTL), French, and easily extensible to any language.
π§° Dependency Management #
gexd add http dio # Add dependencies
gexd upgrade dio # Upgrade dependencies
gexd remove dio # Remove dependencies
π§ Architecture Templates #
GetX Structure #
lib/
βββ app/
β βββ modules/
β βββ routes/
β βββ core/
βββ data/
β βββ models/
β βββ repositories/
βββ domain/
βββ services/
Clean Architecture #
lib/
βββ core/
βββ data/
βββ domain/
βββ presentation/
βοΈ Advanced Options #
ποΈ Generation Options #
| Option | Description |
|---|---|
--interactive |
Run guided interactive mode |
--type <crud|form|withState> |
Component type and behavior |
--interface |
Generate abstract interface |
--model <Model> |
Enable typed model integration |
--immutable |
Generate immutable data classes |
--copyWith |
Add copyWith methods |
--equatable |
Use Equatable for value equality |
--relationships-in-folder |
Organize model relationships |
π¨ Style Options #
| Style | Description | Best For |
|---|---|---|
plain |
Simple Dart classes | Basic models |
json |
JSON serializable models | API integration |
freezed |
Freezed-style immutable models | Complex data handling |
ποΈ Architecture Options #
| Template | Description | Use Case |
|---|---|---|
getx |
GetX modular architecture | Rapid development |
clean |
Clean Architecture (DDD) | Enterprise applications |
π‘ Help & Troubleshooting #
gexd --help
gexd make repository --help
Common Issues
-
β Command not found: add Dart global path
export PATH="$PATH":"$HOME/.pub-cache/bin" -
βοΈ Permission denied:
chmod +x gexd-macos-x64 -
π§© Model not found: generate it first
gexd make model User
π Complete Workflow Example #
Create a full-featured Flutter app in minutes:
# 1. Create Clean Architecture project
gexd create my_ecommerce_app --template clean
# 2. Generate User model from JSON
gexd make model User --file assets/models/user.json --immutable --copyWith
# 3. Generate typed repository with interface
gexd make repository User --type crud --interface --on auth/data
# 4. Generate authentication service
gexd make service Auth --on auth
# 5. Generate login screen with form validation
gexd make screen Login --type form --on auth
# 6. Generate user profile screen with state management
gexd make screen UserProfile --type withState --has-model --on auth
# 7. Generate multi-language support
gexd locale generate assets/locales --key-style dot --sort-keys
# 8. Generate core bindings
gexd make binding App --location core
Result: A complete, production-ready Flutter app with Clean Architecture, type-safe repositories, reactive screens, and multi-language support! π
π€ Contributing #
We welcome contributions!
Clone and setup for development:
git clone https://github.com/altwaireb/gexd.git
cd gexd
π License #
Licensed under the MIT License β see LICENSE.
π Documentation & Examples #
- π Complete Examples - Comprehensive usage examples
- ποΈ Model Examples - JSON examples for model generation
- π Locale Examples - Multi-language examples
- π Advanced Features - trVars & trCount usage
- π¦ pub.flutter-io.cn
- π¬ Discussions
Made with β€οΈ for the Flutter community.
