Skip to content
Back to search

open-harness

A code-first, composable SDK to build powerful AI agents

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/maxgfeller--open-harness/badge.svg)](/listings/maxgfeller--open-harness)

HTML

<a href="/listings/maxgfeller--open-harness"><img src="/api/listings/maxgfeller--open-harness/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

npm install @openharness/core @ai-sdk/openai
import { Agent, createFsTools, createBashTool, NodeFsProvider, NodeShellProvider } from "@openharness/core";
import { openai } from "@ai-sdk/openai";

const agent = new Agent({
  name: "dev",
  model: openai("gpt-5.4"),
  tools: {
    ...createFsTools(new NodeFsProvider()),
    ...createBashTool(new NodeShellProvider()),
  },
  maxSteps: 20,
});

for await (const event of agent.run([], "Refactor the auth module")) {
  if (event.type === "text.delta") process.stdout.write(event.text);
}

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 123 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # OpenHarness
  2. [![npm version](https://img.shields.io/npm/v/%40openharness%2Fcore?label=core%20version)](https://www.npmjs.com/package/%40openharness/core)
  3. [![bundle size](https://img.shields.io/bundlephobia/minzip/%40openharness%2Fcore?label=core%20min%2Bgzip)](https://bundlephobia.com/package/%40openharness%2Fcore@latest)
  4. [![dependencies](https://img.shields.io/librariesio/release/npm/%40openharness%2Fcore?label=core%20dependencies)](https://libraries.io/npm/%40openharness%2Fcore)
  5. [![monthly downloads](https://img.shields.io/npm/dm/%40openharness%2Fcore?label=core%20downloads)](https://www.npmjs.com/package/%40openharness/core)
  6. [![license](https://img.shields.io/github/license/MaxGfeller/open-harness)](./LICENSE)
  7. Build capable, general-purpose AI agents in code. Based on [Vercel's AI SDK](https://sdk.vercel.ai), inspired by Claude Code, Codex, and similar agent harnesses.
  8. **[Documentation](https://docs.open-harness.dev)**
  9. ## Packages
  10. | Package | Description |
  11. | --- | --- |
  12. | [`@openharness/core`](packages/core) | Agent, Session, Conversation, middleware, tools, UI stream integration |
  13. | [`@openharness/provider-chatgpt`](packages/provider-chatgpt) | Experimental ChatGPT/Codex OAuth model provider for ChatGPT subscription-backed local harnesses |
  14. | [`@openharness/provider-vfs`](packages/provider-vfs) | Virtual filesystem provider for sandboxed, in-memory, or SQLite-backed file access |
  15. | [`@openharness/react`](packages/react) | React hooks and provider for AI SDK 5 chat UIs |
  16. | [`@openharness/vue`](packages/vue) | Vue 3 composables and provider for AI SDK 5 chat UIs |
  17. ## Quick Start
  18. ```bash
  19. npm install @openharness/core @ai-sdk/openai
  20. ```
  21. ```typescript
  22. import { Agent, createFsTools, createBashTool, NodeFsProvider, NodeShellProvider } from "@openharness/core";
  23. import { openai } from "@ai-sdk/openai";
  24. const agent = new Agent({
  25. name: "dev",
  26. model: openai("gpt-5.4"),
  27. tools: {
  28. ...createFsTools(new NodeFsProvider()),
  29. ...createBashTool(new NodeShellProvider()),
  30. },
  31. maxSteps: 20,
  32. });
  33. for await (const event of agent.run([], "Refactor the auth module")) {
  34. if (event.type === "text.delta") process.stdout.write(event.text);
  35. }
  36. ```
  37. ## Multi-Turn with Sessions
  38. ```typescript
  39. import { Session } from "@openharness/core";
  40. const session = new Session({ agent, contextWindow: 128_000 });
  41. for await (const event of session.send("List all TypeScript files")) {
  42. if (event.type === "text.delta") process.stdout.write(event.text);
  43. }
  44. // Session remembers the conversation, handles compaction and retry
  45. for await (const event of session.send("Now refactor the largest one")) {
  46. if (event.type === "text.delta") process.stdout.write(event.text);
  47. }
  48. ```
  49. ## Composable Middleware
  50. ```typescript
  51. import { Conversation, toRunner, apply, withTurnTracking, withCompaction, withRetry } from "@openharness/core";
  52. const runner = apply(
  53. toRunner(agent),
  54. withTurnTracking(),
  55. withCompaction({ contextWindow: 200_000, model: agent.model }),
  56. withRetry({ maxRetries: 5 }),
  57. );
  58. const chat = new Conversation({ runner });
  59. for await (const event of chat.send("Fix the bug")) { /* ... */ }
  60. ```
  61. ## Subagents
  62. Built-in subagents stay stateless by default, but you can now opt into:
  63. - Dynamic subagent catalogs resolved at run time
  64. - Resumable subagent sessions built on top of `Session`
  65. - Background runs with separate run IDs and session IDs
  66. ## Examples
  67. | Example | Run |
  68. | --- | --- |
  69. | [CLI agent](examples/cli) — terminal agent with tool approval and subagents | `pnpm --filter cli-demo start` or `pnpm --filter cli-demo start -- --chatgpt` |
  70. | [Next.js chat](examples/nextjs-demo) — streaming chat with `@openharness/react` | `pnpm --filter nextjs-demo dev` |
  71. | [Nuxt chat](examples/nuxt-demo) — streaming chat with `@openharness/vue` | `pnpm --filter nuxt-demo dev` |
  72. By default the examples use `OPENAI_API_KEY`. The CLI agent can instead use ChatGPT/Codex OAuth with `--chatgpt`.
  73. To run them:
  74. ```bash
  75. git clone https://github.com/MaxGfeller/open-harness.git
  76. cd open-harness
  77. echo "OPENAI_API_KEY=sk-..." > .env
  78. pnpm install && pnpm build
  79. ```
  80. ## Learn More
  81. See the full documentation at **[docs.open-harness.dev](https://docs.open-harness.dev)** for:
  82. - [Agents](https://docs.open-harness.dev/core/agents) — stateless executors, events, configuration
  83. - [Sessions](https://docs.open-harness.dev/core/sessions) — compaction, retry, persistence, hooks
  84. - [Middleware](https://docs.open-harness.dev/core/middleware) — composable middleware and the Conversation API
  85. - [Tools](https://docs.open-harness.dev/tools/built-in-tools) — filesystem, bash, custom tools, permissions
  86. - [Subagents](https://docs.open-harness.dev/advanced/subagents) — nested delegation, dynamic catalogs, resumable sessions, and background execution
  87. - [MCP Servers](https://docs.open-harness.dev/advanced/mcp-servers) — Model Context Protocol integration
  88. - [Skills](https://docs.open-harness.dev/advanced/skills) — on-demand instruction packages
  89. - [UI Integration](https://docs.open-harness.dev/ui-integration/server-streaming) — React and Vue streaming
  90. ## License
  91. MIT — see [LICENSE](./LICENSE) for details.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.