Documents
README
README
Type
External
Status
Published
Created
Mar 17, 2026
Updated
Mar 23, 2026
Updated by
Dosu Bot

@assistant-ui/react-ink#

React Ink (terminal UI) bindings for assistant-ui.

Build AI chat interfaces for the terminal using Ink — React for CLIs — powered by the same runtime as assistant-ui.

Installation#

npm install @assistant-ui/react-ink ink react

Quick Start#

import { render } from "ink";
import { Box, Text } from "ink";
import {
  AssistantProvider,
  useLocalRuntime,
  ThreadRoot,
  ThreadMessages,
  ComposerInput,
  type ChatModelAdapter,
} from "@assistant-ui/react-ink";

const myAdapter: ChatModelAdapter = {
  async *run({ messages }) {
    // your AI backend here
    yield { content: [{ type: "text", text: "Hello from AI!" }] };
  },
};

function App() {
  const runtime = useLocalRuntime(myAdapter);

  return (
    <AssistantProvider runtime={runtime}>
      <ThreadRoot>
        <ThreadMessages
          renderMessage={({ message }) => (
            <Box marginBottom={1}>
              <Text>
                {message.content
                  .filter((p) => p.type === "text")
                  .map((p) => p.text)
                  .join("")}
              </Text>
            </Box>
          )}
        />
        <ComposerInput submitOnEnter placeholder="Message..." autoFocus />
      </ThreadRoot>
    </AssistantProvider>
  );
}

render(<App />);

Features#

  • Composable, unstyled primitives (Thread, Composer, Message, ActionBar, etc.)
  • Streaming responses with real-time updates
  • Tool call support with built-in ToolFallback component
  • Diff rendering with DiffPrimitive components and DiffView for unified diffs and file comparisons in the terminal
  • Message branching and editing
  • Multi-thread support with thread list management
  • Markdown rendering via @assistant-ui/react-ink-markdown
  • Same runtime as @assistant-ui/react — share adapters, tools, and backend code

Documentation#

License#

MIT