← Crafts
Tell preview

Tell

Platform tooling Solo engineer

Telnet for Node.js in TypeScript — option negotiation, IAC escaping, and terminal semantics without reimplementing the wire protocol.

Problem

Raw TCP sockets do not speak Telnet. Building a router CLI, serial console bridge, or device simulator means handling IAC sequences, option negotiation, subnegotiation, binary mode, and compression by hand. Most projects skip it or copy brittle parsers from decade-old snippets.

Tell wraps a socket into a TelnetStream that handles the protocol surface so application code can focus on bytes in and bytes out. The package is public on GitHub.

What it handles

  • RFC-compliant option negotiation for terminal type, window size, environment, binary mode, and compression
  • IAC escaping and subnegotiation parsing on a Node EventEmitter stream
  • Server and client entry points with configurable logging
  • Environment variable exchange and window-size tracking for TTY-aware UIs
  • zlib-backed compression path when the peer negotiates COMPRESS2
loop [session] TCP connect DO/WILL option chain negotiated options connected event user input data event write() framed output Client TelnetStream App
Connection negotiation
import { Server } from "@svene/tell";

const server = Server((connection) => {
  const [width, height] = connection.windowSize ?? [0, 0];
  connection.write(`terminal: ${connection.term ?? "unknown"}\r\n`);
  connection.write(`size: ${width}x${height}\r\n> `);

  connection.on("data", (chunk: Buffer) => {
    const input = chunk.toString("utf8").trim();
    connection.write(`you said: ${input}\r\n> `);
  });
});

server.listen(1337);
Tell MikroTik demo placeholder
Screenshot placeholder — swap for a terminal session capture from the RouterOS simulator demo.