nit_helper 1.4.0
nit_helper: ^1.4.0 copied to clipboard
A CLI tool for building Flutter and Serverpod projects with fvm support.
nit-helper #
nit-helper is a cross-platform Dart CLI tool designed to automate building Flutter and Serverpod projects.
The tool automatically detects the necessary directories (*_flutter, *_server) and executes the appropriate commands, with optional fvm support.
โจ Features #
- ๐ฆ Automatic Flutter module building
- ๐ Code generation and migrations for Serverpod
- ๐ Support for
fvm(Flutter Version Management) - ๐ง Smart project structure navigation
- ๐ง Commands unified in a single CLI:
nit-helper - ๐๏ธ Unused files detection and cleanup
๐ Installation #
dart pub global activate nit_helper
Ensure that the Dart global utilities path is added to PATH:
- Linux/macOS:
export PATH="$PATH:$HOME/.pub-cache/bin" - Windows:
Open System Properties โ Advanced โ Environment Variables and add
to the%APPDATA%\Pub\Cache\binPathvariable.
๐งช Usage #
๐จ build #
Builds the Flutter project (searches for a directory ending with _flutter, or works in the current directory if it matches).
nit-helper build
With fvm:
nit-helper build --fvm
Executes commands:
dart run build_runner buildfluttergen
๐ฅ build-server #
Generates Serverpod code and applies migrations. Searches for a directory ending with _server.
nit-helper build-server
Force migration creation:
nit-helper build-server --force
With fvm:
nit-helper build-server --fvm
Executes commands:
serverpod generateserverpod create-migration(or--force)dart run bin/main.dart --role maintenance --apply-migrations
๐ build-full #
Combines build and build-server:
nit-helper build-full
With options:
nit-helper build-full --fvm --force
๐ check #
Analyzes the project for unused Dart files and provides cleanup options.
nit-helper check
With options:
# Scan specific project
nit-helper check --path ./my_project
# Exclude patterns and folders
nit-helper check --exclude-pattern "*.g.dart" --exclude-folder "generated"
# Interactive cleanup mode
nit-helper check --interactive
# Combine options
nit-helper check -p ./project -e "*.test.dart" -f "temp" -i
Features:
- Smart dependency analysis via import/export parsing
- Automatic exclusion of generated files (*.g.dart, *.freezed.dart, etc.)
- Interactive cleanup with confirmation prompts
- Cross-platform support
- Detailed size reporting
๐งฐ Arguments #
| Argument | Command | Description |
|---|---|---|
--fvm |
all commands | Execute through fvm exec |
--force |
build-server, build-full |
Force create migrations |
--path, -p |
check |
Path to project directory |
--exclude-pattern, -e |
check |
File patterns to exclude |
--exclude-folder, -f |
check |
Folders to exclude |
--interactive, -i |
check |
Enable interactive cleanup |
--details, -d |
check |
Show detailed file list |
๐ก Examples #
# Build Flutter with fvm
nit-helper build --fvm
# Build Serverpod with forced migration
nit-helper build-server --force
# Full project build
nit-helper build-full --fvm --force
# Check for unused files
nit-helper check
# Interactive cleanup with exclusions
nit-helper check --exclude-pattern "*.g.dart" --interactive
๐ Project Structure #
project_root/
โโโ my_app_flutter/
โ โโโ main.dart
โโโ my_app_server/
โ โโโ bin/main.dart
nit-helper will automatically detect where *_flutter and *_server are located and execute the appropriate commands.
๐ Acknowledgments #
Special thanks to Emad Beltaje for the original dart_unused_files package, which inspired and provided the foundation for the unused files detection functionality in the check command.
๐ License #
MIT License. ยฉ 2025 Maksim Levchenko
๐ซ Feedback #
Report bugs or suggestions: GitHub Issues