Get started#

Install#

Thread requires Node 22 or later; Ferry requires Node 22.12 or later. Both use ESM. Install the packages your application needs with its existing package manager:

pnpm add @kontourai/thread @kontourai/ferry
pnpm exec ferry formats

For a standalone command, install Ferry globally with your package manager (for example pnpm add -g @kontourai/ferry), then use ferry. The examples below assume its executable is on PATH. Package versions and the canonical schema version are distinct; see compatibility.

Convert a transcript#

ferry inspect rollout.jsonl
ferry convert rollout.jsonl --from codex -o session.thread.json
ferry convert session.thread.json --to anthropic-messages -o messages.json

Detection reads content rather than trusting the filename. Pass --from when auto-detection cannot identify a transcript. Commands consume files, not stdin. Start with a single file, inspect stderr warnings, and compare the converted content with the source before processing an archive. Provider export can require caller repairs such as a leading user turn or a missing tool result; see formats.

Use the libraries#

import { readFileSync } from "node:fs";
import { importThreads, exportThread } from "@kontourai/ferry";
import { threadFromJson, threadToJson } from "@kontourai/thread";

const [thread] = importThreads(readFileSync("rollout.jsonl", "utf8"), "codex", {
  onWarn: (message) => console.error(message),
});
if (!thread) throw new Error("No conversation imported");
const canonical = threadToJson(thread);
const validated = threadFromJson(canonical);
const messages = exportThread(validated, "openai-chat");

importThreads returns an array because ChatGPT exports can hold multiple conversations. Direct adapter functions are also exported. Import warnings are opt-in through onWarn for adapters that support them; the CLI supplies a stderr callback. Keep the original transcript when archival fidelity matters.

Build this checkout#

pnpm --version                  # packageManager pins 11.25.0
pnpm install --frozen-lockfile
npm run build
node packages/ferry/dist/src/cli.js formats
node packages/ferry/dist/src/cli.js inspect packages/ferry/tests/fixtures/codex-rollout.jsonl

In this checkout, Ferry uses the local Thread in packages/thread: its dependency is declared as workspace:^, which pnpm install links. The published Ferry package depends on the matching Thread release (^<thread version>) instead, because pnpm rewrites the range when the package is packed for publishing. Build Thread before Ferry; the root recursive build orders them. The root package is private; the two members publish separately. The development checks use Vitest 5, and the workspace explicitly approves the esbuild 0.28.2 platform-binary installer. These tools do not change the canonical Thread schema or Ferry's workspace:^ dependency. Ferry uses Commander 15.1 for command-line parsing. The declared Ferry commands, option names and transcript formats are unchanged. Use the contributor route for verification and release ownership.

Source: docs/getting-started.md