Installation
Install Rezi packages from npm to start building terminal applications.
Install Rezi packages from npm to start building terminal applications.
Requirements
- Runtime: Node.js 18.18.0+ or Bun 1.3.0+
- Operating System: Linux, macOS, or Windows
- Terminal: Any terminal emulator with 256-color or true-color support
Install via npm
If you want a ready-to-run starter, use the scaffolding tool:
npm create rezi my-appInstall the core and Node.js/Bun backend packages:
npm install @rezi-ui/core @rezi-ui/nodeOr with other package managers:
npm install @rezi-ui/core @rezi-ui/nodepnpm add @rezi-ui/core @rezi-ui/nodeyarn add @rezi-ui/core @rezi-ui/nodebun add @rezi-ui/core @rezi-ui/nodePrebuilt Binaries
The @rezi-ui/node package includes prebuilt native binaries for common platforms:
| Platform | Architecture | Status |
|---|---|---|
| Linux | x64 | Included |
| Linux | arm64 | Included |
| macOS | x64 (Intel) | Included |
| macOS | arm64 (Apple Silicon) | Included |
| Windows | x64 | Included |
If a prebuilt binary is not available for your platform, the package will attempt to compile from source (requires a C toolchain).
Package Overview
| Package | Description | Required |
|---|---|---|
@rezi-ui/core | Widgets, layout, themes, forms, keybindings | Yes |
@rezi-ui/node | Node.js/Bun backend (worker/inline modes + native rendering) | Yes |
@rezi-ui/testkit | Testing utilities and fixtures | Optional |
Optional packages
| Package | When to use |
|---|---|
@rezi-ui/jsx | Prefer JSX syntax over ui.* function calls |
@rezi-ui/testkit | Testing Rezi applications |
@rezi-ui/core
The core package is runtime-agnostic and contains:
- All widget constructors (
ui.text,ui.button,ui.table, etc.) - Layout engine with flexbox-like semantics
- Theme system with built-in presets
- Form management and validation
- Keybinding parser and matcher
- Focus management utilities
- Binary protocol builders and parsers
@rezi-ui/node
The Node.js/Bun backend provides:
- Runtime execution modes (
worker,inline,auto) - Native addon binding to the Zireael C engine
- Terminal capability detection
- Event loop integration
- Debug tracing and performance instrumentation
@rezi-ui/testkit
Testing utilities for Rezi applications:
- Test fixtures for protocol testing
- Golden file comparison utilities
- Mock backends for unit testing
Install for development:
npm install --save-dev @rezi-ui/testkitTypeScript Setup
Rezi is written in TypeScript and ships with full type definitions. No additional @types/* packages are needed.
Recommended tsconfig.json settings:
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true
}
}For maximum type safety, enable these additional options:
{
"compilerOptions": {
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true
}
}Verify Installation
Create a test file to verify your installation:
// test.ts
import { ui } from "@rezi-ui/core";
import { createNodeApp } from "@rezi-ui/node";
const app = createNodeApp({
initialState: {},
});
app.view(() => ui.text("Rezi is working!"));
await app.start();Run with:
npx tsx test.tsOr with Bun:
bun run test.tsYou should see "Rezi is working!" displayed in your terminal.
Building from Source
For contributors or custom platform builds, see the Build Guide.
Next Steps
- Quickstart - Build your first Rezi application
- Examples - Learn from example applications
- Widget Catalog - Browse available widgets