Telnet

Telnet is a command line based program used to connect to servers designed for interactive communication. Many operating systems include a telnet client by default including Windows, Mac, Linux and other UNIX variants. One may connect to Nethack.alt.org to play Nethack online by typing

telnet nethack.alt.org

If Telnet is not for you, you may try PuTTY which is similar, yet more feature-rich.

It should be noted that no command line interface is quite the same as any other, and thus connecting through Telnet to Nethack.alt.org on different computers may cause strange results. For example, after getting used to playing on Linux, one may decide to enable DECgraphics. Windows' cmd.exe does not seem to display Nethack correctly when using this option.