Skip to content

Navigation Menu

Sign in
Sign up

Repository files navigation

Storyline is a streaming, text-based protocol that combines append-only output with replaceable state, enabling rich terminal experiences that degrade cleanly to plain logs. A Storyline renderer can present live tables, trees, and progress views while preserving a sensible append-only log for non-interactive use.

Status

This project is an experiment. The API and implementation are unstable and may change without notice.

Go usage

The library exposes an Encoder, Decoder, and a TTY Renderer that all speak the Storyline protocol.

out := storyline.Out()
defer out.Flush()
_ = out.Append("app", 1, map[string]storyline.Value{"level": storyline.V("info")}, "hello")

To render a stream of Storyline events:

renderer := storyline.NewRenderer(os.Stdout)
decoder := storyline.NewDecoder(os.Stdin)
_ = decoder.DecodeTo(renderer)
_ = renderer.Flush()

CLI

storyline renders a Storyline stream on a TTY and passes through output when stdout is not a terminal.

storyline < stream.txt
storyline ./some-command --with-args
tail -F logfile | storyline

Examples

Each example is a standalone program that emits Storyline events.

go run ./examples/append | go run ./cmd/storyline
go run ./examples/live | go run ./cmd/storyline
go run ./examples/table | go run ./cmd/storyline
go run ./examples/tree | go run ./cmd/storyline
go run ./examples/mux | go run ./cmd/storyline
go run ./examples/combined | go run ./cmd/storyline

About

Live terminal views that degrade to plain logs

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /