Quick Start
This guide will have you searching code in just 5 minutes. We’ll set up Code Search, connect to GitHub, and run your first search.
Prerequisites
Section titled “Prerequisites”- Docker and Docker Compose installed
- A GitHub account with at least one repository
- A GitHub Personal Access Token (we’ll create one)
-
Start Code Search
Download and start all services:
Terminal window # Download docker-compose.ymlcurl -O https://raw.githubusercontent.com/techquestsdev/code-search/main/docker-compose.yml# Start servicesdocker compose up -dWait about 30 seconds for all services to start.
-
Create a GitHub Token
Go to GitHub Settings → Developer Settings → Personal Access Tokens → Tokens (classic)
Create a new token with these scopes:
repo(Full control of private repositories)read:org(Read organization membership - optional, for org repos)
Copy the generated token.
-
Open the Web UI
Open http://localhost:3000 in your browser.
You’ll see the Code Search dashboard, ready to configure.
-
Add a GitHub Connection
Click Connections in the sidebar, then Add Connection.
Fill in:
- Name:
GitHub(or any name you prefer) - Type:
GitHub - URL:
https://api.github.com - Token: Paste your GitHub token
Click Test Connection to verify, then Create.
- Name:
-
Sync Repositories
Click Sync on your new connection to discover repositories.
The system will fetch your repositories and queue them for indexing.
-
Wait for Indexing
Click Repositories to see the indexing progress.
Initial indexing takes a few minutes depending on repository size. You’ll see status change from “pending” → “indexing” → “indexed”.
-
Search!
Click Search in the sidebar or use the search bar.
Try searching for:
fooOr with filters:
func main lang:go
Your First CLI Search
Section titled “Your First CLI Search”Now let’s try the CLI:
# Configure the CLIcode-search config set server.url http://localhost:8080
# Search for codecode-search search "foo"
# Search with filterscode-search search "func" --lang go --file "*.go"
# List repositoriescode-search repo listQuick Reference
Section titled “Quick Reference”Search Syntax
Section titled “Search Syntax”| Query | Description |
|---|---|
foo | Simple text search |
func main | Search for phrase |
"exact phrase" | Exact match with quotes |
repo:myorg/repo | Filter by repository |
lang:go | Filter by language |
file:*.ts | Filter by file pattern |
case:yes | Case-sensitive search |
Common CLI Commands
Section titled “Common CLI Commands”# Searchcode-search search "pattern" --repo "org/*"
# Find filescode-search find files "*.proto"
# Find symbol definitionscode-search find symbols "UserService"
# Preview replace (dry run)code-search replace "oldFunc" "newFunc" --dry-run
# Execute replace with MR creationcode-search replace "v1.0" "v2.0" --execute --create-mrWhat’s Next?
Section titled “What’s Next?”You’re now up and running! Here’s what to explore next:
Add More Code Hosts
Section titled “Add More Code Hosts”Connect additional platforms:
Configure for Production
Section titled “Configure for Production”Customize your deployment:
Master the CLI
Section titled “Master the CLI”Learn advanced CLI features:
Use the API
Section titled “Use the API”Build integrations:
Troubleshooting
Section titled “Troubleshooting”Services not starting?
Section titled “Services not starting?”Check the logs:
docker compose logs -fCan’t connect to GitHub?
Section titled “Can’t connect to GitHub?”- Verify your token has the correct scopes
- Check the token hasn’t expired
- Test connection in the UI to see the error message
Search not finding results?
Section titled “Search not finding results?”- Ensure repositories are indexed (status: “indexed”)
- Check the Zoekt service is running:
curl http://localhost:6070/health - Wait for indexing to complete for new repos
Need more help?
Section titled “Need more help?”- Check GitHub Issues
- Read the Architecture docs for deeper understanding