Skip to main content

nexo_cli 0.2.0 copy "nexo_cli: ^0.2.0" to clipboard
nexo_cli: ^0.2.0 copied to clipboard

CLI generator for Nexo-based Clean Architecture in Flutter apps. Scaffolds feature folders with Bloc or Cubit, data/domain layers, and tests.

nexo_cli #

CLI generator for Nexo-based Clean Architecture in Flutter apps.

nexo_cli scaffolds feature modules with data, domain, and presentation layers wired to Nexo patterns. Run it from the root of a Flutter app that already depends on package:nexo.


Installation #

dart pub global activate nexo_cli

Verify:

nexo_cli --help

Quick Start #

# From your Flutter app root
nexo_cli feature auth --get --create --list true

This creates lib/features/auth/ with Cubit, datasource, repository, use case, and screen.


Features #

  • 4 presentation styles: --bloc, --cubit (default), --list-cubit, --presentation-only
  • CRUD operations: --get, --create, --update, --delete
  • JSON model generation: --json '{"id": "String", "name": "String"}'
  • Freezed support: --freezed (default: on)
  • Injectable DI: --injectable (default: on)
  • Mapper generation: --mapper (default: on)
  • Mock datasources: --mock (default: on)
  • List vs single: --list true/false

Examples #

# Simple GET list
nexo_cli feature products --get

# Single object
nexo_cli feature profile --get --list false

# Full CRUD with freezed
nexo_cli feature article --get --create --update --delete --freezed

# Model from JSON
nexo_cli feature product --get --json '{"id": "String", "name": "String", "price": "double"}'

# Presentation only
nexo_cli feature settings --presentation-only --preferences --ui

# NexoListCubit for simple lists
nexo_cli feature notification --list-cubit --get

# Everything combined
nexo_cli feature order --bloc --freezed --json '{"id": "String"}' --get --create --update --delete --tests

Command-line Options #

Flag Default Description
--bloc off Generate Bloc with events/states
--cubit on* Generate Cubit with state
--list-cubit off Generate NexoListCubit
--presentation-only off Only presentation layer
--freezed / --no-freezed on Use @freezed
--injectable / --no-injectable on Use @injectable
--mapper / --no-mapper on Generate mappers
--mock / --no-mock on Generate mock datasources
--get off Generate GET use case
--create off Generate CREATE use case + request DTO
--update off Generate UPDATE use case + request DTO
--delete off Generate DELETE use case
--json '{...}' - Generate model from JSON fields
--list true/false true List vs single object
--local off Include local datasource
--preferences off Generate preferences wrapper
--extensions off Generate entity extensions
--ui off Generate pages/ and widgets/
--tests off Generate test files
--dry-run (-n) off Preview without writing
--overwrite off Overwrite existing files

*cubit is default when no style is specified.


Generated Structure #

lib/features/<name>/
├── data/
│   ├── datasources/     # interfaces, impl, mock
│   ├── models/          # model + requests/
│   ├── mappers/         # extension toDomain()
│   └── repositories/
├── domain/
│   ├── entities/
│   ├── repositories/    # interface
│   ├── usecases/
│   └── parameters/
└── presentation/
    ├── bloc/ or cubit/
    └── <name>_screen.dart

Documentation #

See DOCUMENTATION.md for the complete guide with:

  • All flags and options
  • Architecture explanation
  • JSON field generation
  • CRUD operations
  • Code templates
  • Post-generation steps
  • FAQ

Development #

dart pub get
dart format .
dart analyze
dart test

License #

See LICENSE.

0
likes
0
points
283
downloads

Publisher

unverified uploader

Weekly Downloads

CLI generator for Nexo-based Clean Architecture in Flutter apps. Scaffolds feature folders with Bloc or Cubit, data/domain layers, and tests.

Repository (GitHub)
View/report issues

Topics

#cli #codegen #flutter #architecture

License

unknown (license)

Dependencies

args, path

More

Packages that depend on nexo_cli