# @opentui/core

> OpenTUI is a TypeScript library on a native Zig core for building terminal user interfaces (TUIs)

Latest version **0.5.17** (published 2026-10-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @opentui/core
pnpm add @opentui/core
yarn add @opentui/core
bun add @opentui/core
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; popular repo.

Warnings: low downloads; large bundle; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.5.17 |
| Published | 2026-10-08 |
| First published | 2025-08-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=26.4.0 |
| Dependencies | 5 |
| Unpacked size | 13.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 13400 |
| Maintainers | kommander, fanjie, thdxr |

## Links

- npm: https://www.npmjs.com/package/@opentui/core
- Repository: https://github.com/anomalyco/opentui
- Homepage: https://github.com/anomalyco/opentui#readme
- Issues: https://github.com/anomalyco/opentui/issues
- npm.io page: https://npm.io/package/@opentui/core

## Dependencies (5)

- [diff](https://npm.io/package/diff.md) 9.0.0
- [marked](https://npm.io/package/marked.md) 17.0.1
- [strip-ansi](https://npm.io/package/strip-ansi.md) 7.1.2
- [string-width](https://npm.io/package/string-width.md) 7.2.0
- [bun-ffi-structs](https://npm.io/package/bun-ffi-structs.md) 0.3.1

## Recent versions

- 0.5.17 (latest) — 2026-10-08
- 0.0.0-20261004-7dad729e (snapshot) — 2026-10-04
- 0.5.16 — 2026-10-07
- 0.5.15 — 2026-10-07
- 0.0.0-20261002-f9ace790 — 2026-10-02
- 0.0.0-20261001-d06d3aba — 2026-10-01
- 0.5.14 — 2026-09-30
- 0.5.13 — 2026-09-30
- 0.0.0-20260929-c138f0f8 — 2026-09-29
- 0.5.12 — 2026-09-22
- 0.5.11 — 2026-09-07
- 0.5.10 — 2026-09-01
- 0.0.0-20260830-b89918f6 — 2026-08-30
- 0.0.0-20260829-c2e7cb1b — 2026-08-29
- 0.0.0-20260829-75ab7375 — 2026-08-29
- … 324 more at https://npm.io/package/@opentui/core/versions

## README

<!-- Keep the project introduction aligned with the repository README and opentui.com. -->

<p align="center">
  <a href="https://opentui.com">
    <img alt="OpenTUI logo" src="https://opentui.com/opentui-logo-auto.svg" width="270" />
  </a>
</p>

<div align="center">
    <a href="https://www.npmjs.com/package/@opentui/core"><img alt="npm version" src="https://img.shields.io/npm/v/@opentui/core?style=flat-square" /></a>
    <a href="https://github.com/anomalyco/opentui/actions/workflows/build-core.yml"><img alt="Core build status" src="https://img.shields.io/github/actions/workflow/status/anomalyco/opentui/build-core.yml?style=flat-square&branch=main" /></a>
</div>

OpenTUI is a library to build terminal user interfaces.

- It is written in Zig.
- You write TypeScript directly or through React and Solid.
- You arrange boxes and text with flexbox.
- You add selects, inputs, and scroll boxes with keyboard and mouse controls.
- You can play sounds, show images, and render 3D graphics.

OpenCode uses OpenTUI in production for millions of users.

[Website](https://opentui.com) | [Documentation](https://opentui.com/docs) | [Packages](https://opentui.com/packages)

## OpenTUI Core

`@opentui/core` supplies the renderer and TypeScript API. You use imperative renderables and events directly. The
TypeScript packages call native Zig through an internal foreign function interface (FFI) boundary.

```typescript
import { TextRenderable, createCliRenderer } from "@opentui/core"

const renderer = await createCliRenderer({ exitOnCtrlC: true })

renderer.root.add(new TextRenderable(renderer, { content: "Hello, OpenTUI!" }))
```

`exitOnCtrlC: true` calls `renderer.destroy()` when the user presses Ctrl+C. The code that creates the renderer must
call `renderer.destroy()` on every other shutdown path.

Install the package:

```bash
bun add @opentui/core
```

Then build your first app with the [quickstart](https://opentui.com/docs/getting-started/quickstart).

## Runtime and platform support

`@opentui/core` runs on Bun 1.3.0 or later, or on Node.js 26.4.0 or later with ECMAScript modules (ESM) and
`--experimental-ffi`.

Use Bun 1.4.0 or later on native Windows arm64.

The native ABI and the generated platform packages, such as `@opentui/core-linux-x64`, are internal distribution
surfaces, not application APIs.

## AI agent skill

Install the OpenTUI documentation as a skill for your AI coding assistant with [`npx skills`](https://skills.sh):

```bash
npx skills add anomalyco/opentui --skill opentui
```

Add `-g` to install the skill globally.

## License

OpenTUI is licensed under the [MIT License](https://github.com/anomalyco/opentui/blob/main/LICENSE).

---
_Source: https://npm.io/package/@opentui/core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
