open-index/open-npm huggingface dataset:
npm package: @headless-coder-sdk/claude-adapter
Description: Anthropic Claude adapter for the Headless Coder SDK. It wraps `@anthropic-ai/claude-agent-sdk` behind the unified `createCoder`/`ThreadHandle` interface so you can swap providers without touching the rest of your agent logic.
Latest version: 0.26.0

# @headless-coder-sdk/claude-adapter

Anthropic Claude adapter for the Headless Coder SDK. It wraps `@anthropic-ai/claude-agent-sdk` behind the unified `createCoder`/`ThreadHandle` interface so you can swap providers without touching the rest of your agent logic.

## Installation

```bash
npm install @headless-coder-sdk/core @headless-coder-sdk/claude-adapter @anthropic-ai/claude-agent-sdk
```

## Usage

```ts
import { createHeadlessClaude } from '@headless-coder-sdk/claude-adapter';

const coder = createHeadlessClaude({ permissionMode: 'bypassPermissions' });

const thread = await coder.startThread({ workingDirectory: process.cwd() });
const result = await thread.run('Summarise the feature flag rollout plan.');
console.log(result.text);
```

`createHeadlessClaude` registers the adapter (if needed) and returns a coder so you can skip the manual `registerAdapter` boilerplate.

> Heads up: the Anthropic SDK requires Node 18+. Make sure the `CLAUDE_API_KEY` environment variable is available before running the adapter.
npm package: @headless-coder-sdk/codex-adapter
Description: Adapter that bridges the OpenAI Codex CLI/SDK into the Headless Coder SDK interface.
Latest version: 0.26.0

# @headless-coder-sdk/codex-adapter

Adapter that bridges the OpenAI Codex CLI/SDK into the Headless Coder SDK interface.

## Installation

```bash
npm install @headless-coder-sdk/core @headless-coder-sdk/codex-adapter
```

## Usage

```ts
import { createHeadlessCodex } from '@headless-coder-sdk/codex-adapter';

if (typeof window !== 'undefined') {
  throw new Error('Codex adapter is server-only');
}

const coder = createHeadlessCodex({ workingDirectory: process.cwd() });
const thread = await coder.startThread();
const turn = await thread.run('Write unit tests for the git helper.');
console.log(turn.text);
```

`createHeadlessCodex` registers the adapter (if necessary) and returns a coder in one call so you no longer have to wire up `registerAdapter` manually.

## Next.js / server frameworks

The adapter interacts with the Codex CLI via Node APIs, so keep it on the server:

```ts
export async function POST() {
  if (typeof window !== 'undefined') {
    throw new Error('Codex adapter must run on the server');
  }
  const { createHeadlessCodex } = await import('@headless-coder-sdk/codex-adapter');
  const coder = createHeadlessCodex({ workingDirectory: process.cwd() });
  const thread = await coder.startThread();
  const result = await thread.run('List open pull requests');
  return Response.json({ text: result.text });
}
```

The adapter is server-only because it shells out to the Codex executable and depends on the Node.js runtime.
npm package: @headless-coder-sdk/gemini-adapter
Description: Google Gemini CLI adapter for the Headless Coder SDK. It shells out to the Gemini binary in headless mode and exposes the same `ThreadHandle` contract used by the other providers.
Latest version: 0.26.0

# @headless-coder-sdk/gemini-adapter

Google Gemini CLI adapter for the Headless Coder SDK. It shells out to the Gemini binary in headless mode and exposes the same `ThreadHandle` contract used by the other providers.

## Installation

```bash
npm install @headless-coder-sdk/core @headless-coder-sdk/gemini-adapter
```

You will also need the Gemini CLI installed somewhere on your PATH (or pass `geminiBinaryPath` when starting the adapter).

## Usage

```ts
import { createHeadlessGemini } from '@headless-coder-sdk/gemini-adapter';

const coder = createHeadlessGemini({
  includeDirectories: [process.cwd()],
  workingDirectory: process.cwd(),
});

const thread = await coder.startThread();
const result = await thread.run('List the areas of the repo that need more tests.');
console.log(result.text);
```

`createHeadlessGemini` registers the adapter and returns a coder, so you can instantiate it inside server code without touching the registry manually.

> Note: resume support depends on the Gemini CLI version—check the package README or upstream release notes for the latest status. The adapter shells out via Node’s `child_process`, so keep it on the server (Next.js API routes, background workers, etc.).