Make

GEXD

πŸ“ Description

Generate various project files and components. The make command is the primary code generation tool in Gexd CLI, offering powerful scaffolding capabilities for Flutter projects with GetX and Clean Architecture patterns.


βš™οΈ Usage

gexd make <subcommand> [<name>] [options]

πŸ“š Available Subcommands

πŸ—οΈ Core Components

Description: Generate complete screen components (controller, view, binding)

gexd make screen LoginPage
gexd make screen UserProfile --type withState --has-model

Description: Generate controller files for state management

gexd make controller Auth
gexd make controller User --type withState

Description: Generate view files (UI components)

gexd make view Login
gexd make view UserProfile --on auth

Description: Generate binding files for dependency injection

gexd make binding Auth
gexd make binding Core --location core

πŸ“Š Data Layer

Description: Generate type-safe model files from JSON sources with advanced features

gexd make model User --file assets/user.json
gexd make model Product --url https://api.example.com/products/1
gexd make model User --immutable --copyWith --relationships-in-folder

Description: Generate repository files for data access layers

gexd make repository User --type crud --interface
gexd make repository Api --on data/repositories

Description: Generate service files for business logic

gexd make service Auth
gexd make service Payment --on services

Description: Generate provider files for data sources

gexd make provider Api
gexd make provider Local --on data/providers

πŸ›οΈ Architecture Components

Description: Generate entity files for domain layer

gexd make entity User
gexd make entity Product --on domain/entities

Description: Generate interface files for contracts and abstractions

gexd make interface User --type crud
gexd make interface Payment --on interfaces

Description: Generate custom exception classes

gexd make exception Auth
gexd make exception Validation --on core/exceptions

Description: Generate middleware files for request/response handling

gexd make middleware Auth
gexd make middleware Logging --on core/middleware

πŸ› οΈ Utility Components

Description: Generate reusable widget components

gexd make widget CustomButton
gexd make widget UserCard --location shared

Description: Generate utility helper classes

gexd make util DateUtils
gexd make util ValidationUtils --on core/utils

Description: Generate constant definition files

gexd make constant ApiConstants
gexd make constant AppConstants --on core/constants

🎯 Command Categories

πŸ“± UI Components

  • screen - Complete screen with controller, view, binding

  • view - UI view components

  • widget - Reusable widget components

πŸ”§ State Management

  • controller - State controllers

  • binding - Dependency injection bindings

  • middleware - Request/response middleware

πŸ“Š Data Management

  • model - Data models with serialization

  • repository - Data access repositories

  • service - Business logic services

  • provider - Data source providers

πŸ—οΈ Architecture

  • entity - Domain entities

  • interface - Contract abstractions

  • exception - Custom exceptions

πŸ› οΈ Utilities

  • util - Helper utilities

  • constant - Application constants


πŸš€ Common Usage Patterns

πŸ“± Complete Feature Generation

# Generate a complete user management feature
gexd make screen UserProfile --type withState --has-model
gexd make model User --file assets/user.json --relationships-in-folder
gexd make repository User --type crud --interface
gexd make service User --on auth/services
gexd make binding User --location screen --on-screen user_profile

πŸ—οΈ Clean Architecture Setup

# Domain layer
gexd make entity User --on domain/entities
gexd make interface User --on domain/repositories

# Data layer  
gexd make model User --file user.json --on data/models
gexd make repository User --on data/repositories
gexd make provider User --on data/providers

# Presentation layer
gexd make screen UserProfile --on presentation/pages
gexd make controller User --on presentation/controllers

πŸ“Š API Integration Workflow

# 1. Generate model from API
gexd make model Product --url https://api.store.com/products/1

# 2. Create data access layer
gexd make repository Product --type crud --interface
gexd make provider Api --on data/providers

# 3. Business logic layer
gexd make service Product --on services

# 4. UI layer
gexd make screen ProductList --type withState --model Product
gexd make widget ProductCard --location shared

βš™οΈ Global Options

Most make subcommands support these common options:

πŸ“ Organization

  • --on <path> - Specify subdirectory for generated files

  • --force - Force overwrite existing files without prompting

🎨 Customization

  • --type <type> - Specify component type/style

  • --template <template> - Choose generation template

  • --style <style> - Select code generation style

πŸ”§ Features

  • --interface - Generate with interface abstraction

  • --immutable - Create immutable data structures

  • --copyWith - Add copy methods for state updates


πŸ’‘ Pro Tips

🎯 Best Practices

  1. Start with Architecture: Generate entities and interfaces first

  2. Use --on for Organization: Keep related files in subdirectories

  3. Enable Interfaces: Use --interface for better testability

  4. Force During Development: Use --force for rapid iteration

πŸš€ Efficiency Tips

  1. Batch Generation: Generate related components together

  2. Template Reuse: Save commonly used flag combinations

  3. API-First Development: Generate models from live APIs

  4. Relationship Management: Use --relationships-in-folder for complex models

πŸ”§ Advanced Workflows

  1. Feature-Based: Group components by feature using --on

  2. Layer-Based: Organize by architectural layers

  3. Test-Driven: Generate interfaces first for better testing

  4. Iterative: Start simple, add features with --force


For detailed documentation on each subcommand, click the links above or visit:


Generated automatically by gexd_doc

Last updated