TypeScript client for Codex App Server with a clean, modern API.
bun add codex-app-server-tsSee the full documentation in ./docs.md full docs in
import { CodexClient } from "codex-app-server-ts";
const client = await CodexClient.create({
clientInfo: { name: "my-app", title: "My App", version: "1.0" },
});
const { textStream } = await client.createThread().send("Hello!");
for await (const part of textStream) {
process.stdout.write(part.text);
}
await client.disconnect();await CodexClient.create({
codexHome: "~/.codex", // custom codex home
clientInfo: { name, title, version },
capabilities: { experimentalApi: true },
debug: true,
});const thread = await client.createThread({ model: "gpt-5.1-codex" });
await thread.send("message");
client.thread(); // current thread
await client.listThreads();client.on("turn.completed", (turn) => {});
client.on("error", (err) => {});
client.onStateChange((state) => {});bun run generate # generate schemas
bun run build # build with tsdown
bun run typecheck
bun run exampleMIT