> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-harness.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Examples

> Example applications built with OpenHarness

OpenHarness ships with three example applications that demonstrate different integration patterns.

## CLI Agent

An interactive terminal agent with tool approval prompts, subagent display, and composed middleware.

```bash theme={"dark"}
pnpm --filter cli-demo start
```

To use ChatGPT/Codex OAuth instead of `OPENAI_API_KEY`:

```bash theme={"dark"}
pnpm --filter cli-demo start -- --chatgpt
```

**Features:**

* Tool approval prompts with queued display
* Subagent status with spinners
* Message compaction
* Optional ChatGPT/Codex OAuth provider via `--chatgpt`
* Composed middleware stack

**Source:** [`examples/cli`](https://github.com/MaxGfeller/open-harness/tree/main/examples/cli)

## Next.js Chat App

A full chat UI built with Next.js and `@openharness/react`.

```bash theme={"dark"}
cp examples/nextjs-demo/.env.example examples/nextjs-demo/.env
# Edit .env and add your OPENAI_API_KEY
pnpm --filter nextjs-demo dev
```

Then open [http://localhost:3000](http://localhost:3000).

**Features:**

* Streaming text and tool visualization
* Subagent status tracking
* `announce` tool for agent narration
* Session persistence (in-memory)
* Composed middleware (turn tracking, compaction, retry, persistence)

**Source:** [`examples/nextjs-demo`](https://github.com/MaxGfeller/open-harness/tree/main/examples/nextjs-demo)

## Nuxt Chat App

The same chat experience built with Vue 3, Nuxt 4, and `@openharness/vue`.

```bash theme={"dark"}
pnpm --filter nuxt-demo dev
```

Then open [http://localhost:3000](http://localhost:3000).

**Features:**

* Same capabilities as the Next.js example
* Vue 3 composables and reactive state
* Nuxt 4 server routes

**Source:** [`examples/nuxt-demo`](https://github.com/MaxGfeller/open-harness/tree/main/examples/nuxt-demo)

## Prerequisites

By default the examples use `OPENAI_API_KEY`. Create a `.env` file in the repo root:

```bash theme={"dark"}
echo "OPENAI_API_KEY=sk-..." > .env
```

The CLI example can instead use ChatGPT/Codex device login with `--chatgpt`.

Clone and build the repository first:

```bash theme={"dark"}
git clone https://github.com/MaxGfeller/open-harness.git
cd open-harness
pnpm install
pnpm build
```
