@opentui/core 0.0.0-20260820-e69cf0cc → 0.0.0-20260829-75ab7375

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,63 +1,70 @@
1
- # OpenTUI Core
1
+ <!-- Keep the project introduction aligned with the repository README and opentui.com. -->
2
2
 
3
- OpenTUI is a native terminal UI core written in Zig with TypeScript bindings. The native core exposes a C ABI and can be used from any language. OpenTUI powers OpenCode in production today and will also power terminal.shop. It is an extensible core with a focus on correctness, stability, and high performance. It provides a component-based architecture with flexible layout capabilities, allowing you to create complex terminal applications.
3
+ <p align="center">
4
+ <a href="https://opentui.com">
5
+ <img alt="OpenTUI logo" src="https://opentui.com/opentui-logo-auto.svg" width="270" />
6
+ </a>
7
+ </p>
4
8
 
5
- ## Documentation
9
+ <div align="center">
10
+ <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>
11
+ <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>
12
+ </div>
6
13
 
7
- - [Getting Started](https://opentui.com/docs/getting-started) - API and usage guide
8
- - [Development Guide](docs/development.md) - Building, testing, and contributing
9
- - [Tree-Sitter](https://opentui.com/docs/reference/tree-sitter) - Syntax highlighting integration
10
- - [Renderables](https://opentui.com/docs/core-concepts/renderables) - Understanding the component model
11
- - [Environment Variables](https://opentui.com/docs/reference/env-vars) - Configuration options
14
+ OpenTUI is a library to build terminal user interfaces.
12
15
 
13
- ## Install
16
+ - It is written in Zig.
17
+ - You write TypeScript directly or through React and Solid.
18
+ - You arrange boxes and text with flexbox.
19
+ - You add selects, inputs, and scroll boxes with keyboard and mouse controls.
20
+ - You can play sounds, show images, and render 3D graphics.
14
21
 
15
- ```bash
16
- bun install @opentui/core
17
- ```
22
+ OpenCode uses OpenTUI in production for millions of users.
18
23
 
19
- ## Build
24
+ [Website](https://opentui.com) | [Documentation](https://opentui.com/docs) | [Packages](https://opentui.com/packages)
20
25
 
21
- ```bash
22
- bun run build
23
- ```
26
+ ## OpenTUI Core
24
27
 
25
- This creates platform-specific libraries that are automatically loaded by the TypeScript layer.
28
+ `@opentui/core` supplies the renderer and TypeScript API. You use imperative renderables and events directly. The
29
+ TypeScript packages call native Zig through an internal foreign function interface (FFI) boundary.
26
30
 
27
- ## Examples
31
+ ```typescript
32
+ import { TextRenderable, createCliRenderer } from "@opentui/core"
28
33
 
29
- ```bash
30
- bun install
31
- cd ../examples
32
- bun run dev
34
+ const renderer = await createCliRenderer({ exitOnCtrlC: true })
35
+
36
+ renderer.root.add(new TextRenderable(renderer, { content: "Hello, OpenTUI!" }))
33
37
  ```
34
38
 
35
- ## Benchmarks
39
+ `exitOnCtrlC: true` calls `renderer.destroy()` when the user presses Ctrl+C. The code that creates the renderer must
40
+ call `renderer.destroy()` on every other shutdown path.
36
41
 
37
- Run native performance benchmarks:
42
+ Install the package:
38
43
 
39
44
  ```bash
40
- bun run bench:native
45
+ bun add @opentui/core
41
46
  ```
42
47
 
43
- See [the native benchmark runner](../native/src/bench.zig) for options such as `--filter` and `--mem`.
48
+ Then build your first app with the [quickstart](https://opentui.com/docs/getting-started/quickstart).
44
49
 
45
- NativeSpanFeed TypeScript benchmarks:
50
+ ## Runtime and platform support
46
51
 
47
- - [src/benchmark/native-span-feed-benchmark.md](src/benchmark/native-span-feed-benchmark.md)
52
+ `@opentui/core` runs on Bun 1.3.0 or later, or on Node.js 26.4.0 or later with ECMAScript modules (ESM) and
53
+ `--experimental-ffi`.
48
54
 
49
- ## CLI Renderer
55
+ The native ABI and the generated platform packages, such as `@opentui/core-linux-x64`, are internal distribution
56
+ surfaces, not application APIs.
50
57
 
51
- ### Renderables
58
+ ## AI agent skill
52
59
 
53
- Renderables are hierarchical objects that can be positioned, nested, styled and rendered to the terminal:
60
+ Install the OpenTUI documentation as a skill for your AI coding assistant with [`npx skills`](https://skills.sh):
54
61
 
55
- ```typescript
56
- import { createCliRenderer, TextRenderable } from "@opentui/core"
62
+ ```bash
63
+ npx skills add anomalyco/opentui --skill opentui
64
+ ```
57
65
 
58
- const renderer = await createCliRenderer()
66
+ Add `-g` to install the skill globally.
59
67
 
60
- const obj = new TextRenderable(renderer, { id: "my-obj", content: "Hello, world!" })
68
+ ## License
61
69
 
62
- renderer.root.add(obj)
63
- ```
70
+ OpenTUI is licensed under the [MIT License](https://github.com/anomalyco/opentui/blob/main/LICENSE).