gridland
API Reference

@gridland/bun

Bun-native runtime for Gridland CLI apps

@gridland/bun is the Bun-native runtime package for building Gridland CLI apps. It re-exports everything from @gridland/utils plus native-only exports that require the Bun runtime.

Installation

bun add @gridland/bun

Native Exports

These exports are only available in Bun and are not included in @gridland/utils:

Import
import {
  createCliRenderer,
  CliRenderer,
  TerminalConsole,
  NativeSpanFeed,
  setRenderLibPath,
} from "@gridland/bun"
ExportDescription
createCliRenderer(options?)Create a CLI renderer that renders to the terminal
CliRendererThe underlying renderer class
TerminalConsoleTerminal-aware console implementation
NativeSpanFeedNative span feed for styled text rendering
setRenderLibPath(path)Set the path to the native rendering library

Re-exported from @gridland/utils

All exports from @gridland/utils are re-exported, including hooks (useKeyboard, useTerminalDimensions), headless rendering utilities (HeadlessRenderer, createHeadlessRoot, bufferToText), and helpers (isBrowser, calculateGridSize).

See the @gridland/utils API reference for details.

Usage

See the Compile to Binary guide for a full walkthrough of building CLI apps with @gridland/bun.