nit_helper 1.4.0 copy "nit_helper: ^1.4.0" to clipboard
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
    %APPDATA%\Pub\Cache\bin
    
    to the Path variable.

๐Ÿงช 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 build
  • fluttergen

๐Ÿ–ฅ 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 generate
  • serverpod 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

1
likes
0
points
22
downloads

Publisher

unverified uploader

Weekly Downloads

A CLI tool for building Flutter and Serverpod projects with fvm support.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

args, http

More

Packages that depend on nit_helper