Surgent is an agentic development workspace that pairs Claude Code with Daytona sandboxes. This monorepo contains everything needed to run the UI, Convex backend, and preview proxy locally or in production.
demo-surgent-deploy.mp4- Next.js 15, React 19, Tailwind CSS 4 for the front-end (apps/web).
- Convex 1.x with @convex-dev/auth and @ai-sdk/* providers for data, auth, and agent orchestration (packages/backend).
- Daytona sandboxes managed through @daytonaio/sdk, fronted by a Cloudflare Worker that proxies previews, dispatches requests, and exposes a /deploy webhook (apps/worker).
- Turborepo 2.5 orchestrating builds; Bun 1.2.20 as the package manager/runtime.
- TypeScript 5.9 everywhere with ESLint 9 and Prettier 3 for linting and formatting.
- Chat-first project view that logs timeline updates, todos, and session output in real time.
- Daytona-backed sandbox control: create, resume, or deploy environments with a single mutation.
- Live browser previews proxied through the Cloudflare Worker with automatic Daytona warm-up and token handling.
- One-click deploys: Convex calls the Worker /deploy endpoint to package and push Cloudflare Dispatch workers.
- Drop in credentials for Anthropic Claude, OpenAI, and Google OAuth to enable providers instantly.
| apps/web | Next.js dashboard, chat surface, and preview UI. |
| apps/worker | Cloudflare Worker for preview proxying, dispatch routing, and /deploy uploads. |
| packages/backend | Convex functions, auth config, and agent orchestration helpers. |
| packages/typescript-config | Shared TypeScript presets consumed by all workspaces. |
- Node.js 18+
- Bun 1.2.20 (packageManager pin)
- Convex CLI (npm i -g convex) and a Convex project/URL
- Wrangler CLI 4.x (bunx wrangler or npm i -g wrangler) for the Cloudflare Worker
- Daytona API credentials with access to the default-web-env:1.0.0 snapshot
- API keys for Anthropic and/or OpenAI, plus Google OAuth client credentials
Create these files (or export the same variables in your shell) before running anything:
packages/backend/.env.local
apps/web/.env.local
Run bun run --filter @repo/backend setup once to ensure convex dev can reach your Convex deployment and to confirm the site URL.
apps/worker/.dev.vars (loaded by wrangler dev) or remote Wrangler vars/secrets:
Set secrets in production with:
- Claude Code (Anthropic) — Set ANTHROPIC_BASE_URL=https://api.anthropic.com and provide an ANTHROPIC_API_KEY created from the Anthropic console. Pass model: "claude-3.5-sonnet" (or any Claude Code variant) when triggering the agent if you want to override the default.
- GLM-4.5 — The backend defaults to glm-4.5 when an Anthropic-compatible endpoint is supplied. Use ANTHROPIC_BASE_URL=https://api.z.ai/api/anthropic and copy the API token from your https://docs.z.ai/scenario-example/develop-tools/claude. Store that value in ANTHROPIC_API_KEY.
This starts convex dev, next dev --turbopack --port 3000, and wrangler dev for the Cloudflare Worker (default preview host https://localhost:8787). Visit http://localhost:3000 to sign in, create a project, and view the live preview served from https://3000-<sandbox-id>.localhost:8787.
Individual dev servers:
- Deploy Convex with bun run --filter @repo/backend deploy.
- Deploy the Cloudflare Worker with bun run --filter worker deploy (or cd apps/worker && bun run deploy).
- Run next build output (apps/web/.next) behind your hosting provider of choice.
| bun run dev | Run all dev tasks through Turborepo. |
| bun run lint | Lint the repo with ESLint. |
| bun run check-types | Project-wide type checking. |
| bun run build | Build all workspaces for production. |
| bun run format | Format .ts, .tsx, and .md files with Prettier. |
| bun run --filter @repo/backend setup | Block until convex dev can reach the deployment. |
| bun run --filter @repo/backend create-snapshot | Create a Daytona snapshot (requires credentials). |
| bun run --filter worker dev | Run the Cloudflare Worker locally via Wrangler. |
| bun run --filter worker deploy | Deploy the Worker to Cloudflare. |
Open an issue or pull request with your proposed change. Please run bun run lint and bun run check-types before submitting.
.png)
