vibe-tools
repository·main·Indexed 26 days ago
https://github.com/eastlondoner/vibe-toolsA CLI toolkit for AI coding agents (such as Cursor, Claude Code, and Windsurf) that provides advanced capabilities including web research via Perplexity, deep repository context and reasoning via Gemini 2.0, and browser automation via Stagehand. It includes specialized commands for codebase analysis (repo), task planning (plan), browser interaction (browser), and integrations with GitHub, Linear, and YouTube.
What's inside vibe-tools
- vibe-tools is a CLI designed to expand the capabilities of AI agents (like Cursor Composer, Claude Code, Windsurf, etc.) by providing them with a suite of advanced tools and an 'AI team'. It allows agents to perform tasks such as web research via Perplexity, deep codebase reasoning via Gemini 2.0, browser automation via Stagehand, and integration with GitHub, Linear, and YouTube.
Overview of vibe-tools feature behavior testing
mainvibe-tools uses an AI-driven regression testing approach. Developers create feature behavior files (Markdown) that describe desired behaviors. AI agents then interpret these descriptions to:
- Determine how to test the behaviors using
vibe-toolscommands. - Generate detailed reports.
- Produce simple
PASS/FAILresults for CI/CD automation.
- Determine how to test the behaviors using
Infrastructure components for telemetry
mainThe telemetry pipeline consists of the following Cloudflare-based components:
- Cloudflare Worker (
vibe-tools-infra): Acts as the ingestion endpoint. It handles requests at/api/pipelineusing a Nuxt server route (infra/server/api/pipeline.post.ts). - Cloudflare Pipeline (
vibe-tools-telemetry): Receives data from the Worker and batches it based on size (max 10MB), time (max 5s), or row count (max 100 rows). - Cloudflare R2 Bucket (
vibe-tools-telemetry): The final destination where batched JSON data is stored. - API Token (
telemetry-pipeline-r2-access-token): An account-level token withWorkers R2 Storage Bucket Item Writepermissions used by the Pipeline to write to R2.
- Cloudflare Worker (
Understand collected telemetry data
mainVibe Tools collects anonymous usage data to improve the tool.
Collected data includes:
command: The executed command (e.g.,repo,web,plan).startTime: Command start timestamp.- Token counts:
tokenCount,promptTokens, andcompletionTokens. - AI Model details:
provider(e.g.,gemini,openai) andmodelname. - Plan command specifics:
fileProvider,fileModel,thinkingProvider, andthinkingModel. options: Sanitized command-line options (e.g.,--debug).error: Errortypeandmessageif a command fails.
Data NOT collected:
- User queries or prompts
- File contents or code
- Personal data
- API keys
The vibe-tools AI Team components
mainvibe-tools provides access to several specialized 'team members' for your agent:
- Perplexity: Used for web search and performing deep research.
- Gemini 2.0: Used for large whole-codebase context windows, search grounding, and reasoning.
- Stagehand: Used for browser operations to test and debug web applications (supports Anthropic, OpenAI, Gemini, or OpenRouter models).
- OpenRouter: Provides access to a variety of models through a unified API, primarily used for MCP commands.
Install vibe-tools globally
mainvibe-tools is a Node package that should be installed globally. Running the installation command configures instruction files tailored to your specific development environment (e.g., Cursor, Claude Code, Windsurf, etc.).
vibe-tools installConfigure Authentication and API Keys for vibe-tools
mainvibe-tools requires API keys for Perplexity AI and Google Gemini. It also supports optional keys for OpenAI, Anthropic, OpenRouter, xAI, Groq, GitHub, and Linear.
There are two primary ways to configure these keys:
- Interactive Setup: Run
vibe-tools installand follow the command-line prompts. - Manual Setup: Create a
.envfile in one of the following locations:~/.vibe-tools/.env(Home directory).vibe-tools.env(Project root)
Note for MCP users: To use
mcpcommands, you must provide at least one ofANTHROPIC_API_KEYorOPENROUTER_API_KEY.CI/CD Environments: In non-interactive mode (automatically detected in CI), vibe-tools uses environment variables exclusively and will not write to the filesystem.
PERPLEXITY_API_KEY="your-perplexity-api-key" GEMINI_API_KEY="your-gemini-api-key" OPENAI_API_KEY="your-openai-api-key" # Optional, for Stagehand ANTHROPIC_API_KEY="your-anthropic-api-key" # Optional, for Stagehand and MCP OPENROUTER_API_KEY="your-openrouter-api-key" # Optional, for MCP XAI_API_KEY="your-xai-api-key" # Optional, for xAI Grok models GROQ_API_KEY="your-groq-api-key" # Optional, for Groq models GITHUB_TOKEN="your-github-token" # Optional, for enhanced GitHub access LINEAR_API_KEY="your-linear-api-key" # Optional, for Linear integration- Interactive Setup: Run
Use Linear Integration to manage issues
mainAccess Linear issues with full context including priority, status, assignees, comments, and attachments. Supports both Linear identifiers (e.g.,
ITE-123) and UUIDs.Authentication Setup:
- Interactive Setup (Recommended): Run
vibe-tools linear connectto choose between Personal API Key or OAuth2 with PKCE. - Environment Variable: Set
LINEAR_API_KEY="your-linear-api-key"in your.vibe-tools.envfile. Do not include a "Bearer" prefix.
Authentication Modes:
- Personal API Key: Best for individual use; supports local or global storage.
- OAuth2 with PKCE: Best for organizational use; provides secure browser-based authentication and automatic token management.
# Set up authentication (interactive prompts) vibe-tools linear connect # View specific issue with full details vibe-tools linear get-issue ITE-123 vibe-tools linear issue ABC-456- Interactive Setup (Recommended): Run
Generate documentation using Gemini 2.0
mainGenerate comprehensive documentation for local or remote GitHub repositories. You can include external web documentation as additional context to improve accuracy.
Key Flags:
--save-to=<file>: Save the generated documentation to a specific file.--from-github=<user/repo>[@branch]: Specify the target GitHub repository and optional branch.--with-doc=<url>: Add a web URL as additional context for the documentation generation.--hint="<text>": Provide a hint to guide the documentation generation.--quiet: Run without verbose output.
# Document local repository and save to file vibe-tools doc --save-to=docs.md # Document remote GitHub repository vibe-tools doc --from-github=username/repo-name@branch # Document with additional web documentation as context vibe-tools doc --from-github=reactjs/react-redux --with-doc=https://redux.js.org/tutorials/fundamentals/part-5-ui-and-react --save-to=docs/REACT_REDUX.mdRun vibe-tools tests using the test command
mainUse the
pnpm dev testcommand to execute test scenarios defined in Markdown feature behavior files. You can run a single file, multiple files using glob patterns, or run tests in parallel.Common usage patterns:
- Single file:
pnpm dev test <path-to-file> - Glob pattern:
pnpm dev test "<glob-pattern>"(ensure you use quotes to prevent shell expansion) - Parallel execution: Use the
--parallelflag to specify the number of concurrent scenarios.
# Run a specific test file pnpm dev test tests/feature-behaviors/web/web-command.md # Run multiple test files using a glob pattern pnpm dev test "tests/feature-behaviors/web/*.md" # Run tests in parallel pnpm dev test tests/feature-behaviors/test/test-command-parallel-example.md --parallel 4- Single file:
Write feature behavior files for testing
mainFeature behavior files are written in Markdown and define the test scenarios for
vibe-toolscommands. They must follow this structure:- Feature Behavior: The name of the feature.
- Description: A summary of what the test verifies.
- Test Scenarios: A list of specific test cases, each containing:
- Scenario: The name of the test case.
- Task Description: Instructions for what the AI agent should do.
- Expected Behavior: A description of the expected outcome.
- Success Criteria: Specific, measurable criteria for a successful test.
# Feature Behavior: Web Command ## Description This test verifies that the web command can query online information correctly. ## Test Scenarios ### Scenario 1: Basic Web Query **Task Description:** Use vibe-tools to search for information about climate change. **Expected Behavior:** - The AI agent should use the web command - Response should include information about climate change - The command should complete successfully **Success Criteria:** - AI agent correctly uses the vibe-tools web command - Response contains relevant information about climate change - Command completes without errorsImplement Scenario-Level Isolation in executeScenario
mainTo implement scenario-level isolation, wrap the
executeScenariologic withTestEnvironmentManager. This ensures each scenario runs in its own temporary directory with its required assets copied in, preventing cross-test contamination.Workflow:
- Call
TestEnvironmentManager.createTempDirectory(scenarioId). - Call
TestEnvironmentManager.copyAssets(scenario, tempDir)to get amodifiedTaskDescription. - Initialize tools (like
createCommandExecutionTool) using thetempDiras thecwd. - Execute the scenario using the
modifiedScenario. - Use a
finallyblock to callTestEnvironmentManager.cleanup(tempDir).
// Inside executeScenario implementation const tempDir = await TestEnvironmentManager.createTempDirectory(scenarioId); const modifiedTaskDescription = await TestEnvironmentManager.copyAssets(scenario, tempDir); const modifiedScenario = { ...scenario, taskDescription: modifiedTaskDescription }; try { const tools = [ createCommandExecutionTool({ debug, cwd: tempDir, scenarioId, appendToBuffer }) ]; // ... execution logic } finally { await TestEnvironmentManager.cleanup(tempDir); }- Call