Skip to content

Repo for using the codex app server in TS makes a clean api

Notifications You must be signed in to change notification settings

brrock/codex-app-server-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codex-app-server-ts

TypeScript client for Codex App Server with a clean, modern API.

Install

bun add codex-app-server-ts

Usage

See 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();

API

Create Client

await CodexClient.create({
  codexHome: "~/.codex",      // custom codex home
  clientInfo: { name, title, version },
  capabilities: { experimentalApi: true },
  debug: true,
});

Threads

const thread = await client.createThread({ model: "gpt-5.1-codex" });
await thread.send("message");
client.thread(); // current thread
await client.listThreads();

Events

client.on("turn.completed", (turn) => {});
client.on("error", (err) => {});
client.onStateChange((state) => {});

Dev

bun run generate  # generate schemas
bun run build     # build with tsdown
bun run typecheck
bun run example

License

MIT

About

Repo for using the codex app server in TS makes a clean api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages