Skip to content

Installation

This guide will walk you through installing @dao/vibe-check and configuring it for your first project.

Before you begin, ensure you have:

  • Node.js 18 or later - Check with node --version
  • A package manager - We recommend Bun, but npm, pnpm, and yarn work too
  • TypeScript project - Vibe-check is TypeScript-first
  • Claude Code access - You’ll need the @anthropic-ai/claude-code SDK

Install vibe-check and its peer dependencies:

Terminal window
bun add -D @dao/vibe-check vitest vite

Create a vitest.config.ts file in your project root:

vitest.config.ts
import { defineVibeConfig } from '@dao/vibe-check/config';
export default defineVibeConfig({
// Your custom Vitest configuration here (optional)
});

You can customize the configuration by passing Vitest options:

vitest.config.ts
import { defineVibeConfig } from '@dao/vibe-check/config';
export default defineVibeConfig({
test: {
// Increase timeout for complex workflows
timeout: 600000, // 10 minutes
// Limit concurrent tests to reduce API rate limits
maxConcurrency: 2,
// Run tests sequentially (not recommended for CI)
poolOptions: {
threads: {
singleThread: true
}
},
// Custom test file patterns
include: ['**/*.vibe.test.{ts,js}'],
},
// Bundle cleanup configuration
cleanup: {
maxAgeDays: 30, // Delete bundles older than 30 days
minFreeDiskMb: 1000, // Clean up when <1GB free space
disabled: false, // Enable automatic cleanup
},
});

Ensure your tsconfig.json includes:

{
"compilerOptions": {
"types": ["vitest/globals", "@dao/vibe-check"]
}
}

This enables:

  • Vitest global types (describe, it, expect)
  • Vibe-check custom matchers (TypeScript autocomplete)
  • Extended TestContext interface

Let’s verify the installation with a simple test.

Create tests/hello.vibe.test.ts:

import { vibeTest } from '@dao/vibe-check';
vibeTest('installation works', async ({ runAgent, expect }) => {
const result = await runAgent({
prompt: 'Say "Hello from vibe-check!"'
});
// Verify we got a result
expect(result).toBeDefined();
expect(result.bundleDir).toBeTruthy();
// Check metrics were captured
expect(result.metrics.totalTokens).toBeGreaterThan(0);
expect(result.metrics.totalCostUsd).toBeGreaterThan(0);
});
Terminal window
bun run vitest

You should see:

✓ tests/hello.vibe.test.ts (1)
✓ installation works
Test Files 1 passed (1)
Tests 1 passed (1)
Vibe Check Cost Summary
─────────────────────────────
Total Cost: $0.0043
Total Tokens: 1,247
HTML Report: .vibe-artifacts/reports/index.html

After installation, your project should look like:

your-project/
├── tests/ # Your test files
│ └── hello.vibe.test.ts
├── .vibe-artifacts/ # Auto-generated (gitignored)
│ ├── bundles/ # Run artifacts
│ │ └── {test-id}/
│ │ ├── summary.json
│ │ ├── events.ndjson
│ │ ├── hooks.ndjson
│ │ └── files/
│ └── reports/
│ └── index.html # HTML report
├── vitest.config.ts # Vitest configuration
├── tsconfig.json # TypeScript configuration
└── package.json

The .vibe-artifacts/ directory can grow large. Add it to your .gitignore:

# Vibe Check artifacts
.vibe-artifacts/

Solution: Ensure the package is installed in your project (not globally):

Terminal window
bun install # or npm install

Custom matchers not recognized in TypeScript

Section titled “Custom matchers not recognized in TypeScript”

Solution: Add @dao/vibe-check to your tsconfig.json types:

{
"compilerOptions": {
"types": ["@dao/vibe-check"]
}
}

Solution: Increase the test timeout in your config:

export default defineVibeConfig({
test: {
timeout: 600000 // 10 minutes
}
});

Solution: Ensure you have the SDK installed:

Terminal window
bun add @anthropic-ai/claude-code

And set your API key:

Terminal window
export ANTHROPIC_API_KEY="your-api-key"

Solution: The directory is created automatically. If you see permission errors:

Terminal window
mkdir -p .vibe-artifacts
chmod 755 .vibe-artifacts

Now that vibe-check is installed and configured:


For reference, here are vibe-check’s dependencies:

Peer Dependencies (you must install):

  • vitest ^3.2.0
  • vite ^5.0.0

Dependencies (installed automatically):

  • @anthropic-ai/claude-code - Claude Code SDK
  • zod - Runtime validation
  • zod-to-json-schema - Schema conversion for structured outputs
  • p-limit - Concurrency control
  • pathe - Cross-platform path handling
  • fs-extra - File system utilities
  • minimatch - Glob pattern matching

Dev Dependencies (for development):

  • typescript ^5.5.0
  • @types/node ^20.11.0
  • tsup - Build tool