Skip to main content
Docs

ptool

Lua-powered scripting for shell and automation workflows.

Build small, sharp automation scripts with Lua, then ship them like command-line tools.

example.lua
ptool.use("v0.1.0")

local who = ptool.ask("Deploy target?", {
  default = "staging",
})

ptool.run("echo", {"deploying", who})

Start with the guide, then jump into the module-based Lua API docs as your scripting manual.

Why ptool

A practical runtime for automation scripts

Script-first

Write plain Lua files and run them with ptool. The runtime exposes utilities under both ptool and p.

Batteries included

Use helpers for semver, files, HTTP, SSH, templates, databases, and text processing without assembling separate tools.

CLI-friendly

Mix shell commands, argument parsing, shebang scripts, and structured APIs in one place for practical automation.

For AI

Give assistants raw Markdown instead of rendered HTML

ptool publishes the source docs as static files so agents can read the original Markdown directly.

1. Start here

Tell your assistant to fetch the manifest first. It lists every document title, locale, permalink, and raw Markdown URL.

/raw/manifest.json

3. Tell the model what to do

Example: read the manifest, select the matching locale and page, then load the raw Markdown instead of scraping the rendered site.

Fetch /raw/manifest.json, find the page for "/docs/intro", then read its rawUrl.