Skip to main content
Ask questions about your codebase in natural language or search for specific patterns. Semantic search uses AI embeddings to understand the meaning of your queries.

Overview

The wit search command provides both AI-powered semantic search and traditional text search.

Quick Start

Commands

Search Query

Search your codebase with a natural language query.

Examples


index

Index the repository for semantic search.

Options

Indexing analyzes your code files and creates embeddings for semantic search.

Example Output


status

Check the health of the search index.

Example Output


files

Search for files by glob pattern.

Search Options

Force text search instead of semantic search.

Files Only

Search only file names (not contents).

Content Only

Search only file contents (not names).

Filter by File Type

Search within specific file types.

Interactive Mode

Launch an interactive search session.

Search Results

Semantic Search Results

Text Search Results


Configuration

API Key

Semantic search requires an OpenAI API key for generating embeddings.
Without an API key, wit falls back to text search.

Index Location

The search index is stored in .wit/search/ and includes:
  • Vector embeddings
  • File metadata
  • Index statistics

Best Practices

  • Understanding how something works
  • Finding related code across the codebase
  • Exploring unfamiliar code
  • Finding implementations of concepts
  • Finding exact strings or patterns
  • Looking for specific identifiers
  • Finding TODO comments
  • Searching for error messages

Index Maintenance


Workflow Example