TypeScript SDK
The TypeScript SDK is Node.js-first and uses Promise APIs.
pnpm add @cofy-x/axern-sdk@<version>The official package is published as @cofy-x/axern-sdk on npm.
import { AxernClient, Sandbox } from "@cofy-x/axern-sdk";
const client = AxernClient.fromContext(process.env.AXERN_CONFIG ?? `${process.env.HOME}/.config/axern/config.json`, process.env.AXERN_CONTEXT);
const sandbox = await new Sandbox({ client, image: "docker.io/library/python:3.12-slim",}).start();
try { const result = await sandbox.exec("python -c \"print('hello from Node.js')\"", { check: true, }); console.log(result.stdoutText());} finally { await sandbox.close(); client.close();}AxernClient.fromContext() is appropriate for interactive tools; AxernClient.fromEnv() is the explicit environment-driven path for automation. Constructors do not silently read the user’s home directory. Capabilities and Computer Use are available directly on Sandbox through capabilityStatus(), computerUseStatus(), and the display, screenshot, mouse, and keyboard methods.