limoni

module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2026 License: Apache-2.0

README ยถ

Limoni Logo

๐Ÿ‹ Limoni

An Ultra-Fast, Zero-Allocation, Thread-Safe Modern TUI Framework for Go.

Build Status Go.Dev Reference Go Version License Zero Allocations Awesome Limoni Code of Conduct

Language: English โ€ข Tรผrkรงe

Why Limoni? โ€ข Showcase โ€ข Key Features โ€ข Quick Start โ€ข Documentation โ€ข Widgets โ€ข Benchmarks โ€ข Examples โ€ข Awesome Limoni


โšก Overview

Limoni is a modern, high-performance Terminal User Interface (TUI) engine for Go. Designed from the ground up for data-intensive dashboards, devtools, and responsive terminal applications, Limoni bridges the gap between Go's developer ergonomics and Rust-like raw rendering speed.

By utilizing a flat 1D cell grid, zero-allocation hot-paths, and an optimized differential ANSI engine, Limoni achieves ultra-smooth 60+ FPS rendering without triggering Go's Garbage Collector.


๐Ÿ’ก Why Limoni?

Feature / Goal ๐Ÿ‹ Limoni (Go) ๐Ÿซง Bubble Tea (Go) ๐Ÿ€ Ratatui (Rust)
Language & Tooling Go (Native) Go (Native) Rust (Native)
Render Architecture Flat 1D Grid + ANSI Diff Engine String concatenation / TEA Immediate Mode Double Buffer
Hot-Path Allocations 0 B/op (Zero Alloc) High heap allocation overhead Stack / RAII
Large Datasets / Tables Virtual Paging (Millions of rows) High GC load on scroll High layout cloning overhead
3D & Vector Graphics Built-in 3D (OBJ/STL/PLY) & Shaders Third-party / custom Addons required
Accessibility (A11y) Screen-reader & semantic tree built-in Limited / Manual Experimental
Concurrency Model Synchronized Model Lifecycle & Event Loops Single-threaded TEA loop Manual thread coordination

Key Advantages:

  1. Zero GC Stutter: Critical rendering loops generate zero heap allocations, eliminating random frame drops during heavy interactions or animations.
  2. True Multithreaded State: Push state updates from any goroutine safely without bottlenecking the main event loop.
  3. Virtual Viewport Paging: Render tables and lists with millions of rows without loading invisible cells into memory.
  4. Batteries-Included: 3D Wireframe/Lambert/Gouraud rendering, rich markdown parser, physics/easing animations, fuzzy search, and command palettes out-of-the-box.

๐ŸŽฌ Showcase & Demos

๐ŸŽฎ 3D Mesh & Vector Graphics Engine

Real-time 3D software rasterization running at 60+ FPS directly in terminal cells. Supports .obj, .stl, and .ply mesh models, depth-buffer Gouraud shading, Lambertian diffuse lighting, and interactive mouse/keyboard orbital controls.

Limoni 3D Mesh Rendering

go run ./examples/3d_viewer

๐Ÿ“ Superfile-Grade TreeView & Image Previews

Hierarchical collapsible file explorer widget (widgets.TreeView) with directory icons, tree guide lines, git/file status indicators, and live TrueColor half-block image previews.

Limoni TreeView File Explorer

go run ./examples/treeview

๐Ÿ“Š High-Resolution Charts & Data Visualization

Sub-pixel Braille curves (widgets.LineChart), vertical gradient spectrum bars (widgets.BarChart), and donut distributions (widgets.PieChart) rendering high-frequency streaming telemetry with zero heap allocations.

go run ./examples/charts

