Skip to content

Lua Scripting

Lua is Plinken’s universal scripting layer. Like Python in Houdini or ExtendScript in After Effects, Lua gives you programmatic control over every part of the application — the DAW engine, media pipelines, and the 3D scene graph.

Plinky, the built-in AI assistant, uses the same Lua API described here. Anything you script by hand, Plinky can generate and execute.

Lua code runs in three contexts, each suited to a different task:

SurfacePurposeEntry Point
ActionsImmediate scripts — automate the DAW, call commands, run external toolsAction Editor or lua:execute command
WorkflowsDAG pipelines — chain nodes for media generation, AI processing, batch exportWorkflow Editor or lua-workflow:run command
Scene3D scene graph — create meshes, lights, cameras, animate characterspl.scene global

Every Lua script has access to the plinken global object. This is the root of the entire API.

FunctionReturnsDescription
pl.cmd(id, payload)Execute any DAW command (deferred to next frame)
pl.log(msg)Output a message to the console
pl.sleep(ms)Yield execution (max 30 000 ms)
pl.get_context()tableSession context — account, project, space, team, video
pl.get_transport()tableTransport state — tempo, playing, position, time signature
plinken.list_commands()tableAll registered command IDs
pl.exec(program, args)stringRun an allowlisted external program
plinken.allowed_programs()tableList of programs available to exec
print(...)Redirected to the script output buffer
PropertyTypeDescription
pl.sceneSceneEntry point to the 3D Scene API

See the Actions reference for full details on every function, and the Scene API for the 3D subsystem.

Open the Action Editor (from the Action menu) and paste:

-- Log the current session info
local ctx = pl.get_context()
pl.log("Project: " .. ctx.project)
-- Check transport state
local transport = pl.get_transport()
pl.log("Tempo: " .. transport.tempo .. " BPM")
if transport.playing then
pl.cmd("transport:stop", {})
pl.log("Stopped playback")
else
pl.cmd("transport:play", {})
pl.log("Started playback")
end

Press Run (or execute via lua:execute) to see the output in the console.

Plinky, Plinken’s AI assistant, writes and executes Lua behind the scenes. When you say “mute all drum tracks” or “set up three-point lighting”, Plinky translates that into Lua calls against the same plinken API.

This means:

  • Any script you write can be generated by Plinky
  • Any Plinky action can be inspected as Lua source
  • You can teach Plinky new workflows by writing reusable scripts