Sourcebot is a fast code indexing and search tool for your codebases. It is built ontop of the [zoekt](https://github.com/sourcegraph/zoekt) indexer, originally authored by Han-Wen Nienhuys and now [maintained by Sourcegraph](https://sourcegraph.com/blog/sourcegraph-accepting-zoekt-maintainership).
1. Create a `config.json` file and list the repositories you want to index. For example, if we want to index all repositories in [vercel](https://github.com/vercel), we could use the following config:
Sourcebot also supports indexing [GitLab](#gitlab) & [BitBucket](#bitbucket). Checkout the [config schema](./schemas/zoekt-mirror.json) for a full list of available options.
2. Generate a GitHub Personal Access Token (PAT) [here](https://github.com/settings/tokens/new). If you are indexing public repositories only, you can select the `public_repo` scope, otherwise you will need the `repo` scope. ([GitLab](#gitlab) and [BitBucket](#bitbucket) instructions are below)
3. Launch the latest image from the [GitHub registry](https://github.com/TaqlaAI/sourcebot/pkgs/container/sourcebot):
Two things should happen: (1) a `.sourcebot` directory will be created containing the mirror repositories and indexes, and (2) you will see output similar to:
run [zoekt-mirror-github -dest /data/.sourcebot/repos -delete -org <org>]
...
INFO success: node-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
INFO success: zoekt-indexserver entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
INFO success: zoekt-webserver entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
```
zoekt will now index your repositories (at `HEAD`). By default, it will re-index existing repositories every hour, and discover new repositories every 24 hours.
4. Go to `http://localhost:3000` - once a index has been created, you should get results.