Prerequisites
Before installing Kraken TUI, ensure you have the following tools installed:Required
-
Bun >= 1.0.0 — JavaScript runtime with native FFI support
- Install:
curl -fsSL https://bun.sh/install | bash - Verify:
bun --version
- Install:
-
Rust >= 1.70.0 — For building the native core
- Install:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh - Verify:
rustc --version && cargo --version
- Install:
Optional (for development)
- Git — For cloning the repository
- Make — For convenient build commands (optional)
Why Bun? Kraken TUI uses Bun’s
bun:ffi for zero-overhead native bindings. While the architecture could support other runtimes, Bun provides the best DX and performance for FFI-heavy libraries.Installation Methods
Method 1: NPM Package (Coming Soon)
Method 2: Build from Source
This is the current recommended method during pre-GA development.Build the native core
The Rust shared library must be compiled before using the TypeScript API:This creates
native/target/release/libkraken_tui.so (Linux), libkraken_tui.dylib (macOS), or kraken_tui.dll (Windows).Install TypeScript dependencies
@preact/signals-core— For JSX reconciler (optional, only if using JSX API)
Project Setup
Using in Your Project
Once installed, import Kraken TUI in your TypeScript files:TypeScript Configuration
For JSX support, add to yourtsconfig.json:
tsconfig.json
Package.json Scripts
Add convenient scripts to yourpackage.json:
package.json
Building the Native Core
Build Modes
Native Dependencies
The Rust core uses these dependencies (installed automatically by Cargo):Cargo.toml
Troubleshooting
Build Failures
Error: linker 'cc' not found
Error: linker 'cc' not found
Solution: Install a C compiler.
- Ubuntu/Debian:
sudo apt install build-essential - macOS:
xcode-select --install - Windows: Install Visual Studio Build Tools
Error: could not find native static library
Error: could not find native static library
Solution: Ensure you’ve built the native core with
cargo build --release before running TypeScript code.The TypeScript layer requires the compiled shared library at runtime.Bun FFI loading error
Bun FFI loading error
Solution: Verify the library path in
ts/src/ffi.ts matches your build output location.Default path: ../native/target/release/libkraken_tui.{so|dylib|dll}Slow build times
Slow build times
Solution: Consider using
cargo build (debug) for development iteration. Use --release only for testing performance or final builds.You can also use sccache to cache Rust build artifacts:Runtime Issues
Terminal rendering looks broken
Terminal rendering looks broken
Solution: Your terminal may not support required features. Try:
- Modern terminal: iTerm2, Alacritty, Windows Terminal, or GNOME Terminal
- Check color support:
echo $COLORTERMshould showtruecoloror24bit
Input not responding
Input not responding
Solution: Ensure you’re calling
app.readInput() in your event loop before draining events.Next Steps
Now that you have Kraken TUI installed, let’s build your first application:Quickstart Tutorial
Create a working terminal application in under 10 minutes