Skip to content

Library API

Cairn is a CLI and a library — install it as a dependency to embed the agent in your own TypeScript tooling:

Terminal window
npm install @plune-ai/cairn
import { 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`.
ExportMirrors CLIReturns
loadConfig(env).env + defaultsresolved AppConfig
runDesign(opts)cairn designDesignResult — run dir + ATC-* / MTC-* cases
runAutomate(opts)cairn automateAutomateResult — specs + validation report
runExploration(opts)cairn exploreExploreResult — 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.