CLI
The BetterTUI CLI helps you create and manage projects.
Commands
Section titled “Commands”create
Section titled “create”npm install bettertui@latestInstall BetterTUI in your project.
pnpm devStart the development server with hot reload.
pnpm buildBuild the project for production.
preview
Section titled “preview”pnpm previewPreview the production build.
Configuration
Section titled “Configuration”bettertui.config.ts
Section titled “bettertui.config.ts”import { defineConfig } from '@bettertui/core';
export default defineConfig({ // Theme configuration theme: 'default',
// Renderer options renderer: { fps: 60, dirtyRectDiffing: true, debug: false, },
// Build options build: { target: 'node', minify: true, },});Environment Variables
Section titled “Environment Variables”| Variable | Description | Default |
|---|---|---|
BETTERTUI_FPS |
Target frame rate | 60 |
BETTERTUI_DEBUG |
Enable debug mode | false |
BETTERTUI_THEME |
Override theme | — |
Troubleshooting
Section titled “Troubleshooting”Build fails with napi-rs errors
Section titled “Build fails with napi-rs errors”Ensure Rust toolchain is installed:
rustup update stableTerminal not rendering correctly
Section titled “Terminal not rendering correctly”Check terminal capabilities:
echo $TERMecho $COLORTERMBetterTUI requires a terminal with 256 color support or higher.