devforge 1.3.1 copy "devforge: ^1.3.1" to clipboard
devforge: ^1.3.1 copied to clipboard

CLI tool to generate Flutter/Dart boilerplate code.

devforge #

A powerful and flexible Command Line Interface (CLI) tool for generating common Flutter/Dart boilerplate code directly into your project. Stop writing the same utility files over and overβ€”let devforge handle the heavy lifting!

DevForge works best inside a Flutter/Dart app and focuses on scaffolding production-ready services (API client, FCM, storage, pagination, BLoC, GetX, app icons, etc.) via a simple CLI.


✨ Features #

devforge offers both direct command execution and an interactive mode to quickly scaffold necessary services and utilities:

  • ApiClient Service: Creates an api_client.dart file with Dio-based API calling setup plus a logger_interceptor.dart.
  • Assets Utility Generation: Creates an assets_utils.dart file with static paths for all resources in your assets folder.
  • FCM Service Scaffold: Generates a standard fcm_service.dart for handling Firebase Cloud Messaging setup.
  • Refresh Token Service: Scaffolds a dedicated refresh_token.dart service for managing token refresh logic.
  • Local Storage Service: Creates either SharedPreferencesService or GetStorageService to store data locally.
  • Sqflite Service: Creates a sqflite_service.dart to store data locally using sqflite.
  • Pagination Utilities: Creates a pagination_controller.dart and reusable paging_list_view.dart / paging_custom_scroll_view.dart widgets.
  • BLoC Boilerplate: Creates a basic BLoC folder structure with bloc.dart, state.dart, and event.dart files.
  • GetX Boilerplate: Creates a basic GetX folder structure with controller.dart, bindings.dart, and screen.dart files.
  • App Icon Generator: Generates app icons of different sizes for all supported platforms.
  • Interactive Mode: Use the devforge run command for a friendly, menu-driven generation experience.

Note: Localization-related generators exist in the codebase, but there is currently no stable devforge localize CLI command wired up. This may change in a future release.


πŸ“‹ Requirements #

  • Dart SDK: >=3.0.0 <4.0.0
  • A Flutter/Dart project where generated files will be placed (usually under lib/).
  • Make sure your global pub bin directory (e.g. ~/.pub-cache/bin) is in your PATH.

πŸš€ Installation #

1. Activate the package #

Activate devforge globally using the Dart package manager. This makes the devforge command available anywhere on your system:

dart pub global activate devforge

2. Verify installation #

Run the help command to confirm devforge is installed and working correctly:

devforge --help

or:

devforge -h

3. Check the installed version #

devforge --version

or:

devforge -v

πŸ‘¨β€πŸ’» Usage #

There are two primary ways to use DevForge: interactive mode and direct commands.

1. Interactive mode (devforge run) #

For generating multiple files at once or for a guided experience, use the run command:

devforge run

This launches an interactive multi-select menu and lets you choose which services you want to generate:

? Select what you have to generate:

[ ] Generate ApiClient
[ ] Generate AssetsUtils
[ ] Generate FcmService
[ ] Generate RefreshToken service
[ ] Generate Local Storage Service
[ ] Generate SqfliteService
[ ] Generate Pagination Service
[ ] Generate BLoC folder
[ ] Generate Getx folder
[ ] Generate App icons

2. Direct commands #

Use these commands for quick, single-purpose generation:

Command Description Output file(s) / effect
devforge generate_config Generates a devforge.yaml configuration file in the current project. devforge.yaml in the project root
devforge userInfo Opens an interactive prompt to update your stored name (used in generated file comments). Updates user name stored in DevForge config
devforge show_user_name Prints your currently saved user name. Outputs the saved name in the terminal
devforge api_client Generates a boilerplate service for handling API calls. lib/api_client.dart, lib/logger_interceptor.dart
devforge assets Scans the assets/ folder and generates the assets utility file. lib/assets_utils.dart
devforge fcm Generates a boilerplate service for handling FCM. lib/fcm_service.dart
devforge refresh Generates the service for managing refresh token logic. lib/refresh_token.dart
devforge local_storage Interactively chooses and generates either shared_preferences or get_storage service. lib/shared_preferences_service.dart or lib/get_storage_service.dart
devforge sqflite Generates a sqflite singleton service. lib/sqflite_service.dart
devforge pagination Generates a controller and reusable widgets for paginated lists. lib/pagination_controller.dart, lib/paging_list_view.dart, lib/paging_custom_scroll_view.dart
devforge bloc Generates a BLoC directory with bloc.dart, state.dart, and event.dart. BLoC folder (path chosen interactively)
devforge getx Generates a GetX directory with controllers, bindings, and views. GetX folder (path chosen interactively)
devforge app-icon Generates app icons of different sizes in platform-specific folders. Platform-specific icon assets

If you pass --help with no command, you’ll see the full list of supported commands.


πŸ› οΈ Configuration #

DevForge stores your author name and can also generate a project-level configuration file.

  • On first run, DevForge will prompt you for your name (used in generated file comments).
  • You can update it later with:
devforge userInfo
  • To see your currently saved name:
devforge show_user_name
  • To generate or regenerate the main configuration file in your project:
devforge generate_config

This creates a devforge.yaml file in the current directory, which you can customize to tweak how generators behave.


πŸ“‚ Output structure #

Generated files are placed in the lib/ directory or in a subfolder you specify:

  • Service files (API client, FCM, storage, sqflite, pagination) are created directly under lib/ by default.
  • For folder-based generators (BLoC / GetX), you can choose the target path where the new directory and files will be created.
  • App icons are generated in platform-specific asset folders (e.g. Android/iOS).

πŸ§‘β€πŸ’» Development #

If you want to work on DevForge itself:

  1. Clone the repository:

    git clone https://github.com/prathamesh-mali/devforge.git
    cd devforge
    
  2. Fetch dependencies:

    dart pub get
    
  3. Run the CLI locally:

    dart run bin/devforge.dart --help
    
  4. Run tests:

    dart test
    

πŸ“ License #

MIT License. See LICENSE for details.

0
likes
0
points
75
downloads

Publisher

unverified uploader

Weekly Downloads

CLI tool to generate Flutter/Dart boilerplate code.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

args, dio, http, image, interact, intl, path, shared_preferences, yaml

More

Packages that depend on devforge