Fork Notice: This project is forked from DevAgentForge/claude-code-webui. Migrated from
@anthropic-ai/claude-agent-sdktoformagent-sdk.
A practical example demonstrating how to build a web-based AI agent interface using formagent-sdk.
This project showcases how to use formagent-sdk to build a full-featured AI agent web application. It demonstrates:
- 🔌 formagent-sdk Integration — Session management, streaming, tool execution
- 🌐 Web-based Agent Interface — Browser-accessible AI agent with real-time interaction
- 📱 Cross-platform Support — Works on desktop, mobile, and iPad
- 🛠️ Tool Permission Control — Approve/deny tool executions with user confirmation
- 💾 Session Persistence — SQLite-backed conversation history
Make sure you have Bun installed.
# Install Bun
curl -fsSL https://bun.sh/install | bashgit clone git@github.com:FormAgent/formagent-webui.git
cd formagent-webui
bun install
bun run startOpen your browser:
http://localhost:10086
PORT=3000 bun run startThis project demonstrates key formagent-sdk features:
import { createSession, builtinTools } from "formagent-sdk";
const session = await createSession({
model: "claude-sonnet-4-20250514",
cwd: "/your/working/directory",
tools: builtinTools,
});await session.send("Your prompt here");
for await (const event of session.receive()) {
if (event.type === "text") {
console.log(event.text);
} else if (event.type === "tool_use") {
console.log(`Tool: ${event.name}`, event.input);
}
}const session = await createSession({
hooks: {
PreToolUse: [{
matcher: ".*",
hooks: [async (input) => {
// Custom permission logic
return { continue: true };
}]
}]
}
});- React 19 + TypeScript
- Tailwind CSS 4
- Radix UI
- Zustand
- Markdown + syntax highlighting
- Streaming-first rendering
- Bun runtime
- Hono web framework
- WebSocket-based streaming
- SQLite (WAL mode)
- formagent-sdk
src/
├── index.tsx # Server entry (Hono + WebSocket)
├── libs/
│ ├── runner.ts # formagent-sdk integration
│ ├── session-store.ts # SQLite session management
│ └── util.ts # Utilities
├── components/ # React components
└── types.ts # Type definitions
PORT=10086
DB_PATH=./webui.db
CORS_ORIGIN=*API configuration:
ANTHROPIC_AUTH_TOKENANTHROPIC_BASE_URLANTHROPIC_MODEL
# Development mode with hot reload
bun run dev
# Build for production
bun run build
# Run production server
bun run startPRs are welcome.
- Fork this repository
- Create your feature branch
- Commit your changes
- Open a Pull Request
👉 Star it if it helps you.
