mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
1.5 KiB
1.5 KiB
OpenCode WebUI - Agent Guidelines
Commands
npm run dev- Start both backend (8080) and frontend (5173)npm run dev:backend- Backend only:bun --watch backend/src/index.tsnpm run dev:frontend- Frontend only:cd frontend && vitenpm run build- Build both backend and frontendnpm run test- Run backend tests:cd backend && bun testcd backend && bun test <filename>- Run single test filecd backend && vitest --ui- Test UI with coveragecd backend && vitest --coverage- Coverage reportcd frontend && npm run lint- Frontend linting
Code Style
- No comments, self-documenting code only
- Strict TypeScript everywhere, proper typing required
- Named imports only:
import { Hono } from 'hono',import { useState } from 'react'
Backend (Bun + Hono)
- Hono framework with Zod validation
- Error handling with try/catch and logging
- Follow existing route/service/utility structure
- Use async/await consistently, avoid .then() chains
Frontend (React + Vite)
- @/ alias for components:
import { Button } from '@/components/ui/button' - Radix UI + Tailwind CSS, React Hook Form + Zod
- React Query for state management
- ESLint TypeScript rules enforced
- Use React hooks properly, no direct state mutations
General
- DRY principles, follow existing patterns
- ./opencode-src/ is reference only, never commit
- Use shared types from workspace package
- OpenCode server runs on port 5551, backend API on port 8080