create a file in tool folder called build.dart and put next code on it:

import 'package:build_runner/build_runner.dart';
import 'package:serializable/action.dart';
main() async {
// In next line replace `example/*.dart` for the globs you want to use as input, for example `**/*.dart`
// to take all the dart files of the project as input.
await build([serializableAction(const ['example/*.dart'])],deleteFilesByDefault: true);
}

run tool/build.dart. Then you will see that the file bin/models.g.dart
has been generated and it will contains the next code: