🧩 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 | πŸš€ 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


GEXD

Made with ❀️ for the Flutter community.

Libraries

gexd
gexd.dart