e30e75b5d4
Code Quality / Oxlint + Oxfmt (push) Waiting to run
Code Quality / Template Sync (push) Waiting to run
Code Quality / Build Changed Packages (push) Waiting to run
Code Quality / Test Changed Packages (push) Waiting to run
Deploy Expo Example / Deploy Production (push) Waiting to run
Deploy Ink Example / Deploy Production (push) Waiting to run
Python Tests / pytest (assistant-stream, 3.10) (push) Waiting to run
Python Tests / pytest (assistant-stream, 3.12) (push) Waiting to run
Python Tests / pytest (assistant-ui-sync-server-api, 3.10) (push) Waiting to run
Python Tests / pytest (assistant-ui-sync-server-api, 3.12) (push) Waiting to run
Deploy Shadcn Registry / Deploy Production (push) Waiting to run
Template Metrics / LOC + Bundle Size (push) Waiting to run
Changesets / Create Version PR (push) Has been cancelled
40 lines
1.1 KiB
Markdown
40 lines
1.1 KiB
Markdown
# `@assistant-ui/react-opencode`
|
|
|
|
[OpenCode](https://opencode.ai) runtime adapter for `@assistant-ui/react`. Maps OpenCode activity onto the standard assistant-ui message primitives so an OpenCode session can drive a Thread UI.
|
|
|
|
> [!NOTE]
|
|
> This integration is experimental. APIs may change between minor versions.
|
|
|
|
## Installation
|
|
|
|
```bash
|
|
npm install @assistant-ui/react @assistant-ui/react-opencode
|
|
```
|
|
|
|
## Usage
|
|
|
|
```tsx
|
|
import { AssistantRuntimeProvider } from "@assistant-ui/react";
|
|
import { useOpenCodeRuntime } from "@assistant-ui/react-opencode";
|
|
import { Thread } from "@/components/assistant-ui/thread";
|
|
|
|
export function App() {
|
|
const runtime = useOpenCodeRuntime({
|
|
apiUrl: "http://localhost:4096",
|
|
});
|
|
|
|
return (
|
|
<AssistantRuntimeProvider runtime={runtime}>
|
|
<Thread />
|
|
</AssistantRuntimeProvider>
|
|
);
|
|
}
|
|
```
|
|
|
|
## See also
|
|
|
|
- `@assistant-ui/react-ai-sdk` for general-purpose Vercel AI SDK integration.
|
|
- `@assistant-ui/react-langgraph` for LangGraph agents.
|
|
|
|
Full reference at [assistant-ui.com/docs/runtimes/opencode](https://www.assistant-ui.com/docs/runtimes/opencode).
|