โœจ Key Features

  • ๐Ÿš€ Sub-Microsecond ANSI Diffing: Computes dirty cell regions and emits minimal ANSI escape sequences; short-circuits instantly if nothing changed.
  • ๐Ÿ“ฆ Contiguous 1D Buffer: Flat memory layout eliminates pointer chasing and maximizes CPU L1/L2 cache locality.
  • ๐ŸŽจ TrueColor & Fallback Engine: Full 24-bit RGB TrueColor support with automatic downsampling fallbacks for 256-color and 16-color terminals.
  • ๐Ÿ“ Responsive Flexbox Layouts: Declarative layout engine supporting proportional splits, minimum/maximum size constraints, and nested alignments.
  • ๐ŸŽฌ Animation & Easing Engine: Built-in interpolation for float, color, and transitions (Linear, Quad, Cubic, Elastic, Bounce).
  • ๐Ÿ•ถ๏ธ Native 3D & Vector Graphics: Render 3D .obj, .stl, .ply meshes directly in terminal cells with camera projection, rotation, and lighting!
  • โ™ฟ Built-in Accessibility: Accessible navigation tree, line-by-line inspection mode, and semantic annotations for screen-readers.

๐Ÿš€ Quick Start

Installation

go get github.com/thebanri/limoni

1. Minimal TEA (The Elm Architecture) Example

package main

import (
	"context"
	"fmt"
	"os"

	"github.com/thebanri/limoni/core/backend"
	"github.com/thebanri/limoni/core/cell"
	"github.com/thebanri/limoni/core/runtime"
	"github.com/thebanri/limoni/core/terminal"
	"github.com/thebanri/limoni/layout"
	"github.com/thebanri/limoni/widgets"
)

type AppModel struct {
	count int
}

func (m *AppModel) Init() []runtime.Cmd {
	return nil
}

func (m *AppModel) Update(msg runtime.Msg) runtime.UpdateResult {
	switch msg := msg.(type) {
	case runtime.KeyPressMsg:
		switch msg.Key.Type {
		case backend.KeyEsc:
			return runtime.UpdateResult{Quit: true}
		case backend.KeyRune:
			switch msg.Key.Ch {
			case 'q', 'Q':
				return runtime.UpdateResult{Quit: true}
			case '+', '=':
				m.count++
				return runtime.UpdateResult{Redraw: true}
			case '-', '_':
				m.count--
				return runtime.UpdateResult{Redraw: true}
			}
		}
	}
	return runtime.UpdateResult{}
}

func (m *AppModel) View(frame *terminal.Frame) {
	area := frame.Area()
	chunks := layout.FlexLayout{
		Direction: layout.Vertical,
		Constraints: []layout.Constraint{
			layout.Fixed(3),
			layout.Fill(),
			layout.Fixed(3),
		},
	}.Split(area)

	// Header
	frame.RenderWidget(widgets.Block{
		Title:       " ๐Ÿ‹ Limoni Quickstart ",
		BorderStyle: cell.Style{Fg: cell.NewColorRGB(255, 215, 0)},
		TitleStyle:  cell.Style{Fg: cell.NewColorRGB(255, 255, 255), Modifier: cell.ModifierBold},
	}, chunks[0])

	// Body
	text := fmt.Sprintf("Counter: %d  (Press '+' / '-' to change, 'q' to quit)", m.count)
	p := &widgets.Paragraph{
		Text:  text,
		Style: cell.Style{Fg: cell.NewColorRGB(0, 255, 200), Modifier: cell.ModifierBold},
	}
	frame.RenderWidget(p, chunks[1])

	// Footer
	frame.RenderWidget(widgets.Block{
		Title:       " [+] Increment  [-] Decrement  [Q/Esc] Quit ",
		BorderStyle: cell.Style{Fg: cell.NewColorRGB(100, 110, 120)},
	}, chunks[2])
}

func main() {
	b := backend.NewBackend(os.Stdin, os.Stdout)
	if err := b.Setup(); err != nil {
		fmt.Fprintf(os.Stderr, "Setup failed: %v\n", err)
		os.Exit(1)
	}
	defer b.Close()

	term, err := terminal.New(b)
	if err != nil {
		fmt.Fprintf(os.Stderr, "Terminal failed: %v\n", err)
		os.Exit(1)
	}

	app := runtime.New(
		runtime.WithModel(&AppModel{}),
		runtime.WithFPS(60),
	)

	if err := app.RunTerminal(context.Background(), term, b); err != nil {
		panic(err)
	}
}

๐Ÿ“š Documentation

Detailed guides and API references are available in the docs/ directory and on our Interactive Documentation Website:

