Noctui's UI model and reusable rendering core are written in MoonBit, without abinding to a foreign UI runtime such as OpenTUI. Native terminal integrationisolates unavoidable operating-system interaction behind a narrow platformadapter so it does not leak into application, View, or component APIs.
Noctui treats ordinary CLI output, interactive prompts, and full-screen TUIs asdifferent surfaces over one terminal UI foundation. They can share logicalstyles, Unicode and layout rules, renderer-neutral Views, and semanticcomponents without sharing one event loop or terminal lifecycle:
ordinary CLI output renders a View to ANSI text and writes it withoutstarting an interactive runtime;
a prompt adds question flow, input, validation, redraw, and cleanup aroundthe shared presentation contracts; and
a full-screen TUI adds application state, events, frame rendering, bufferdiffing, and terminal-session ownership.
The three surfaces are therefore neither separate products nor three identicalruntimes. Noctui keeps reusable presentation below them and puts interactionand resource ownership in the surface that needs it. This lets a CLI grow fromstyled output to prompts or a full-screen interface without defining itsstyles, text semantics, and common components again.
Developers changing Noctui should start with therepository architecture. The implemented interactiveApplication and Runtime contract is defined in theTUI architecture.
There is no MoonBit-first TUI toolkit comparable to ratatui or Charm. The oneexisting terminal-UI option, onebit-tui,is a binding to OpenTUI rather than a pure-MoonBit library.
Noctui exists to fill that gap: a from-scratch foundation whose semantic andrendering layers are pure MoonBit. Narrow platform packages provide theunavoidable Node.js 22 and native POSIX terminal integration. SelectingMoonBit's JavaScript backend does not by itself select a JavaScript host:Noctui's JavaScript terminal and standard-stream packages are explicitly Nodepackages and do not claim browser, Deno, or Bun support.
Name — coined by truncating noctuid (the night moths), which naturallyembeds "tui" the way ratatouille → ratatui does. The "noct-" (night) rootalso evokes the terminal: a dark screen you work against.
Design — the renderer-neutral core and TUI Application/Runtime areimplemented and documented. Target entry packages expose blocking nativeexecution and host-managed Node execution over the same runtime semantics.
The examples index is a runnable path from a minimalrendered View through styling, layout, reusable components, and full-screenterminal applications on the native and Node.js hosts. It also documents theNode runtime lifecycle example and its automated PTY smoke scenario.