A "ReadInput" console/TTY API, that either wraps around the ReadConsole function from kernel32 (or use ReadFile for reading from serial ports, for TTYs), together with an auto-completion interface (this would be used by cmd.exe; I am currently modeling it based from cmdinput.c + filecomp.c ; this would also be inspired by the GNU ReadLine library);
Additional wrapper functions around the console aliases and history APIs, with additional functionalities like saving / restoring aliases & history contents inside files (both cmd.exe and doskey.exe would use those functions).