quick google search reveals that key bindings and tab completion can be done using the readline module without reinventing the wheel. So we don't need to catch non-printable key sequences, implement cursor movements, and so on. Just implement a completion function responsible for parsing current input line.
next step: parse commands and execute implementations