Skip to content

Lua API Overview

The complete public scripting API, one page per namespace. For a task-oriented introduction, start with Scripting Basics and The Scripting Model.

Namespace Page What it does
rune.send, rune.connect, … Core Sending, connecting, loading scripts, quitting
rune.state, rune.line State & Lines Read-only client state; the line object contract
rune.style rune.style ANSI color and attribute helpers
rune.regex rune.regex Go-regexp matching, validation, compilation
rune.trigger rune.trigger React to server output
rune.alias rune.alias Expand and transform your input
rune.timer rune.timer One-shot and repeating timers
rune.hooks rune.hooks Event handlers, plus the full event catalog
rune.bind rune.bind Key bindings, plus the default keymap
rune.command rune.command Custom /commands
rune.group rune.group Batch enable/disable across registries
rune.gmcp rune.gmcp GMCP handlers, sending, subscriptions
rune.http rune.http Async HTTP requests with callbacks
rune.input, rune.history rune.input The input line and command history
rune.session, rune.store, rune.world Storage Session and durable storage; world bookmarks
rune.log rune.log Session logging
rune.ui rune.ui Layout, bars, bar management
rune.ui.picker rune.ui.picker Fuzzy-filter selection panels
rune.pane rune.pane Scrollable text panes

Also in Reference: the built-in slash commands and the protocols rune negotiates on the wire.

The contracts below apply across the API; individual pages link here rather than restating them.

Every creation function (rune.trigger.*, rune.alias.*, rune.timer.*, rune.hooks.on, rune.bind, rune.ui.bar, rune.gmcp.on, rune.command.add) returns a handle:

Method Effect
h:enable() / h:disable() Toggle without unregistering
h:remove() Unregister (timers also accept h:cancel())
h:name() The item’s name, or nil
h:group() The item’s group, or nil

Methods are chainable. See The Scripting Model for usage.

Common opts fields accepted by every creation function:

Option Type Default Applies to
name string none All — unique ID; same name replaces (upsert)
group string none All — membership for batch operations
priority number 50 Aliases, triggers, hooks — lower runs first
once bool false Aliases, triggers — remove after first match

Page-specific extras (e.g. trigger gag/raw) are listed on each page.

Every registry namespace exposes the same management suite, addressed by item name:

Function Effect
.enable(name) / .disable(name) Toggle an item
.remove(name) Unregister an item
.list() All items with name, enabled state, group, and source file:line
.count() Number of registered items
.clear() Remove everything in the registry
.remove_group(group) Remove all items in a group

The matching slash commands — /triggers, /aliases, /timers, /hooks, /binds, /bars — print the same listings.

A callback that errors 3 times consecutively is disabled individually, with a notice. Re-enable it (.enable(name)), re-register it, or /reload to reset the count; one successful run also clears it. Full story: The Scripting Model.

Related: The Scripting Model · Slash Commands · Protocols