5 As JackDouglas observes in a comment, the principal advantage of a text-based program is that you don't need to be either (a) sat in front of the machine, or (b) connected using a screen/window-sharing protocol, in order to run a TUI.
1 In addition to the points mentioned in the other answer, it is very relevant that TUI applications ensure that you don't need a mouse to use them (and few even support mouse usage, Vim and Midnight Commander being examples that do), while GUI ones are usually over reliant on mouse. Reaching for the mouse too much is often harmful to productivity.
Does encrypting a secret used in a script more secure than having it plaintext, if the script is in the same server and decrypts it back? 3