Next.js
Add conciv to a Next.js app with withConciv and two instrumentation files.
conciv runs in next dev through withConciv around your config and two instrumentation files.
Prefer to let your agent do it?
Copy this prompt into your coding agent. It runs conciv's init command, which makes the same changes as below.
Set up conciv in this project. conciv is a dev-only AI agent widget for my running app. 1. In my app folder, the one with package.json, run `npx @conciv/cli@latest init --yes`, with pnpm dlx, yarn dlx or bunx instead of npx if the project uses that package manager. Do any step it prints as a snippet yourself. If it stops on uncommitted changes or the install fails, stop and ask me; do not pass --force or change a release age policy yourself. 2. Check that init added conciv() to the plugins of my Vite config. 3. Check that the claude CLI is installed, logged in and on the PATH of the shell that starts the dev server. conciv does not install it or log in; if it is missing, tell me. 4. Start the dev server with my dev script and open the app. A conciv button shows in the corner. Log me in: run `npx @conciv/cli@latest auth link <the app URL>` in the app folder and give me the link it prints, or tell me to click the conciv button and type the 6-digit code the dev server prints.
Add conciv to Next.js
Install @conciv/it as a dev dependency:
npm install -D @conciv/itpnpm add -D @conciv/ityarn add --dev @conciv/itbun add --dev @conciv/itWrap the default export of your config with withConciv:
import type {NextConfig} from 'next'
import {} from '@conciv/it/plugin/nextjs'
const : NextConfig = {
: true,
}
export default () Options go in its second argument, as in withConciv(nextConfig, {harness: 'codex'}). Learn more in
Configuration.
Then create both instrumentation files next to your app or pages folder:
export {} from '@conciv/it/plugin/nextjs' // <- starts the engine with the dev serverimport '@conciv/it/plugin/nextjs/widget' // <- adds the conciv button to your pagesRoutes in src/app or src/pages? Move both files into src/
Next.js reads the instrumentation files from the folder that holds app or pages. init writes them to the project
root. With routes in src/app or src/pages, move both files into src/, or conciv never starts.
Start your dev server with npm run dev, open your app, and click the conciv button. Type the 6-digit code your dev
server prints. Learn more in Logging in.
What works
- The chat, the page tools and the plugins work as on Vite.
- The dev server tools do not. They answer that no dev server is attached. So do plugin tools that read the dev server, such as the TanStack build errors.
next buildandnext startleave conciv out.
Next steps
- Use conciv: what the agent can do in your app.
- Configuration: the options
withConcivtakes.