indent README

This commit is contained in:
bkellam 2024-09-17 23:08:16 -07:00
parent b9694c9c76
commit 4355567351

132
README.md
View file

@ -27,18 +27,18 @@ Sourcebot is a fast code indexing and search tool for your codebases. It is buil
1. Create a `config.json` file and list the repositories you want to index. The JSON schema [index.json](./schemas/index.json) defines the structure of the config file and the available options. For example, if we want to index Sourcebot on its own code, we could use the following config found in `sample-config.json`: 1. Create a `config.json` file and list the repositories you want to index. The JSON schema [index.json](./schemas/index.json) defines the structure of the config file and the available options. For example, if we want to index Sourcebot on its own code, we could use the following config found in `sample-config.json`:
```json ```json
{ {
"$schema": "https://raw.githubusercontent.com/TaqlaAI/sourcebot/main/schemas/index.json", "$schema": "https://raw.githubusercontent.com/TaqlaAI/sourcebot/main/schemas/index.json",
"Configs": [ "Configs": [
{ {
"Type": "github", "Type": "github",
"GitHubOrg": "TaqlaAI", "GitHubOrg": "TaqlaAI",
"Name": "^sourcebot$" "Name": "^sourcebot$"
} }
] ]
} }
``` ```
Sourcebot also supports indexing GitLab & BitBucket. Checkout the [index.json](./schemas/index.json) for a full list of available options. Sourcebot also supports indexing GitLab & BitBucket. Checkout the [index.json](./schemas/index.json) for a full list of available options.
@ -69,47 +69,47 @@ Sourcebot also supports indexing GitLab & BitBucket. Checkout the [index.json](.
3. Launch the latest image from the [ghcr registry](https://github.com/TaqlaAI/sourcebot/pkgs/container/sourcebot): 3. Launch the latest image from the [ghcr registry](https://github.com/TaqlaAI/sourcebot/pkgs/container/sourcebot):
<div> <div>
<details open> <details open>
<summary><img src="https://github.com/favicon.ico" width="16" height="16" /> GitHub</summary> <summary><img src="https://github.com/favicon.ico" width="16" height="16" /> GitHub</summary>
```sh ```sh
docker run -p 3000:3000 --rm --name sourcebot -v $(pwd):/data -e GITHUB_TOKEN=<token> ghcr.io/taqlaai/sourcebot:main docker run -p 3000:3000 --rm --name sourcebot -v $(pwd):/data -e GITHUB_TOKEN=<token> ghcr.io/taqlaai/sourcebot:main
``` ```
</details> </details>
<details> <details>
<summary><img src="https://gitlab.com/favicon.ico" width="16" height="16" /> GitLab</summary> <summary><img src="https://gitlab.com/favicon.ico" width="16" height="16" /> GitLab</summary>
```sh ```sh
docker run -p 3000:3000 --rm --name sourcebot -v $(pwd):/data -e GITLAB_TOKEN=<token> ghcr.io/taqlaai/sourcebot:main docker run -p 3000:3000 --rm --name sourcebot -v $(pwd):/data -e GITLAB_TOKEN=<token> ghcr.io/taqlaai/sourcebot:main
``` ```
</details> </details>
<details> <details>
<summary><img src="https://bitbucket.org/favicon.ico" width="16" height="16" /> BitBucket</summary> <summary><img src="https://bitbucket.org/favicon.ico" width="16" height="16" /> BitBucket</summary>
TODO TODO
</details> </details>
<br/> <br/>
</div> </div>
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: 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:
```sh ```sh
INFO spawned: 'node-server' with pid 10 INFO spawned: 'node-server' with pid 10
INFO spawned: 'zoekt-indexserver' with pid 11 INFO spawned: 'zoekt-indexserver' with pid 11
INFO spawned: 'zoekt-webserver' with pid 12 INFO spawned: 'zoekt-webserver' with pid 12
run [zoekt-mirror-github -dest /data/.sourcebot/repos -delete -org <org>] 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: 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-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) 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. 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 can start searching. 4. Go to `http://localhost:3000` - once a index has been created, you can start searching.
@ -118,32 +118,32 @@ zoekt will now index your repositories (at `HEAD`). By default, it will re-index
0. Install <a href="https://go.dev/"><img src="https://go.dev/favicon.ico" width="16" height="16"> go</a> and <a href="https://nodejs.org/"><img src="https://nodejs.org/favicon.ico" width="16" height="16"> NodeJS</a> 0. Install <a href="https://go.dev/"><img src="https://go.dev/favicon.ico" width="16" height="16"> go</a> and <a href="https://nodejs.org/"><img src="https://nodejs.org/favicon.ico" width="16" height="16"> NodeJS</a>
1. Clone the repository with submodules: 1. Clone the repository with submodules:
```sh ```sh
git clone --recurse-submodules https://github.com/TaqlaAI/sourcebot.git git clone --recurse-submodules https://github.com/TaqlaAI/sourcebot.git
``` ```
2. Run make to build zoekt and install dependencies: 2. Run make to build zoekt and install dependencies:
```sh ```sh
cd sourcebot cd sourcebot
make make
``` ```
The zoekt binaries and web dependencies are placed into `bin` and `node_modules` respectively. The zoekt binaries and web dependencies are placed into `bin` and `node_modules` respectively.
3. Create a `config.json` file and list the repositories you want to index. The JSON schema defined in [index.json](./schemas/index.json) defines the structure of the config file and the available options. For example, if we want to index Sourcebot on its own code, we could use the following config found in `sample-config.json`: 3. Create a `config.json` file and list the repositories you want to index. The JSON schema defined in [index.json](./schemas/index.json) defines the structure of the config file and the available options. For example, if we want to index Sourcebot on its own code, we could use the following config found in `sample-config.json`:
```json ```json
{ {
"$schema": "https://raw.githubusercontent.com/TaqlaAI/sourcebot/main/schemas/index.json", "$schema": "https://raw.githubusercontent.com/TaqlaAI/sourcebot/main/schemas/index.json",
"Configs": [ "Configs": [
{ {
"Type": "github", "Type": "github",
"GitHubOrg": "TaqlaAI", "GitHubOrg": "TaqlaAI",
"Name": "^sourcebot$" "Name": "^sourcebot$"
} }
] ]
} }
``` ```
4. Create a Personal Access Token (PAT) to authenticate with a code host: 4. Create a Personal Access Token (PAT) to authenticate with a code host:
@ -173,11 +173,11 @@ The zoekt binaries and web dependencies are placed into `bin` and `node_modules`
</div> </div>
5. Start Sourcebot with the command: 5. Start Sourcebot with the command:
```sh ```sh
yarn dev yarn dev
``` ```
A `.sourcebot` directory will be created and zoekt will begin to index the repositories found given `config.json`. A `.sourcebot` directory will be created and zoekt will begin to index the repositories found given `config.json`.
6. Go to `http://localhost:3000` - once a index has been created, you can start searching. 6. Go to `http://localhost:3000` - once a index has been created, you can start searching.