Skip to main content

Getting Started

Make sure the ptool binary is available in your shell, then create a Lua script and run it with ptool run.

Minimal script

ptool.use("v0.1.0")

ptool.run("echo", {"hello", "world"})

Run it with:

ptool run script.lua

Passing arguments

You can pass extra CLI arguments after the script path:

ptool run script.lua --name alice -v a.txt b.txt

Parse them inside the script with ptool.args.parse(...).

Shebang scripts

ptool supports shebang files, so a script can start with:

#!/usr/bin/env ptool run

This lets you execute the script directly once it has the executable bit.

Next steps