nagi-go

module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT

README

Nagi shared libraries for Go

日本語

github.com/mayahiro/nagi-go contains the Go foundations shared by Nagi TUI and Nagi CLI

It deliberately has no package at the module root

Packages

Package Responsibility
text Unicode 17 grapheme segmentation, terminal cell width, wrapping, truncation, and byte/cell positions
vt Pure typed VT input decoding and output encoding, terminal capabilities, colors, attributes, and styles

The packages own no application runtime, Surface, Widget, terminal session, or CLI command lifecycle

Installation after the first release

After v0.1.0 is published, add the shared module once and import only the packages an application needs

go get github.com/mayahiro/nagi-go@v0.1.0

Both packages are released together under the module version

Example

package main

import (
	"fmt"

	"github.com/mayahiro/nagi-go/text"
	"github.com/mayahiro/nagi-go/vt"
)

func main() {
	width := text.Width("Nagi", text.ModernWidth())
	style := vt.Style{Foreground: vt.IndexedColor(4), Bold: true}
	fmt.Println(width, style.Attributes())
}

Development

make check

Shared fixture tests use NAGI_FIXTURES when it names the fixture directory in the Nagi coordination repository

License

Source code is available under the MIT License. Generated Unicode data is distributed under the Unicode License v3

Directories

Path Synopsis
cmd
unicodegen command
Command unicodegen generates committed Unicode tables and conformance fixtures
Command unicodegen generates committed Unicode tables and conformance fixtures
internal
conformance
Package conformance contains private helpers for shared fixture tests
Package conformance contains private helpers for shared fixture tests
Package text provides Unicode grapheme and terminal cell text primitives for Nagi.
Package text provides Unicode grapheme and terminal cell text primitives for Nagi.
Package vt provides pure VT input decoder and output encoder primitives for Nagi.
Package vt provides pure VT input decoder and output encoder primitives for Nagi.

Jump to

Keyboard shortcuts

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