{"id":31764962,"url":"https://github.com/vercel-labs/coding-agent-template","last_synced_at":"2025-10-10T00:03:00.776Z","repository":{"id":316345701,"uuid":"1062625887","full_name":"vercel-labs/coding-agent-template","owner":"vercel-labs","description":"Multi-agent AI coding platform powered by Vercel Sandbox and AI Gateway","archived":false,"fork":false,"pushed_at":"2025-10-07T18:35:17.000Z","size":693,"stargazers_count":955,"open_issues_count":0,"forks_count":136,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-10-07T19:45:10.489Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vercel-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-23T14:00:46.000Z","updated_at":"2025-10-07T18:35:21.000Z","dependencies_parsed_at":"2025-09-24T04:25:55.424Z","dependency_job_id":null,"html_url":"https://github.com/vercel-labs/coding-agent-template","commit_stats":null,"previous_names":["vercel-labs/coding-agent-template"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/vercel-labs/coding-agent-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vercel-labs%2Fcoding-agent-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vercel-labs%2Fcoding-agent-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vercel-labs%2Fcoding-agent-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vercel-labs%2Fcoding-agent-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vercel-labs","download_url":"https://codeload.github.com/vercel-labs/coding-agent-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vercel-labs%2Fcoding-agent-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002366,"owners_count":26083355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-10T00:01:35.879Z","updated_at":"2025-10-10T00:03:00.772Z","avatar_url":"https://github.com/vercel-labs.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Agent Orchestration"],"sub_categories":[],"readme":"# Coding Agent Template\n\nA template for building AI-powered coding agents that supports Claude Code, OpenAI's Codex CLI, Cursor CLI, Google Gemini CLI, and opencode with [Vercel Sandbox](https://vercel.com/docs/vercel-sandbox) to automatically execute coding tasks on your repositories.\n\n![Coding Agent Template Screenshot](screenshot.png)\n\n## Deploy Your Own\n\nYou can deploy your own version of the coding agent template to Vercel with one click:\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel-labs%2Fcoding-agent-template\u0026env=POSTGRES_URL,ANTHROPIC_API_KEY,GITHUB_TOKEN,VERCEL_TEAM_ID,VERCEL_PROJECT_ID,VERCEL_TOKEN,AI_GATEWAY_API_KEY\u0026envDescription=Required+environment+variables+for+the+coding+agent+template.+Optional+variables+(CURSOR_API_KEY+for+Cursor+agent,+NPM_TOKEN+for+private+packages)+can+be+added+later+in+your+Vercel+project+settings.\u0026project-name=coding-agent-template\u0026repository-name=coding-agent-template)\n\n## Features\n\n- **Multi-Agent Support**: Choose from Claude Code, OpenAI Codex CLI, Cursor CLI, Google Gemini CLI, or opencode to execute coding tasks\n- **Vercel Sandbox**: Runs code in isolated, secure sandboxes ([docs](https://vercel.com/docs/vercel-sandbox))\n- **AI Gateway Integration**: Built for seamless integration with [Vercel AI Gateway](https://vercel.com/docs/ai-gateway) for model routing and observability\n- **AI-Generated Branch Names**: Automatically generates descriptive Git branch names using AI SDK 5 + AI Gateway\n- **Task Management**: Track task progress with real-time updates\n- **Persistent Storage**: Tasks stored in Neon Postgres database\n- **Git Integration**: Automatically creates branches and commits changes\n- **Modern UI**: Clean, responsive interface built with Next.js and Tailwind CSS\n- **MCP Server Support**: Connect MCP servers to Claude Code for extended capabilities (Claude only)\n\n## Setup\n\n### 1. Clone the repository\n\n```bash\ngit clone https://github.com/vercel-labs/coding-agent-template.git\ncd coding-agent-template\n```\n\n### 2. Install dependencies\n\n```bash\npnpm install\n```\n\n### 3. Set up environment variables\n\nCreate a `.env.local` file with your values:\n\nRequired environment variables:\n\n- `POSTGRES_URL`: Your PostgreSQL connection string (works with any PostgreSQL database)\n- `ANTHROPIC_API_KEY`: Your Anthropic API key for Claude\n- `GITHUB_TOKEN`: GitHub personal access token (for repository access)\n- `VERCEL_TEAM_ID`: Your Vercel team ID\n- `VERCEL_PROJECT_ID`: Your Vercel project ID\n- `VERCEL_TOKEN`: Your Vercel API token\n- `AI_GATEWAY_API_KEY`: Your AI Gateway API key for AI-generated branch names and Codex agent support\n\nOptional environment variables:\n\n- `CURSOR_API_KEY`: For Cursor agent support\n- `GEMINI_API_KEY`: For Google Gemini agent support\n- `NPM_TOKEN`: For private npm packages\n- `ENCRYPTION_KEY`: 32-byte hex string for encrypting MCP OAuth secrets (required only when using MCP connectors). Generate with: `openssl rand -hex 32`\n\n### 4. Set up the database\n\nGenerate and run database migrations:\n\n```bash\npnpm db:generate\npnpm db:push\n```\n\n### 5. Start the development server\n\n```bash\npnpm dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000) in your browser.\n\n## Usage\n\n1. **Create a Task**: Enter a repository URL and describe what you want the AI to do\n2. **Monitor Progress**: Watch real-time logs as the agent works\n3. **Review Results**: See the changes made and the branch created\n4. **Manage Tasks**: View all your tasks in the sidebar with status updates\n\n## How It Works\n\n1. **Task Creation**: When you submit a task, it's stored in the database\n2. **AI Branch Name Generation**: AI SDK 5 + AI Gateway automatically generates a descriptive branch name based on your task (non-blocking using Next.js 15's `after()`)\n3. **Sandbox Setup**: A Vercel sandbox is created with your repository\n4. **Agent Execution**: Your chosen coding agent (Claude Code, Codex CLI, Cursor CLI, Gemini CLI, or opencode) analyzes your prompt and makes changes\n5. **Git Operations**: Changes are committed and pushed to the AI-generated branch\n6. **Cleanup**: The sandbox is shut down to free resources\n\n## Environment Variables\n\n### Required\n\n- `POSTGRES_URL`: PostgreSQL connection string\n- `ANTHROPIC_API_KEY`: Claude API key\n- `GITHUB_TOKEN`: GitHub token for repository access\n- `VERCEL_TEAM_ID`: Vercel team ID for sandbox creation\n- `VERCEL_PROJECT_ID`: Vercel project ID for sandbox creation\n- `VERCEL_TOKEN`: Vercel API token for sandbox creation\n- `AI_GATEWAY_API_KEY`: AI Gateway API key for branch name generation and Codex agent support\n\n### Optional\n\n- `CURSOR_API_KEY`: Cursor agent API key\n- `GEMINI_API_KEY`: Google Gemini agent API key (get yours at [Google AI Studio](https://aistudio.google.com/apikey))\n- `NPM_TOKEN`: NPM token for private packages\n- `ENCRYPTION_KEY`: 32-byte hex string for encrypting MCP OAuth secrets (required only when using MCP connectors). Generate with: `openssl rand -hex 32`\n\n## AI Branch Name Generation\n\nThe system automatically generates descriptive Git branch names using AI SDK 5 and Vercel AI Gateway. This feature:\n\n- **Non-blocking**: Uses Next.js 15's `after()` function to generate names without delaying task creation\n- **Descriptive**: Creates meaningful branch names like `feature/user-authentication-A1b2C3` or `fix/memory-leak-parser-X9y8Z7`\n- **Conflict-free**: Adds a 6-character alphanumeric hash to prevent naming conflicts\n- **Fallback**: Gracefully falls back to timestamp-based names if AI generation fails\n- **Context-aware**: Uses task description, repository name, and agent context for better names\n\n### Branch Name Examples\n\n- `feature/add-user-auth-K3mP9n` (for \"Add user authentication with JWT\")\n- `fix/resolve-memory-leak-B7xQ2w` (for \"Fix memory leak in image processing\")\n- `chore/update-deps-M4nR8s` (for \"Update all project dependencies\")\n- `docs/api-endpoints-F9tL5v` (for \"Document REST API endpoints\")\n\n## Tech Stack\n\n- **Frontend**: Next.js 15, React 19, Tailwind CSS\n- **UI Components**: shadcn/ui\n- **Database**: PostgreSQL with Drizzle ORM\n- **AI SDK**: AI SDK 5 with Vercel AI Gateway integration\n- **AI Agents**: Claude Code, OpenAI Codex CLI, Cursor CLI, Google Gemini CLI, opencode\n- **Sandbox**: [Vercel Sandbox](https://vercel.com/docs/vercel-sandbox)\n- **Git**: Automated branching and commits with AI-generated branch names\n\n## MCP Server Support\n\nConnect MCP Servers to extend Claude Code with additional tools and integrations. **Currently only works with Claude Code agent.**\n\n### How to Add MCP Servers\n\n1. Go to the \"Connectors\" tab and click \"Add MCP Server\"\n2. Enter server details (name, base URL, optional OAuth credentials)\n3. If using OAuth, generate encryption key: `openssl rand -hex 32`\n4. Add to `.env.local`: `ENCRYPTION_KEY=your-32-byte-hex-key`\n\n**Note**: `ENCRYPTION_KEY` is only required when using MCP servers with OAuth authentication.\n\n## Development\n\n### Database Operations\n\n```bash\n# Generate migrations\npnpm db:generate\n\n# Push schema changes\npnpm db:push\n\n# Open Drizzle Studio\npnpm db:studio\n```\n\n### Running the App\n\n```bash\n# Development\npnpm dev\n\n# Build for production\npnpm build\n\n# Start production server\npnpm start\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Test thoroughly\n5. Submit a pull request\n\n## Security Considerations\n\n- **Environment Variables**: Never commit `.env` files to version control. All sensitive data should be stored in environment variables.\n- **API Keys**: Rotate your API keys regularly and use the principle of least privilege.\n- **Database Access**: Ensure your PostgreSQL database is properly secured with strong credentials.\n- **Vercel Sandbox**: Sandboxes are isolated but ensure you're not exposing sensitive data in logs or outputs.\n- **GitHub Token**: Use a personal access token with minimal required permissions for repository access.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvercel-labs%2Fcoding-agent-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvercel-labs%2Fcoding-agent-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvercel-labs%2Fcoding-agent-template/lists"}