A Vite plugin that embeds Claude Code into your dev server. Chat with Claude to build, edit, and fix your app in real time.
npm install viagen
// vite.config.ts
import { defineConfig } from 'vite'
import { viagen } from 'viagen'
export default defineConfig({
plugins: [viagen()],
})
Deploy to a remote Vercel Sandbox with one command. Token-based auth on all endpoints.
One plugin, one env var. No framework dependency — works with any Vite project.
Built-in chat UI injected into your page. Ask Claude to build features, fix bugs, refactor code.
"Fix This Error" button on Vite's error overlay. One click and Claude starts fixing.
Claude can read, write, edit files, run commands, and search your codebase.
Real-time streamed responses. Watch Claude think and work through your codebase.
Deploy your dev server to a remote Vercel Sandbox — an isolated microVM with full tool access and token-based auth on every endpoint.
# Prerequisites: ANTHROPIC_API_KEY in .env
# + Vercel auth (pick one):
vercel link && vercel env pull
# or set VERCEL_TOKEN, VERCEL_TEAM_ID, VERCEL_PROJECT_ID
# Deploy
npx viagen sandbox
# Stop
npx viagen sandbox stop <sandboxId>
viagen({
position: 'bottom-right', // toggle button position
model: 'sonnet', // claude model
panelWidth: 420, // chat panel width in px
overlay: true, // fix button on error overlay
ui: true, // inject chat panel into pages
})
POST /via/chat — send a message, streamed SSE response
POST /via/chat/reset — clear conversation history
GET /via/health — check API key status
GET /via/error — latest build error (if any)
GET /via/ui — standalone chat interface