Try to use rlwrap for these purposes:
rlwrap runs the specified command, intercepting user input in order to provide readline’s line editing, persistent history and completion.
rlwrap tries to be completely transparent − you (or your shell) shouldn’t notice any difference between command and rlwrap command − except the added readline functionality, of course. This should even hold true when you are re−directing, piping and sending signals from and to command, or when command manipulates its terminal settings.
There are many options to add (programmable) completion, handle multi−line input, colour and re−write prompts. If you don’t need them (and you probably don’t), you can skip the rest of this manpage.