Add command
Add packages, services, or new features using templates.
eli add <sub-command>
The eli add
command lets you expand your existing project by integrating new features, dependencies, or platform support. Whether you're adding packages, services, or complete features, this command helps streamline the process, ensuring your project grows efficiently and remains maintainable.
packages
Add a new Eli platform package to your project to extend its functionality.
Usage: eli add packages [arguments]
-h, --help Print this usage information.
platforms
Integrate a new Eli services into your project.
Usage: eli add platforms [arguments]
-h, --help Print this usage information.
--services Which platform services do you want to create?
[core, analytics, messaging, observability]
template <sub-command>
The eli add template command allows you to add various components to an existing feature in your project.
source
Add a new data source to an existing feature, useful for integrating external APIs, local databases, or other data services.
Usage: eli add template source [arguments]
-h, --help Print this usage information.
--source_type Choose the type of data source type
[local, remote]
--source_name What's the class name of the Data Source?
--feature_name What's the folder name of the feature?
-o, --output The output directory
├── domain
│ ├── entities
│ │ └── my_feature_entity.dart
│ ├── local_sources
│ │ └── my_feature_local_data_source.dart
│ └── remote_sources
│ └── my_feature_remote_data_source.dart
└── infrastructure
├── dto
│ └── my_feature_dto.dart
├── local_sources
│ ├── my_feature_box.dart
│ └── my_feature_local_data_source.dart
└── remote_sources
└── my_feature_remote_data_source.dart
repository
Add a repository layer to an existing feature, ideal for handling data operations and providing a clean abstraction over your data sources.
Usage: eli add template repository [arguments]
-h, --help Print this usage information.
--repository_name What's the class name of the repository?
--feature_name What's the folder name of the feature?
--repository_methods Can you add repository's methods names?
--repository_constructor Can you add repository's constructor attr.?
-o, --output The output directory
├── config
│ └── di
│ └── my_feature_injection.dart
├── domain
│ └── repositories
│ └── my_feature_repository.dart
└── infrastructure
└── repositories
├── my_feature_fake_repository.dart
└── my_feature_impl_repository.dart
bloc
Generate a new Bloc to manage the feature's state using the Bloc pattern.
Usage: eli add template bloc [arguments]
-h, --help Print this usage information.
--name What's the class name of the Bloc?
--feature What's the folder name of the feature?
--repository What's the name of the repository class?
-o, --output The output directory
├── application
│ └── bloc
│ └── my_feature
│ ├── my_feature_bloc.dart
│ ├── my_feature_event.dart
│ └── my_feature_state.dart
├── domain
│ ├── entities
│ ├── local_sources
│ ├── remote_sources
│ └── repositories
│ └── my_feature_repository.dart
├── infrastructure
│ ├── dto
│ ├── local_sources
│ ├── remote_sources
│ └── repositories
│ ├── my_feature_impl_repository.dart
│ └── my_feature_mock_repository.dart
└── presentation
├── extensions
├── navigation
├── pages
└── widgets
└── my_feature_view.dart
cubit
Create a new Cubit to handle state management, offering a simpler alternative to Bloc for managing feature state.
Usage: eli add template cubit [arguments]
-h, --help Print this usage information.
--name What's the class name of the Cubit?
--feature Which feature do you want to create a cubit for?
--repository What's the folder name of the feature?
-o, --output The output directory
├── application
│ └── cubit
│ └── my_feature
│ ├── my_feature_cubit.dart
│ └── my_feature_state.dart
├── domain
│ ├── entities
│ ├── local_sources
│ ├── remote_sources
│ └── repositories
│ └── my_feature_repository.dart
├── infrastructure
│ ├── dto
│ ├── local_sources
│ ├── remote_sources
│ └── repositories
│ ├── my_feature_impl_repository.dart
│ └── my_feature_mock_repository.dart
└── presentation
├── extensions
├── navigation
├── pages
└── widgets
└── my_feature_view.dart
feature
Generate a fully structured new feature, including the domain, infrastructure, and presentation layers, following clean architecture principles.
Usage: eli add template feature [arguments]
-h, --help Print this usage information.
--name What's the folder name of the feature?
--state_management=<TemplateStateManagement.bloc,TemplateStateManagement.cubit,TemplateStateManagement.none> What's the state management of the feature?
[bloc, cubit, none]
-o, --output The output directory
├── application
│ └── bloc
│ ├── my_feature_detail
│ │ ├── my_feature_detail_bloc.dart
│ │ ├── my_feature_detail_event.dart
│ │ └── my_feature_detail_state.dart
│ └── my_feature_list
│ ├── my_feature_list_bloc.dart
│ ├── my_feature_list_event.dart
│ └── my_feature_list_state.dart
├── config
│ ├── di
│ │ └── my_feature_injection.dart
│ └── router
│ └── my_feature_router.dart
├── domain
│ ├── entities
│ │ └── my_feature
│ │ ├── my_feature_detail_entity.dart
│ │ └── my_feature_entity.dart
│ ├── local_sources
│ │ └── my_feature_local_datasource.dart
│ ├── remote_sources
│ │ └── my_feature_remote_datasource.dart
│ └── repositories
│ └── my_feature_repository.dart
├── infrastructure
│ ├── dto
│ │ └── my_feature
│ │ ├── my_feature_detail_dto.dart
│ │ ├── my_feature_detail_dto.g.dart
│ │ ├── my_feature_list_dto.dart
│ │ └── my_feature_list_dto.g.dart
│ ├── local_sources
│ │ ├── my_feature_box.dart
│ │ └── my_feature_impl_local_data_source.dart
│ ├── remote_sources
│ │ └── my_feature_impl_remote_data_source.dart
│ └── repositories
│ ├── my_feature_fake_repository.dart
│ └── my_feature_impl_repository.dart
└── presentation
├── extensions
├── pages
│ ├── detail
│ │ └── my_feature_detail_page.dart
│ └── list
│ └── my_feature_list_page.dart
└── widgets
├── detail
│ ├── my_feature_detail_bloc_content_view.dart
│ └── my_feature_detail_bloc_view.dart
└── list
├── my_feature_list_bloc_content_view.dart
└── my_feature_list_bloc_view.dart
feature-base
Create a minimal base feature structure with only the essential components, ready for further customization.
Usage: eli add template feature-base [arguments]
-h, --help Print this usage information.
--name What's the folder name of the feature?
-o, --output The output directory
├── application
├── config
│ └── di
│ └── my_feature_injection.dart
├── domain
│ ├── entities
│ │ └── my_feature
│ │ ├── isdetail_my_feature_detail_entity.dart
│ │ └── my_feature_entity.dart
│ ├── local_sources
│ │ └── my_feature_local_datasource.dart
│ ├── remote_sources
│ │ └── my_feature_remote_datasource.dart
│ └── repositories
│ └── my_feature_repository.dart
├── infrastructure
│ ├── dto
│ │ └── my_feature
│ │ ├── isdetail_my_feature_detail_dto.dart
│ │ ├── isdetail_my_feature_detail_dto.g.dart
│ │ ├── islist_my_feature_list_dto.dart
│ │ └── islist_my_feature_list_dto.g.dart
│ ├── local_sources
│ │ ├── my_feature_box.dart
│ │ └── my_feature_impl_local_data_source.dart
│ ├── remote_sources
│ │ └── my_feature_impl_remote_data_source.dart
│ └── repositories
│ ├── my_feature_fake_repository.dart
│ └── my_feature_impl_repository.dart
└── presentation
├── extensions
└── pages
feature-structure
Generate only the directory structure for a new feature, without any specific file content, following clean architecture best practices.
Usage: eli add template feature-structure [arguments]
-h, --help Print this usage information.
--name What's the folder name of the feature?
-o, --output The output directory
├── application
├── domain
│ ├── entities
│ ├── local_sources
│ ├── remote_sources
│ └── repositories
├── infrastructure
│ ├── dto
│ ├── local_sources
│ ├── remote_sources
│ └── repositories
└── presentation
├── extensions
├── navigation
├── pages
└── widgets