wildling
Lua library and CLI for pattern-based string generation. Zero third-party dependencies (pure Lua 5.4 stdlib — hand-rolled JSON). Requires Lua 5.4+.
Docs: Website · Sandbox · Syntax · Source
Registry: LuaRocks
Example
Install
From this repository:
cd lua
./build.sh
./bin/wildling "Year 19##"
Git (from a monorepo clone; module paths in the rockspec are relative to the repo root):
git clone --branch v2.0.7 --depth 1 https://github.com/dotmonk/wildling.git
cd wildling
luarocks make lua/wildling-2.0.7-1.rockspec
Registry: luarocks install wildling
Releases through 2.0.6 on LuaRocks used source.dir = "lua" while packing the full monorepo, so a plain luarocks install wildling fails with “Could not determine source directory”. Workarounds for those rocks: clone and luarocks make as above, or luarocks download wildling --source, unpack, then luarocks make from the nested lua/ tree. Newer publishes use repo-root module paths and install normally.
package.path = "./lib/?.lua;" .. "./lib/?/init.lua;" .. package.path
local wildling = require("wildling")
local w = wildling.create({ "Year 19##" })
local value = w:next()
while value ~= false do
print(value)
value = w:next()
end
CLI
./bin/wildling "Year 19##"
./bin/wildling --dictionary planets:../dictionaries/planets.txt "%{'planets'}"
./bin/wildling --template ./config.json
Help text and --check output follow docs/cli.md / docs/help.txt.
Build
./build.sh # Docker (python:3.13-alpine + lua5.4): copy help.txt + luac -p syntax check
Project tests live in ../tests/ and are run with ../test.sh.