A template for building AI-powered coding agents that supports Claude Code, OpenAI's Codex CLI, Cursor CLI, and opencode with Vercel Sandbox to automatically execute coding tasks on your repositories.
You can deploy your own version of the coding agent template to Vercel with one click:
- Multi-Agent Support: Choose from Claude Code, OpenAI Codex CLI, Cursor CLI, or opencode to execute coding tasks
- Vercel Sandbox: Runs code in isolated, secure sandboxes (docs)
- AI Gateway Integration: Built for seamless integration with Vercel AI Gateway for model routing and observability
- Task Management: Track task progress with real-time updates
- Persistent Storage: Tasks stored in Neon Postgres database
- Git Integration: Automatically creates branches and commits changes
- Modern UI: Clean, responsive interface built with Next.js and Tailwind CSS
git clone https://github.com/vercel-labs/coding-agent-template.git
cd coding-agent-template
pnpm install
Copy the example environment file and fill in your values:
cp .env.example .env.local
Required environment variables:
POSTGRES_URL
: Your PostgreSQL connection string (works with any PostgreSQL database)ANTHROPIC_API_KEY
: Your Anthropic API key for ClaudeGITHUB_TOKEN
: GitHub personal access token (for repository access)VERCEL_TEAM_ID
: Your Vercel team IDVERCEL_PROJECT_ID
: Your Vercel project IDVERCEL_TOKEN
: Your Vercel API token
Optional environment variables:
CURSOR_API_KEY
: For Cursor agent supportOPENAI_API_KEY
: For Codex agent supportNPM_TOKEN
: For private npm packages
Generate and run database migrations:
pnpm db:generate
pnpm db:push
pnpm dev
Open http://localhost:3000 in your browser.
- Create a Task: Enter a repository URL and describe what you want the AI to do
- Monitor Progress: Watch real-time logs as the agent works
- Review Results: See the changes made and the branch created
- Manage Tasks: View all your tasks in the sidebar with status updates
- Task Creation: When you submit a task, it's stored in the database
- Sandbox Setup: A Vercel sandbox is created with your repository
- Agent Execution: Your chosen coding agent (Claude Code, Codex CLI, Cursor CLI, or opencode) analyzes your prompt and makes changes
- Git Operations: Changes are committed and pushed to a new branch
- Cleanup: The sandbox is shut down to free resources
POSTGRES_URL
: PostgreSQL connection stringANTHROPIC_API_KEY
: Claude API keyGITHUB_TOKEN
: GitHub token for repository accessVERCEL_TEAM_ID
: Vercel team ID for sandbox creationVERCEL_PROJECT_ID
: Vercel project ID for sandbox creationVERCEL_TOKEN
: Vercel API token for sandbox creation
CURSOR_API_KEY
: Cursor agent API keyOPENAI_API_KEY
: OpenAI API key for CodexNPM_TOKEN
: NPM token for private packages
- Frontend: Next.js 15, React 19, Tailwind CSS
- UI Components: shadcn/ui
- Database: PostgreSQL with Drizzle ORM
- AI Agents: Claude Code, OpenAI Codex CLI, Cursor CLI, opencode
- Sandbox: Vercel Sandbox
- Git: Automated branching and commits
# Generate migrations
pnpm db:generate
# Push schema changes
pnpm db:push
# Open Drizzle Studio
pnpm db:studio
# Development
pnpm dev
# Build for production
pnpm build
# Start production server
pnpm start
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
- Environment Variables: Never commit
.env
files to version control. All sensitive data should be stored in environment variables. - API Keys: Rotate your API keys regularly and use the principle of least privilege.
- Database Access: Ensure your PostgreSQL database is properly secured with strong credentials.
- Vercel Sandbox: Sandboxes are isolated but ensure you're not exposing sensitive data in logs or outputs.
- GitHub Token: Use a personal access token with minimal required permissions for repository access.