copilotkit-setup

Configures CopilotKit runtime, provider, and chat UI across Next.js, Vite, Angular, and Express projects.

Updated May 9, 2026
One-click install
npx skills add https://github.com/SebastienGt/LivingMargin-Google-Deepmind-Hackathon --skill copilotkit-setup-sebastiengt
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: copilotkit-setup
Source: https://github.com/SebastienGt/LivingMargin-Google-Deepmind-Hackathon/tree/main/.cursor/skills/copilotkit-setup
Command: npx skills add https://github.com/SebastienGt/LivingMargin-Google-Deepmind-Hackathon --skill copilotkit-setup-sebastiengt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @copilotkit/react, @copilotkit/core, @copilotkit/runtime, @copilotkit/agent, hono, express, and includes references (resource) and assets (resource) components.

What problem does it solve? Setting up CopilotKit requires coordinating frontend packages, a server-side runtime, endpoint factories, and provider configuration that differ per framework. This Skill automates framework detection and generates the correct wiring so the first working chat integration runs without trial and error. ## Core Features & Use Cases - Framework Detection: Identifies Next.js App Router, Next.js Pages Router, Angular, or Vite + React from signal files like next.config, angular.json, and vite.config before generating code. - Runtime Wiring: Creates CopilotRuntime endpoints using multi-route or single-route factories for Hono or Express, with BuiltInAgent model configuration for OpenAI, Anthropic, or Google. - Provider and Chat UI Setup: Configures CopilotKitProvider with runtimeUrl, useSingleEndpoint, and stylesheet imports, plus CopilotChat, CopilotSidebar, or CopilotPopup components. - Use Case: A developer with an existing Vite + React app asks to add an AI chat sidebar; the Skill detects Vite, scaffolds a standalone Express runtime with BuiltInAgent, and wires the provider to the backend URL. ## Quick Start Add CopilotKit with a working chat interface to my current project, detecting the framework and wiring the runtime and provider automatically.

Frequently Asked Questions about copilotkit-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add CopilotKit to a Next.js App Router project?▼

Install @copilotkit/react, @copilotkit/core, @copilotkit/runtime, and @copilotkit/agent, then create a catch-all route at src/app/api/copilotkit/[[...slug]]/route.ts using createCopilotEndpoint with a BuiltInAgent. Wrap your page in CopilotKitProvider with runtimeUrl="/api/copilotkit" and import the styles.css stylesheet.

What is the difference between multi-route and single-route CopilotKit endpoints?▼

Multi-route endpoints (createCopilotEndpoint) give each operation its own HTTP path and require a catch-all route, while single-route endpoints multiplex all operations through one POST endpoint using a method field. Single-route requires setting useSingleEndpoint on CopilotKitProvider.

Can I use CopilotKit with a Vite React app?▼

Yes, but the runtime must run as a separate Express or Hono server since Vite only serves the frontend. Point CopilotKitProvider's runtimeUrl at the backend server URL and import @copilotkit/react/styles.css in main.tsx or App.tsx.

Which AI models does CopilotKit BuiltInAgent support?▼

BuiltInAgent accepts provider-prefixed model strings for OpenAI (openai/gpt-4o, gpt-4.1), Anthropic (anthropic/claude-sonnet-4.5), and Google (google/gemini-2.5-flash), or any Vercel AI SDK LanguageModel instance. API keys resolve automatically from OPENAI_API_KEY, ANTHROPIC_API_KEY, or GOOGLE_API_KEY environment variables.

Why is my CopilotKit chat not connecting to the runtime?▼

Common causes include a runtimeUrl that does not match the endpoint basePath, missing useSingleEndpoint when using single-route factories, or a forgotten styles.css import. Verify the runtime's GET /info endpoint responds and reports available agents.