Skip to content

Sorcel-Tech/sorcel_cli

Repository files navigation

Sorcel CLI

Scaffold Flutter projects and feature folders with a clean, opinionated architecture — flutter_bloc (cubits), get_it, and equatable — generating only the layers you need.

Install

dart pub global activate sorcel_cli

Make sure ~/.pub-cache/bin is on your PATH. You'll also need Flutter installed, since create uses it to scaffold the native platforms.

Quick start

sorcel create my_app --org com.acme
cd my_app
sorcel feature auth
flutter run

Add --verbose (-v) to any command for detailed, per-file output.

sorcel create

Creates a new Flutter project with the Sorcel architecture.

sorcel create my_app --org com.acme --platforms android,ios,web
Flag Description Default
-d, --description Project description A new project for Sorcel Tech
--org Reverse-domain prefix. Bundle id becomes <org>.<name> com.example
--platforms Comma-separated platforms (e.g. android,ios,web) android,ios
-o, --output Parent directory to create the project in .
--no-pub-get Skip flutter pub get off

Under the hood it runs flutter create to generate the native platform folders (ios/, android/, …), then overlays the Sorcel lib/ and pubspec.yaml on top. Native folders are intentionally not templated — they're large, version-specific, and go stale quickly.

sorcel feature

Adds a feature folder. Run it anywhere inside a project — it finds the nearest pubspec.yaml.

sorcel feature auth                  # application + presentation (default)
sorcel feature auth --with-domain    # + domain (entities, repositories)
sorcel feature auth --with-data      # + data (models, datasources, repo impl)

Beyond creating the files, it also:

  • exports the feature from lib/src/features/features.dart,
  • registers the cubit in lib/src/common/di/injector.dart,
  • ensures flutter_bloc, get_it, and equatable are in pubspec.yaml.

Names accept any casing (auth, user profile, user-profile, UserProfile) and are normalised — folders/files become snake_case, classes PascalCase.

What you get

lib/src/
├── app.dart
├── common/
│   ├── di/injector.dart            # getIt + configureDependencies()
│   ├── constants/  domain/  extensions/  router/  utilities/
│   └── presentation/theme/         # Material 3, AppColors, AppColorExtension,
│                                   # AppTextStyles, AppSpacing
└── features/
    └── <feature>/
        ├── <feature>.dart          # barrel
        ├── application/            # <feature>_cubit.dart + <feature>_state.dart
        └── presentation/pages/     # <feature>_page.dart + <feature>_view.dart

Each feature ships a cubit + an Equatable state, a Page that provides the cubit via getIt, and a View that consumes it — one class per file.

Contributing

Templates live as editable Dart files under lib/src/templates/ (project/ and feature/). After changing any template, regenerate the embedded bundles:

dart run tool/bundle.dart

See CONTRIBUTING.md for the full workflow and release steps.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages