Sourcebot is a self-hosted tool that helps you understand your codebase.
Find a file
2024-09-10 22:23:40 -07:00
.github Remove qemu step 2024-09-07 19:52:27 -07:00
public Add page to list indexed repositories 2024-09-10 21:55:00 -07:00
schemas Add gitlab support 2024-09-04 13:55:47 -07:00
src nits 2024-09-10 22:23:40 -07:00
vendor Add gitlab support 2024-09-04 13:55:47 -07:00
.dockerignore For simplicity, move to a single docker container and use supervisord to handle running the processes. 2024-09-05 13:00:27 -07:00
.eslintignore Add eslint 2024-08-29 21:38:48 -07:00
.eslintrc.json Add eslint 2024-08-29 21:38:48 -07:00
.gitignore For simplicity, move to a single docker container and use supervisord to handle running the processes. 2024-09-05 13:00:27 -07:00
.gitmodules Add zoekt as a submodule 2024-08-30 18:35:55 -07:00
components.json wip - add shadcn, api router, and some other stuff 2024-08-24 17:45:44 -07:00
Dockerfile Add fly.io config & workflow 2024-09-06 11:27:20 -07:00
entrypoint.sh Relax CONFIG_PATH check to warning 2024-09-06 12:19:55 -07:00
fly.toml Decrease ram usage 2024-09-06 13:41:28 -07:00
LICENSE Add license 2024-09-07 17:27:31 -07:00
next.config.mjs Add sourcebot Dockerfile 2024-08-30 20:00:58 -07:00
package.json Add page to list indexed repositories 2024-09-10 21:55:00 -07:00
postcss.config.mjs init nextjs project 2024-08-23 13:54:13 -07:00
README.md fix badge 2024-09-07 17:20:17 -07:00
sample-config.json delete default config and modify sample config to index Linus 2024-09-06 12:54:53 -07:00
supervisord.conf Add expanded context results + switch over to using zoekt's json apis 2024-09-09 23:16:41 -07:00
tailwind.config.ts wip - add shadcn, api router, and some other stuff 2024-08-24 17:45:44 -07:00
tsconfig.json init nextjs project 2024-08-23 13:54:13 -07:00
yarn.lock Add page to list indexed repositories 2024-09-10 21:55:00 -07:00

Try the demo!

About

build

Sourcebot is a fast code indexing and search tool for your codebases. It is built ontop of the zoekt indexer, originally authored by Han-Wen Nienhuys and now maintained by Sourcegraph.



Getting Started

Using Docker

  1. Install docker

  2. Create a config.json file and list the repositories you want to index. For example, if we want to index all repositories in vercel, we could use the following config:

{
    "$schema": "https://raw.githubusercontent.com/TaqlaAI/sourcebot/main/schemas/zoekt-mirror.json",
    "Config": [
        {
            "Type": "github",
            "GitHubOrg": "vercel"
        }
    ]
}

Sourcebot also supports indexing GitLab & BitBucket. Checkout the config schema for a full list of available options.

  1. Generate a GitHub Personal Access Token (PAT) here. If you are indexing public repositories only, you can select the public_repo scope, otherwise you will need the repo scope. (GitLab and BitBucket instructions are below)

  2. Launch the latest image from the GitHub registry:

docker run -p 3000:3000 --rm --name sourcebot -v $(pwd):/data -e GITHUB_TOKEN=<token> ghcr.io/taqlaai/sourcebot:main

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:

INFO spawned: 'node-server' with pid 10
INFO spawned: 'zoekt-indexserver' with pid 11
INFO spawned: 'zoekt-webserver' with pid 12
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.

  1. Go to http://localhost:3000 - once a index has been created, you should get results.

Building Sourcebot

TODO

GitLab

TODO

BitBucket

TODO

Todos

  • Add instructions on using GitLab and BitBucket
  • Add instructions on building Sourcebot locally