Library API
Cairn is a CLI and a library — install it as a dependency to embed the agent in your own TypeScript tooling:
npm install @plune-ai/cairnimport { runDesign, runAutomate, runExploration, loadConfig } from "@plune-ai/cairn";
const config = loadConfig(process.env);
// Design test cases only (no code):const design = await runDesign({ url: "https://app.example.com/page", config, sessionName: "myapp", // checklistText is optional — steer the design pass with a checklist});// design.testCases, design.testCaseFiles, design.scores
// runAutomate (code from a run's ATC cases) and runExploration (the full pipeline)// take the same shape — each opts object carries the resolved `config`.| Export | Mirrors CLI | Returns |
|---|---|---|
loadConfig(env) | .env + defaults | resolved AppConfig |
runDesign(opts) | cairn design | DesignResult — run dir + ATC-* / MTC-* cases |
runAutomate(opts) | cairn automate | AutomateResult — specs + validation report |
runExploration(opts) | cairn explore | ExploreResult — full report incl. Pilot verdict |
Each opts object also carries the resolved config from loadConfig(process.env).
For exact option types, see the repository — the package ships TypeScript types.