In addition to groovy, the Groovy installation comes with several helpful tools, covered in this chapter.
Console
The Groovy Console is a quick and easy way to try things in Groovy visually without the overhead of a complete IDE.
Whenever you have an idea you want to try out quickly, open the Groovy Console, type some code, and then press Ctrl+R to run it. After reading your output and changing the code, press Ctrl+W to clear the output and Ctrl+R again to run the code. Once you get used to those two shortcuts, the Groovy Console might become an indispensable development tool.
It also has the ability (among other things) to inspect the AST (Abstract Syntax Tree) of your code, the internal representation of the code used by the compiler. Use Script - Inspect Ast or Ctrl+T to open the Groovy AST Browser.
Compilation
Much like javac, groovyc compiles Groovy code to JVM byte-code (*.class files). It is not strictly necessary to compile before running. You can use the groovy command to run a groovy script file which typically end in .groovy but can have any extension.
To take advantage of the JDK 7+ invoke-dynamic instruction, use the --indy flag.1 This also works with the groovy command.
Invoke-dynamic helps the compiler improve the performance of things like duck-typing, meta-programming, and method-missing calls.
Shell
The Groovy shell can be used to execute Groovy code in an interactive command shell.
Exercise
Try it out!
Documentation
This tool generates documentation from your Groovy code.
You could access those documents from the AST at compile time (this can be useful when writing AST transformations, for example).