code-search

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2026 License: Apache-2.0

README

License

Preview

Search, find, and replace code across all your repositories in milliseconds.

A self-hosted code search and bulk operations platform. Powered by Zoekt (the same search engine Google uses internally), designed for teams that need speed, privacy, and control.

Features

  • Lightning Fast Search — Sub-second search across millions of lines of code
  • Bulk Replace — Find and replace across hundreds of repos with automated MR/PR creation
  • Privacy First — Self-hosted on your infrastructure; your code never leaves your servers
  • Multi-Platform — GitHub, GitLab, Gitea, and Bitbucket support
  • Developer Experience — Modern Web UI and powerful CLI for automation

Enterprise Features (Open Alpha)

The Enterprise Edition is currently in open alpha — free to use while in early access, no pricing, no commitment. Request a license via the contact page to get started.

  • OIDC Single Sign-On — Integrate with Okta, Azure AD, Google Workspace, and more.
  • Role-Based Access Control — Fine-grained repository permissions with glob patterns.
  • Audit Logging — Full compliance trail of searches, file access, and administrative actions.
  • Horizontal Scaling — Scale to thousands of repositories with sharded indexing and API servers.
  • License Management — Centrally manage seats and feature access.

Learn more about Enterprise →

Quick Start

Get searching in 2 minutes with Docker:

# Download and start all services
curl -O https://raw.githubusercontent.com/techquestsdev/code-search/main/docker-compose.yml
docker compose up -d

# Open the web UI
open http://localhost:3000

Then:

  1. Go to ConnectionsAdd Connection
  2. Add your GitHub/GitLab token
  3. Click Sync to discover repositories
  4. Start searching!

Full Quick Start Guide →

CLI Usage

The CLI is designed for power users and CI/CD automation:

# Search across all repositories
code-search search "deprecated_function" --repos "myorg/*"

# Find and replace with automatic MR creation
code-search replace "v1.0.0" "v2.0.0" \
  --repos "myorg/*" \
  --execute \
  --mr-title "Upgrade to v2.0.0"

# Repository management
code-search repo list
code-search repo sync --all

CLI Documentation →

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                         Web UI / CLI                            │
└─────────────────────────────────────────────────────────────────┘
                                │
                                ▼
┌─────────────────────────────────────────────────────────────────┐
│                          API Server                             │
└─────────────────────────────────────────────────────────────────┘
               │                │               │
               ▼                ▼               ▼
       ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
       │    Zoekt     │ │  PostgreSQL  │ │    Redis     │
       │(Search Index)│ │   (Data)     │ │   (Queue)    │
       └──────────────┘ └──────────────┘ └──────────────┘
               ▲
               │
┌─────────────────────────────────────────────────────────────────┐
│                      Indexer Service                            │
│        (Clones repos from GitHub/GitLab/Gitea/Bitbucket)        │
└─────────────────────────────────────────────────────────────────┘

Development

Prerequisites: Go 1.21+, Node.js 20+, PostgreSQL 16+, Redis 7+

# Clone the repository
git clone https://github.com/techquestsdev/code-search.git
cd code-search

# Start infrastructure (PostgreSQL, Redis, Zoekt)
make dev-infra

# Build all binaries
make build

# Run services (in separate terminals)
make dev-api      # API Server → http://localhost:8080
make dev-indexer  # Indexer Service
make dev-web      # Web UI → http://localhost:3000

Tech Stack

Component Technology Purpose
Backend Go High-performance API server
Frontend Next.js Modern, responsive web interface
CLI Go + Cobra Fast, scriptable command line
Search Engine Zoekt Trigram-based code search
Database PostgreSQL / MySQL Reliable data persistence
Queue Redis Job queue and caching

Documentation

Resource Description
Getting Started Introduction and quick start
Installation Docker, Kubernetes, Helm guides
Configuration All configuration options
CLI Reference Command line documentation
API Reference REST API documentation
Architecture System design and data flow

Contributing

We welcome contributions! Please see our CONTRIBUTING.md for details on the process and our Individual Contributor License Agreement (ICLA).

License

This project is licensed under the Apache License 2.0 — see the LICENSE file for details.

Acknowledgments

Built with inspiration from Sourcegraph and powered by Zoekt.


Made with ❤️

Directories

Path Synopsis
cmd
api command
cli command
indexer command
mcp command
migrate command
zoekt-refresh command
zoekt-refresh is a lightweight sidecar that triggers zoekt index reloads for network filesystems (CephFS, NFS, EFS) that don't propagate inotify events.
zoekt-refresh is a lightweight sidecar that triggers zoekt index reloads for network filesystems (CephFS, NFS, EFS) that don't propagate inotify events.
internal
cache
Package cache provides cross-instance cache invalidation via Redis pub/sub.
Package cache provides cross-instance cache invalidation via Redis pub/sub.
crypto
Package crypto provides encryption utilities for sensitive data.
Package crypto provides encryption utilities for sensitive data.
db
Package db provides database abstractions and utilities.
Package db provides database abstractions and utilities.
files
Package files provides file browsing and content retrieval for Git repositories.
Package files provides file browsing and content retrieval for Git repositories.
gitutil
Package gitutil provides shared git-related utility functions.
Package gitutil provides shared git-related utility functions.
indexer
Package indexer provides the indexer HTTP server for federated file access.
Package indexer provides the indexer HTTP server for federated file access.
languages
Package languages provides shared language detection markers used by both the indexer (bare-repo language detection) and the SCIP service (project directory discovery).
Package languages provides shared language detection markers used by both the indexer (bare-repo language detection) and the SCIP service (project directory discovery).
log
Package log provides a shared zap logger for all components.
Package log provides a shared zap logger for all components.
regexutil
Package regexutil provides utilities for safe regex handling.
Package regexutil provides utilities for safe regex handling.
scip
Package scip provides the main service for SCIP code intelligence.
Package scip provides the main service for SCIP code intelligence.
sharding
Package sharding provides consistent hashing for distributing repositories across shards.
Package sharding provides consistent hashing for distributing repositories across shards.
symbols
Package symbols provides symbol extraction and caching.
Package symbols provides symbol extraction and caching.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL