Skip to content

Packages

Rezi is organized as a monorepo with multiple packages, each with distinct responsibilities.

Installation

Most applications need only two packages:

npm install @rezi-ui/core @rezi-ui/node

Package Overview

flowchart TB
    App["Your Application"] --> Core
    JSX["@rezi-ui/jsx"] -.-> Core
    InkCompat["@rezi-ui/ink-compat"] -.-> Core
    Core["@rezi-ui/core"] --> Node
    Node["@rezi-ui/node"] --> Native
    Native["@rezi-ui/native"] --> Engine["Zireael C Engine"]
Package Description npm
@rezi-ui/core Widgets, layout, themes, forms, keybindings npm i @rezi-ui/core
@rezi-ui/node Node.js backend with worker threads npm i @rezi-ui/node
@rezi-ui/native Native addon (napi-rs + Zireael) Bundled with node
@rezi-ui/ink-compat Drop-in Ink compatibility layer (React) npm i @rezi-ui/ink-compat
@rezi-ui/jsx JSX runtime for Rezi widgets npm i @rezi-ui/jsx
@rezi-ui/testkit Testing utilities and fixtures npm i -D @rezi-ui/testkit
create-rezi Project scaffolding CLI npm create rezi

@rezi-ui/core

Runtime-agnostic TypeScript core

The core package is the heart of Rezi. It contains:

  • All widget constructors (ui.text, ui.button, ui.table, etc.)
  • Layout engine with flexbox-like semantics
  • Theme system with six built-in presets
  • Form management and validation
  • Keybinding parser with chord support
  • Focus management utilities
  • Binary protocol builders and parsers

Critically, this package has no Node.js-specific dependencies. It can theoretically run in any JavaScript runtime.

import { createApp, ui, rgb, darkTheme } from "@rezi-ui/core";

Full documentation →

@rezi-ui/node

Node.js runtime backend

The Node.js backend provides the runtime integration:

  • Worker thread management for async rendering
  • Event loop integration
  • Terminal capability detection
  • Debug tracing and performance instrumentation
import { createNodeBackend } from "@rezi-ui/node";

const app = createApp({
  backend: createNodeBackend(),
  initialState: {},
});

Full documentation →

@rezi-ui/native

Native addon (N-API + Zireael)

The native package contains the napi-rs binding to the Zireael C rendering engine:

  • Terminal I/O with platform-specific optimizations
  • Binary protocol handling
  • Prebuilt binaries for Linux, macOS, and Windows

This package is automatically installed as a dependency of @rezi-ui/node.

Full documentation →

@rezi-ui/testkit

Testing utilities

Helper package for testing Rezi applications:

  • Mock backends for unit testing
  • Test fixtures for protocol testing
  • Golden file comparison utilities
npm install --save-dev @rezi-ui/testkit

Full documentation →

create-rezi

Project scaffolding CLI

Generate a ready-to-run Rezi app with TypeScript configured and a multi-panel template:

npm create rezi my-app

Full documentation →

@rezi-ui/ink-compat

Ink compatibility layer

Drop-in replacement for Ink imports that runs on Rezi's native rendering engine:

  • All 6 Ink components (Box, Text, Spacer, Newline, Transform, Static)
  • All 7 Ink hooks (useInput, useApp, useFocus, useFocusManager, useStdin, useStdout, useStderr)
  • render() function with all standard options
npm install @rezi-ui/ink-compat react

Full documentation → | Migration guide →

@rezi-ui/jsx

JSX runtime

Native JSX runtime that maps JSX elements directly to Rezi VNodes (no React required):

npm install @rezi-ui/jsx

Full documentation → | Getting started →

Dependency Flow

The package dependency structure enforces a clean separation of concerns:

Application Code (ui.* API or JSX)
       ├─── @rezi-ui/jsx (optional JSX runtime)
       ├─── @rezi-ui/ink-compat (optional Ink React compat)
@rezi-ui/core (No Node APIs)
       │ used by
@rezi-ui/node (Worker threads, event loop)
       │ binds to
@rezi-ui/native (C engine via N-API)
Zireael C Engine (Terminal rendering)

Versioning

All publishable packages share a single version number. This simplifies dependency management and ensures compatibility between packages.

Current versions can be checked in each package's package.json or via npm:

npm info @rezi-ui/core version
npm info @rezi-ui/node version

Development Packages

The following packages are used for development only and are not published:

Package Purpose
@rezi-ui/bench Performance benchmarks