Guide Description
โšก Getting Started Step-by-step introduction, installation, and first interactive app.
๐Ÿ›๏ธ Architecture & Zero-Alloc Deep Dive Memory layout, 1D contiguous grid, and cache locality.
โš™๏ธ Core API Reference cell, buffer, terminal, backend, and runtime packages.
๐Ÿ“ Flexbox Layout Engine Multi-column, multi-row, percentage, ratio, and constraint layouts.
๐Ÿงฉ Widget Reference & Guide Full reference for all display, input, and modal widgets.
๐ŸŽจ 2D/3D Graphics & Canvas Braille canvas, 3D Mesh loaders, Lambert/Gouraud shaders, and image protocols.
๐ŸŽฌ Animation & Physics Interpolation, spring physics, and smooth easing curves.
โ™ฟ Accessibility & Theming Screen-readers, High-Contrast mode, and NO_COLOR standard.
๐ŸŒ Drivers & WebAssembly Cross-platform details: Linux, macOS, Windows VT100, WASM, and SSH.
๐Ÿ“‚ Examples Directory Guide Feature map and run instructions for all 12 example applications.

๐Ÿงฉ Rich Widget Ecosystem

Limoni comes with an extensive suite of production-ready widgets:

Category Available Widgets
Structure & Layout Block, Dialog / Modal, Popup, ResponsiveGrid, Flexbox
Data Display Table (Virtual/Paged), List (Virtual), Sparkline, ProgressBar, RichText
Input Controls TextInput, TextArea, Checkbox, RadioGroup, Select / Dropdown, Slider
Navigation & Search CommandPalette, FuzzySearch (FZF-style), Tabs, KeybindingManager
Graphics & 3D Canvas (Braille / Block), Vector3D Mesh (OBJ/STL/PLY), Lambertian & Gouraud Shaders, Image (Kitty/Sixel/iTerm2/HalfBlock)
Text & Docs Markdown (Full GFM), RichText Highlighting

๐Ÿ›๏ธ Architecture

                      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                      โ”‚             User Application           โ”‚
                      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                          โ”‚ State & Views
                                          โ–ผ
                      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                      โ”‚         Declarative UI / Widgets       โ”‚
                      โ”‚   (Tables, Modals, 3D Canvas, Layout)  โ”‚
                      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                          โ”‚ Draw to Grid
                                          โ–ผ
                      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                      โ”‚          Flat 1D Buffer Grid           โ”‚
                      โ”‚  [Zero Heap Allocation Cell Memory]   โ”‚
                      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                          โ”‚
                        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                        โ–ผ                                   โ–ผ
             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
             โ”‚ Previous Frame Snap โ”‚             โ”‚ Current Frame Snap  โ”‚
             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                          โ”‚ Sub-microsecond Diff
                                          โ–ผ
                      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                      โ”‚       ANSI Diff & Optimize Stream      โ”‚
                      โ”‚  (Minimizes cursor jump & color reset) โ”‚
                      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                          โ”‚ Direct Write
                                          โ–ผ
                      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                      โ”‚   Terminal TTY / Windows / macOS / SSH โ”‚
                      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“Š Benchmarks

Limoni includes a standardized cross-implementation benchmark suite comparing native Go and Rust workloads under identical virtual terminals.

Run benchmarks locally:

# Run Go Limoni Benchmark
go test ./benchmarks -run '^$' -bench . -benchmem

# Generate HTML Comparison Dashboard
go run ./benchmarks/runners/dashboard -output benchmark-results/dashboard.html benchmark-results/limoni.json benchmark-results/bubbletea.json benchmark-results/ratatui.json

Results from 120x40 standard viewport tests:

  • Frame Diffing Speed: < 0.85 ยตs per full-screen diff.
  • Heap Allocations in Hot Path: 0 allocs/op (0 B/op).
  • Virtual Table Scrolling: > 120 FPS continuous rendering with 1,000,000 rows.

๐Ÿ“‚ Examples & Showcase Applications

Explore runnable demo applications inside the examples/ directory. See the full Examples Directory Guide (docs/examples.md) for details on all available apps.

