Code generation for Java source classes

I want to create a code generation command line tool that will pregenerate all the boilerplate code I need for a full-stack web app. It would have a couple params and would run a bash script as well as generating some boilerplate Java classes. What are the best tools to write this in Java?

I suggest you start understanding the difference between Java and JavaScript, as you are writing in the JavaScript subforum and talking about Java