How can I mask input from the command line? The main use case: I want to enter a password when prompted, and I need to either see * or nothing at all.
Since you can call Java libraries from Groovy, you can find your answer in the question How to hide a password in Java 5? .
In short, use Console.readPassword() (Java 6 or later).
Console.readPassword()