Help us shape the future of Go! Take the 2026 Go Developer Survey

rune

module
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT

README

Rune

A terminal MUD client built with Go and Lua.

CI codecov

Go handles networking, terminal rendering, and concurrent I/O. Lua scripts define aliases, triggers, key bindings, layouts, and client commands.

Guides, cookbook recipes, and the full API reference live at runemud.com. Questions, ideas, and feedback are welcome in the Rune Discord.

Features

Scripting:

  • Aliases - Command expansion with exact match or regex patterns
  • Triggers - React to server output with pattern matching and gags
  • Timers - One-shot and repeating timers with named management
  • Hooks - Event system for connecting to input/output pipeline
  • Key Bindings - Bind keys to Lua callbacks
  • Groups - Master switches to enable/disable sets of aliases/triggers/timers
  • Command Chaining - kill rat;loot sends both; #3 north repeats a command or alias
  • Script Error Handling - Failing callbacks are disabled individually; a watchdog interrupts script execution subject to the LuaJIT limits

Protocols:

  • GMCP - Structured server data (vitals, room info, channels) with a scriptable rune.gmcp API and automatic Core.Hello handshake
  • MCCP2 - Transparent zlib stream compression
  • TLS - Encrypted connections (tls://host:port), including self-signed certs
  • Telnet Negotiation - TTYPE/MTTS, NAWS, CHARSET (UTF-8), and MNES identification

Quality of life:

  • Worlds - Named server bookmarks; /connect with no arguments opens a picker
  • Session Logging - /log writes an ANSI-stripped transcript that reads like the screen
  • Durable Storage - rune.store persists structured values across restarts
  • Tab Completion - Word cache from server output with match cycling
  • History - Zsh-style prefix-matching navigation
  • Panes & Bars - Multiple output buffers with scrollback, reactive status bars

Installation

Download a binary for Linux, macOS, or Windows from the releases page, unpack it, and put rune on your PATH.

With Go installed, you can instead:

go install github.com/mmcdole/rune/cmd/rune@latest

Or build from source:

git clone https://github.com/mmcdole/rune
cd rune
go build ./cmd/rune/

See the installation guide for details.

Quick Start

Connect straight from your shell:

rune mud.example.com 4000           # plain telnet
rune tls://mud.example.com:4000     # TLS

Then, inside the client:

/world add example mud.example.com 4000    save a bookmark
/connect example                           connect by name (or later: rune example)
/log start                                 log the session to a file
/help                                      everything else

User scripts load from ~/.config/rune/init.lua at startup:

-- Alias with regex captures
rune.alias.regex("^kill (.+)$", "attack %1; murder %1")

-- Trigger: highlight a line in red
rune.trigger.contains("You are hit", function(matches, ctx)
    return rune.style.red(ctx.line:clean())
end)

-- GMCP: warn on low health
rune.gmcp.subscribe("Char")
rune.gmcp.on("Char.Vitals", function(data)
    if data.hp and data.maxhp and data.hp < data.maxhp * 0.25 then
        rune.echo(rune.style.red("[LOW HP] " .. data.hp .. "/" .. data.maxhp))
    end
end)

Everything Rune reads and writes — scripts, saved worlds, state, and logs — lives in ~/.config/rune. Use rune --config-dir <dir> or RUNE_CONFIG_DIR=<dir> to keep it in a different directory.

The scripting basics guide picks up from here.

Documentation

Full guides, cookbook recipes, and reference live at runemud.com:

In-repo reference: the architecture overview. The API reference source lives at website/src/content/docs/reference/api/.

License

MIT License - see LICENSE for details.

Directories

Path Synopsis
cmd
rune command
Package input defines command and verbatim submissions shared by the UI, Session, and scripting layers.
Package input defines command and verbatim submissions shared by the UI, Session, and scripting layers.
internal
paths
Package paths resolves the filesystem paths users give Rune: the config directory and script or log paths that may start with ~.
Package paths resolves the filesystem paths users give Rune: the config directory and script or log paths that may start with ~.
Package network provides the telnet protocol layer for the client: stream parsing, option negotiation, and connection management.
Package network provides the telnet protocol layer for the client: stream parsing, option negotiation, and connection management.
Package script defines Rune's engine-neutral scripting seam.
Package script defines Rune's engine-neutral scripting seam.
lunar
Package lunar implements the script seam over Lunar.
Package lunar implements the script seam over Lunar.
test
replay
Package replay holds a synthetic, VikingMUD-style server byte corpus and a loopback server that replays it through rune's real network and Session pipeline.
Package replay holds a synthetic, VikingMUD-style server byte corpus and a loopback server that replays it through rune's real network and Session pipeline.
replay/cmd/replayserver command
Command replayserver serves a replay corpus on a loopback port so a real rune binary can be driven against it, for example in tmux for terminal output capture or with RUNE_PROFILE_DIR for whole-process profiles.
Command replayserver serves a replay corpus on a loopback port so a real rune binary can be driven against it, for example in tmux for terminal output capture or with RUNE_PROFILE_DIR for whole-process profiles.
ui
tui
Package version is the single source of the client's identity.
Package version is the single source of the client's identity.
website
demo/mud command
Command mud is the synthetic MUD server behind the website demo gifs.
Command mud is the synthetic MUD server behind the website demo gifs.

Jump to

Keyboard shortcuts

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