Setup
Lua plugins need nothing installed and nothing built. Wraith runs your .lua files as they are.
Make a plugin
Section titled “Make a plugin”Make a folder with two files in it.
my-plugin/ wraith.json main.luawraith.json
{ "$schema": "https://hub.wraith.io/schema/v1/wraith.json", "id": "my-plugin", "kind": "plugin", "version": "0.1.0", "title": "My Plugin", "provider": "lua"}See the manifest for the other fields.
main.lua
local wraith = require("wraith")
wraith.log.info("Hello from", wraith.plugin.name)Load it
Section titled “Load it”wraith dev add my-pluginThen Rescan in the overlay’s Plugins window. After each change, Reload there.
Packing it
Section titled “Packing it”Zip the folder when you want to share it. The hub wants the files inside a folder named after the plugin’s id, like my-plugin/main.lua.
Editor
Section titled “Editor”Any editor works. One with LuaLS, the lua-language-server, also gets completions and type checks for everything in wraith. Run this in your plugin’s folder to give it Wraith’s types:
wraith sdk lua typesThey go in .wraith/types, with your schemas/ types too, so require("schema") is typed. It also makes a .luarc.json pointing there. If you already have one, add ".wraith/types" to its workspace.library.
In VS Code, install the Lua extension and the Wraith extension. The Wraith one runs that command for you when you open the folder and when you change a .sal file, so the types match the Wraith you have. It also highlights your .sal schemas and has snippets for them.
If autocomplete for wraith stops working, run Wraith: Update Lua types from the command palette, or the command above.
Made with ♥ by Asgard
