🧩 Gexd CLI

GEXD Logo

Format & Analyze Run Tests E2E Tests Release Latest Release pub package License: MIT Documentation

A modern CLI tool for generating Flutter projects using GetX and Clean Architecture, designed for scalability, maintainability, and developer productivity.

📚 Complete Documentation


🎬 Demo

Gexd Demo

See Gexd in action! Generate screens, models, and more with simple commands.


⚡ 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.dev (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


GEXD

Made with ❤️ for the Flutter community.

Libraries

gexd
gexd.dart