Pub Version GitHub Stars License: MIT Dart

🧩 Teuton Feature CLI

A powerful CLI tool that generates production-ready Flutter features using Clean Architecture, Cubit state management, and GetIt dependency injection β€” in seconds.

✨ Features

  • πŸ—οΈ Clean Architecture scaffolding with separation of concerns
  • πŸ”„ Cubit state management with built-in error handling
  • πŸ’‰ GetIt dependency injection setup
  • πŸ“ Consistent, industry-standard folder structure
  • ⚑ Generate complete features with a single command
  • 🎯 Production-ready code templates
  • πŸ”§ Customizable templates and naming conventions

πŸš€ Quick Start

Installation

Install globally from pub.flutter-io.cn:

dart pub global activate teuton_feature

Or install from source:

dart pub global activate --source path .

Usage

Navigate to your Flutter project and run:

teuton_feature create <feature_name>

Programmatic example

If you prefer using the generator from Dart code (e.g. scripts/tools), there is a runnable example in example/teuton_feature_example.dart that uses the minimal template (no Flutter dependency required):

dart run example/teuton_feature_example.dart

This creates a temporary sandbox, generates a profile feature with the minimal template, and prints the files created. You can adapt this approach in your own tooling by importing:

import 'package:teuton_feature/teuton_feature.dart';

final cfg = TeutonConfig(featuresPath: 'lib/features');
FeatureGenerator(config: cfg).generate(const CreateOptions(
  feature: 'profile',
  template: 'minimal',
));

πŸ“– Commands

Create a Feature

teuton_feature create profile

Create with Custom Path

teuton_feature create profile --path lib/modules

List Available Templates

teuton_feature templates

Flags and Options

  • Global:

    • --help, -h: Show help
    • --version, -v: Show version
  • create <name>:

    • --path, -p: Base features path (overrides config)
    • --template, -t: Template to use (default | minimal)
    • --dry-run: Simulate without writing files
    • --verbose, -v: Verbose output
  • delete <name>:

    • --force, -f: Do not ask for confirmation
    • --path, -p: Base features path (overrides config)
  • list:

    • --path, -p: Base features path (overrides config)

πŸ“‚ Generated Architecture

lib/features/profile/
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ datasources/
β”‚   β”‚   β”œβ”€β”€ profile_local_datasource.dart
β”‚   β”‚   └── profile_remote_datasource.dart
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   └── profile_model.dart
β”‚   └── repositories/
β”‚       └── profile_repository_impl.dart
β”œβ”€β”€ domain/
β”‚   β”œβ”€β”€ entities/
β”‚   β”‚   └── profile_entity.dart
β”‚   β”œβ”€β”€ repositories/
β”‚   β”‚   └── profile_repository.dart
β”‚   └── usecases/
β”‚       β”œβ”€β”€ get_profile.dart
β”‚       └── update_profile.dart
└── presentation/
    β”œβ”€β”€ cubit/
    β”‚   β”œβ”€β”€ profile_cubit.dart
    β”‚   └── profile_state.dart
    β”œβ”€β”€ pages/
    β”‚   └── profile_page.dart
    └── widgets/
        └── profile_widget.dart

πŸ’‘ Example Output

$ teuton_feature create chat
πŸš€ Generating feature: chat
βœ… Created data layer (3 files)
βœ… Created domain layer (4 files)
βœ… Created presentation layer (4 files)
βœ… Updated dependency injection
πŸŽ‰ Feature "chat" created successfully!

Next steps:
1. Add your API endpoints in chat_remote_datasource.dart
2. Implement business logic in chat use cases
3. Update chat_cubit.dart with your state logic
4. Import ChatPage in your routing

πŸ› οΈ Configuration

Create a teuton_config.yaml in your project root:

features_path: lib/features
default_template: default
author: Your Name
organization: com.example
templates:
  - default
  - minimal

🧰 Why Teuton Feature CLI?

  • 🎯 Consistency: Ensures all team members follow the same architecture
  • ⚑ Speed: Generate complete features in seconds, not hours
  • πŸ—οΈ Best Practices: Implements proven Clean Architecture patterns
  • πŸ”§ Maintainable: Clear separation of concerns makes code easy to modify
  • πŸ“š Educational: Learn Clean Architecture through generated examples

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

πŸ“œ License

MIT Β© 2025 Carlos DΓ­az (Teutondev)


Built with ❀️ by Teutondev

Libraries

teuton_feature
Public API exports for programmatic usage of teuton_feature.