agentpad

Execute bash, Python, JavaScript (Node), and SQL against a real project directory — with overlay mode, read-only guards, file-change tracking, and built-in OpenAI tool support. Built for AI agents, CI, and local tooling.

Install

npm install agentpad

Requires Node.js 18+. For SQL, the sqlite3 binary must be on your PATH.

Quick start

import { Runtime } from "agentpad";

const rt = new Runtime("./my-project");

const r = await rt.run("python", 'print(open("README.md").read()[:80])');
console.log(r.stdout);
console.log(r.files); // files changed under the workspace

rt.close();

Languages

LanguageHow it runs
bash/bin/bash -c
pythonpython3 -c
javascriptnode --input-type=module
sqlsqlite3 CLI (Node) or stdlib sqlite3 (Python)

Workspace modes

ModeBehaviour
NormalRuns against the live directory
Read-onlyrt.fs.writeFile() throws; shell can still write (library-level guard)
OverlayCopies to a temp dir; call rt.apply() to merge changes back to disk

OpenAI function-calling

const tool = rt.asOpenAITool();
// returns { type: "function", function: { name, description, parameters } }

const result = rt.executeToolCall({ language: "python", code: "print(42)" });

Guides

DocContents
OverviewProduct summary and sidebar
Getting startedInstall, first runs, overlay, read-only
Use casesCI, agents, overlay, run log, OpenAI tools
ConfigurationRuntimeOptions / kwargs, globs, limits, run log
API referenceRuntime, types, filesystem adapters
SecurityThreat model, workspace boundaries
Python packageNode vs Python differences