I would solve this by not asking for the password and just putting a password placeholder in the generated command.
Another potential benefit of entering the PW in the field is that the generator could take care of proper escaping – think, if the password contains spaces, quotes, asterisks, $ signs, or other bash shenanigans. (That, by the way, doesn’t seem to work right now, @OP.)
Another idea could be to allow entering an env variable name instead of a value.
[0]: https://dev.mysql.com/doc/refman/8.0/en/mysql-config-editor....