PitchHut logo
Build fast, multi-panel terminal applications with type-safe efficiency.
Pitch

Rezi is a TypeScript framework designed for developing sophisticated terminal applications. With features like structured layouts, focus handling, and a robust widget system, it empowers developers to create dynamic dashboards and internal tools with near-native performance. It's ideal for anyone needing an enhanced terminal experience.

Description

Rezi is a powerful TypeScript framework specifically designed for creating terminal applications on Node.js and Bun, providing near-native performance through its deterministic C engine, the Zireael engine. It caters to developers looking for robust solutions for building dashboards, control panels, internal tools, log viewers, and other developer workflows that transcend traditional line-oriented outputs.

Key Features

  • Structured Application Model: Develop comprehensive TUI workflows with a clear app architecture.
  • Declarative Widget API: Create applications without relying on React, while still leveraging a rich set of interactive widgets.
  • Native Performance: Experience fast, responsive applications with a framebuffer diffing mechanism for efficient rendering and terminal output.
  • Wide Range of Widgets: Access first-party widgets for forms, tables, overlays, routing, charts, and command flows, which enhance user experience.
  • Testing Support: Conduct behavior-first tests with reproducible rendering and input contracts, ensuring integrity in application functionality.

Comprehensive Components

Rezi includes various layout primitives and interactive widgets that facilitate building complex terminal interfaces:

  • Layout options such as rows, columns, grids, and panels.
  • Interactivity through buttons, inputs, checkboxes, tables, dialogs, and more.
  • Graphics and data visualization features, including charts, gauges, and sparklines.
  • Application-handling capabilities: focus management, keybindings, routing, and controlled state updates.
  • Testing utilities designed for render assertions, routing behavior, and replayable input workflows.

Example Usage

Developers can easily start building their applications using the example provided:

import { ui } from "@rezi-ui/core";
import { createNodeApp } from "@rezi-ui/node";

type State = { count: number };

const app = createNodeApp<State>({ initialState: { count: 0 } });

app.view((state) =>
  ui.page({
    p: 1,
    gap: 1,
    header: ui.header({ title: "Counter" }),
    body: ui.panel("Count", [
      ui.row({ gap: 1, items: "center" }, [
        ui.text(String(state.count), { variant: "heading" }),
        ui.spacer({ flex: 1 }),
        ui.button({
          id: "inc",
          label: "+1",
          intent: "primary",
          onPress: () => app.update((s) => ({ count: s.count + 1 })),
        }),
      ]),
    ]),
  }),
);

app.keys({ q: () => app.stop() });
await app.run();

Getting Started

To quickly set up a new project, developers can use the following commands:

npm create rezi my-app
cd my-app
npm run start

With Bun:

bun create rezi my-app
cd my-app
bun run start

Learning Resources

Further resources include comprehensive documentation and guides:

Rezi is currently in pre-alpha, actively undergoing development with a focus on enhancing core features. It is ideal for developers seeking an open-source tool for building next-generation terminal applications.

0 comments

No comments yet.

Sign in to be the first to comment.