Skip to content

Terminal

Terminal hosts execute Lua scripts with stdin/stdout/stderr access.

A terminal host runs exactly one process at a time. The process itself is a regular Lua process with access to terminal I/O context.
KindDescription
terminal.hostTerminal session host
- name: cli_host
kind: terminal.host
hide_logs: false
lifecycle:
auto_start: true
FieldTypeDefaultDescription
hide_logsboolfalseSuppress log output to event bus

Scripts running on a terminal host receive a terminal context with:

  • stdin - Standard input reader
  • stdout - Standard output writer
  • stderr - Standard error writer
  • args - Command-line arguments

The IO Module provides terminal operations:

local io = require("io")
io.write("Enter name: ")
local name = io.readline()
io.print("Hello, " .. name)
local args = io.args()

Functions return errors if called outside a terminal context.

  • Terminal I/O — stdin/stdout/stderr operations
  • TTY — Raw input events, styles, and layout