Skip to main content

Installation

OpenTUI is available as an npm package and can be installed with any JavaScript package manager. This guide covers installation, system requirements, and verification steps.

System requirements

Before installing OpenTUI, ensure you have the following prerequisites:

Required

  • Zig compiler - OpenTUI requires Zig to build the native core
  • Bun 1.3.0+ (recommended), Node.js 18+, or another JavaScript runtime
You must have Zig installed on your system to build OpenTUI packages. Visit the Zig installation guide for platform-specific instructions.

Supported platforms

OpenTUI provides pre-built binaries for:
  • macOS (x64, ARM64)
  • Linux (x64, ARM64)
  • Windows (x64, ARM64)

Install OpenTUI

Choose your preferred package manager to install the core OpenTUI package:
bun install @opentui/core
We recommend using Bun for the best development experience with OpenTUI. Bun provides faster installation, built-in TypeScript support, and is the primary runtime used by the OpenTUI team.

Framework packages

OpenTUI provides framework-specific packages for React and SolidJS:
bun install @opentui/react
Framework packages automatically include @opentui/core as a dependency.

Verify installation

Create a simple test file to verify your installation:
test.ts
import { createCliRenderer, TextRenderable } from "@opentui/core"

const renderer = await createCliRenderer()

const text = new TextRenderable(renderer, {
  id: "test",
  content: "OpenTUI is working!",
  fg: "#00FF00",
  position: "absolute",
  left: 2,
  top: 2,
})

renderer.root.add(text)
Run the test file:
bun run test.ts
You should see green text displayed in your terminal. Press Ctrl+C to exit.

Quick start with create-tui

The fastest way to get started is using the create-tui scaffolding tool:
bun create tui
This interactive CLI will:
  1. Prompt you for project configuration
  2. Set up a new OpenTUI project with best practices
  3. Install dependencies automatically
  4. Provide example code to get started

Try examples without installation

You can explore OpenTUI examples without cloning the repository:
curl -fsSL https://raw.githubusercontent.com/anomalyco/opentui/main/packages/core/src/examples/install.sh | sh

Troubleshooting

Zig not found

If you see an error about Zig not being found:
  1. Install Zig from ziglang.org/learn/getting-started/
  2. Ensure zig is in your PATH
  3. Verify installation: zig version

Build errors

If you encounter build errors:
  1. Ensure you have the latest version of Zig
  2. Clear your package manager cache
  3. Try reinstalling dependencies
rm -rf node_modules bun.lockb
bun install

Platform-specific binaries

OpenTUI automatically downloads platform-specific binaries. If you’re on an unsupported platform, you may need to build from source. See the Development Guide for instructions.

Next steps

Quickstart tutorial

Build your first TUI application

Core concepts

Learn about renderers, renderables, and layouts

Build docs developers (and LLMs) love