---
title: "Installation"
description: "Terminal apps, written in TypeScript and compiled to native executables with scriptc."
canonical_url: "https://tui-sdk.dev/docs/installation"
---
# Installation

tui has no runtime dependencies. It requires Node.js 24 or later.

### 1. Make the project an ES module

Add `"type": "module"` to `package.json`. Node and scriptc otherwise read `app.ts` as CommonJS and fail on its `import` statements:

```json
{
  "type": "module"
}
```

### 2. Install the package

```console
$ npm install tui
```

### 3. Install scriptc

Add scriptc as a development dependency to compile an app to a native executable:

```console
$ npm install -D scriptc
```

npm 11 asks before running scriptc's postinstall. Allow it:

```console
$ npm install-scripts approve scriptc
```

### 4. Run the app

Node.js 24 or later runs a TypeScript file directly:

```console
$ node app.ts
```

### 5. Build a native executable

Building needs clang and a linker. On Debian or Ubuntu:

```console
$ sudo apt-get install clang lld binutils libc6-dev
```

Then build:

```console
$ npx scriptc build app.ts -o app
$ ./app
```

The output is a single executable. It runs the same code as the Node.js run, with the same terminal behavior, and starts in about 2 ms.

## Package exports

| Import       | What it provides                                                                              |
| ------------ | --------------------------------------------------------------------------------------------- |
| `tui`        | The app loop, terminal binding, cells, renderer, text, components, drawing, motion, and tests |
| `tui/prompt` | Text, select, multiselect, confirm, spinner, and progress prompts                             |
| `tui/agent`  | The agent server and the `snapshot` and `act` tools                                           |

An app that doesn't import `tui/prompt` or `tui/agent` doesn't carry their code.

## Next steps

- [Build your first app](/docs/quick-start): Build a chat from components, then build it and test it.
- [Run the examples](/docs/examples): Complete programs from the repository, running in your browser.