Example Description Run Command
3d_viewer Professional 3D model viewer supporting .obj, .stl, .ply, texture mapping & Lambertian/Gouraud shaders. go run ./examples/3d_viewer
todo Full-featured TEA Todo app with tags, priorities, filters, fuzzy search, and progress bars. go run ./examples/todo
dashboard DevOps monitoring dashboard with CPU/Memory sparklines, live process table & streaming logs. go run ./examples/dashboard
table_virtual 1,000,000 row virtual table showcasing 0 B/op zero-allocation 120 FPS streaming. go run ./examples/table_virtual
colors_and_styles 24-bit TrueColor gradients, 256-color ANSI palettes, text modifiers & A11y themes. go run ./examples/colors_and_styles
ssh_server Remote terminal server streaming interactive 60 FPS Limoni sessions over network/SSH sockets. go run ./examples/ssh_server
custom_widget Developer guide for implementing custom widgets.Widget components (Analog Meter / Gauge). go run ./examples/custom_widget
demo Comprehensive showcase with 3D graphics, matrix rain, tabs, and command palettes. go run ./examples/demo
wasm In-browser WebAssembly demo running on xterm.js. go run ./examples/wasm
animation Physics-based animations, color transitions, and easing curves. go run ./examples/animation
forms Text inputs, text areas, radios, checkboxes, and sliders. go run ./examples/forms
layer_demo Layered modals, popups, and focus isolation. go run ./examples/layer_demo

๐ŸŒŸ Awesome Limoni

Check out our curated list of real-world apps, tools, and third-party widgets in AWESOME.md.

Built something cool with Limoni? Open a Pull Request and add your project to AWESOME.md!


๐Ÿค Contributing

Contributions, issues, and feature requests are welcome! Please make sure to review our Code of Conduct before participating.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ›ก๏ธ Security Policy

Please read our Security Policy to report vulnerabilities responsibly.


๐Ÿ“œ Code of Conduct

This project adheres to the Contributor Covenant v2.1. By participating, you are expected to uphold this code.


๐Ÿ“„ License

Distributed under the MIT License. See LICENSE for more information.

Made with ๐Ÿ‹ by thebanri and contributors.

Directories ยถ

Path Synopsis
runners/compare command
runners/limoni command
cmd
limoni command
Command limoni, Limoni TUI projeleri iรงin iskelet (scaffold) รผretir.
Command limoni, Limoni TUI projeleri iรงin iskelet (scaffold) รผretir.
compat
core
accessibility
Package accessibility contains semantic UI metadata independent of rendering.
Package accessibility contains semantic UI metadata independent of rendering.
runtime
Package runtime provides an optional Init/Update/View application runtime.
Package runtime provides an optional Init/Update/View application runtime.
examples
3d_viewer command
animation command
ascii3d command
ascii3d demonstrates real-time 3D ASCII & sub-cell rendering in Limoni TUI.
ascii3d demonstrates real-time 3D ASCII & sub-cell rendering in Limoni TUI.
charts command
custom_widget command
dashboard command
demo command
forms command
forms demonstrates the Select and Slider widgets.
forms demonstrates the Select and Slider widgets.
layer_demo command
layer_demo demonstrates Limoni layered rendering capabilities: - Layered Rendering with z-index based compositing - Modal Dialog with Focus Trapping - Popup / Dropdown menus - Click-outside dismissal mechanism
layer_demo demonstrates Limoni layered rendering capabilities: - Layered Rendering with z-index based compositing - Modal Dialog with Focus Trapping - Popup / Dropdown menus - Click-outside dismissal mechanism
paint command
ssh_server command
table_virtual command
toast command
todo command
treeview command
wasm command
internal
tools/widgetdocs command
Command widgetdocs, widgets paketindeki kaynak koddan docs/widget-gallery.md dosyasฤฑnฤฑ รผretir.
Command widgetdocs, widgets paketindeki kaynak koddan docs/widget-gallery.md dosyasฤฑnฤฑ รผretir.
Package testkit provides deterministic, terminal-independent helpers for testing Limoni widgets and frames.
Package testkit provides deterministic, terminal-independent helpers for testing Limoni widgets and frames.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL