_ β _ _
___ _ __ ___ _ __ ___ ___ __| | ___ β__ _(_) |__ ___
/ _ \| '_ \ / _ \ '_ \ / __/ _ \ / _` |/ _ \β\ \ / / | '_ \ / _ \
| (_) | |_) | __/ | | | (_| (_) | (_| | __/β \ V /| | |_) | __/
\___/| .__/ \___|_| |_|\___\___/ \__,_|\___β \_/ |_|_.__/ \___|
|_| β
Next.js 16 rebuild of the OpenCode web application. Real-time chat UI with streaming message display, SSE sync, and React Server Components.
Warning: This project uses Next.js 16 canary - bleeding edge, expect rough edges. Catppuccin-themed because we're not savages.
Prerequisites: Bun v1.3+ and OpenCode CLI running locally.
# 1. Install dependencies
bun install
# 2. Start OpenCode (any mode - TUI or serve)
cd /path/to/your/project
opencode
# 3. Start the web UI
bun dev
# 4. Open browser
# Navigate to: http://localhost:8423The web UI auto-discovers all running OpenCode processes. No configuration needed.
Monorepo structure:
apps/web/- Next.js 16 web application (App Router, RSC, Tailwind)packages/core/- Framework-agnostic SDK layer (router, types, utilities)packages/react/- React bindings (hooks, providers, store)docs/- Architecture Decision Records and implementation guides
- Multi-server discovery - Finds all running OpenCode processes automatically via
lsof - Cross-process messaging - Send from web UI, appears in your TUI
- Real-time streaming - Messages stream in as the AI generates them
- SSE sync - All updates pushed via Server-Sent Events
- Slash commands - Type
/for actions like/fix,/test,/refactor - File references - Type
@to fuzzy-search and attach files as context - Catppuccin theme - Latte (light) / Mocha (dark) with proper syntax highlighting
Available scripts:
# Development
bun dev # Start Next.js dev server (port 8423 = VIBE)
bun build # Production build
# Code quality
bun run typecheck # TypeScript check (via turbo, checks all packages)
bun lint # Run oxlint
bun format # Format with Biome
# Testing
bun test # Run tests (Vitest)
bun test --watch # Watch modeCRITICAL: Always run bun run typecheck from repo root before committing. Turbo checks the full monorepo.
| Layer | Technology | Why |
|---|---|---|
| Runtime | Bun | Fast all-in-one runtime |
| Framework | Next.js 16 | React Server Components, App Router |
| Bundler | Turbopack | Next-gen bundler |
| Language | TypeScript 5+ | Type safety |
| Linting | oxlint | Fast Rust-based linter |
| Formatting | Biome | Fast formatter |
| Styling | Tailwind CSS | Utility-first CSS |
| State | Zustand | Lightweight state management |
| SDK | @opencode-ai/sdk | OpenCode API client |
apps/web/README.md- Web app architecture and patternspackages/core/README.md- Core SDK and router documentationpackages/react/README.md- React hooks and providersdocs/adr/- Architecture Decision Recordsdocs/guides/- Implementation guides (SSE sync, mobile, subagents)AGENTS.md- AI agent conventions and development patterns
- Use Bun (not npm/pnpm)
- Follow TDD: RED β GREEN β REFACTOR
- Run
bun formatbefore committing - Check
bun lintandbun run typecheckpass
MIT