Skip to content

Commit e089fd5

Browse files
authored
read me v2 (#10)
* add initial sections for new getting started section in README * add missing section reference * simplify english in workspace section * additional language around mounting and running * nit, browser language * add info on how to edit config file and cleanup old docs * add features section * made readme more concise * fix github icon * missed a github icon * fixed links in build section * remove CONFIG_PATH setting in one command instruction:
1 parent 74b9fe5 commit e089fd5

File tree

1 file changed

+87
-91
lines changed

1 file changed

+87
-91
lines changed

README.md

Lines changed: 87 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -23,121 +23,116 @@ Sourcebot is a fast code indexing and search tool for your codebases. It is buil
2323

2424
![Demo video](https://github.com/user-attachments/assets/227176d8-fc61-42a9-8746-3cbc831f09e4)
2525

26-
# Getting Started
26+
## Features
27+
- 💻 **One-command deployment**: Get started instantly using Docker on your own machine.
28+
- 🔍 **Multi-repo search**: Effortlessly index and search through multiple public and private repositories (GitHub, GitLab, BitBucket).
29+
-**Lightning fast performance**: Built on top of the powerful [Zoekt](https://github.com/sourcegraph/zoekt) search engine.
30+
- 📂 **Full file visualization**: Instantly view the entire file when selecting any search result.
31+
- 🎨 **Modern web application**: Enjoy a sleek interface with features like syntax highlighting, light/dark mode, and vim-style navigation
2732

28-
## Using Docker
33+
You can try out our public hosted demo [here](https://demo.sourcebot.dev/)!
2934

35+
# Getting Started
3036

31-
0. Install <a href="https://docs.docker.com/get-started/get-docker/"><img src="https://www.docker.com/favicon.ico" width="16" height="16"> Docker </a>
37+
Get started with a single docker command:
3238

33-
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`:
39+
```
40+
docker run -p 3000:3000 --rm --name sourcebot ghcr.io/taqlaai/sourcebot:main
41+
```
3442

35-
```json
36-
{
37-
"$schema": "https://raw.githubusercontent.com/TaqlaAI/sourcebot/main/schemas/index.json",
38-
"Configs": [
39-
{
40-
"Type": "github",
41-
"GitHubOrg": "TaqlaAI",
42-
"Name": "^sourcebot$"
43-
}
44-
]
45-
}
46-
```
43+
Navigate to `localhost:3000` to start searching the Sourcebot repo. Want to search your own repos? Checkout how to [configure Sourcebot](#configuring-sourcebot).
4744

48-
Sourcebot also supports indexing GitLab & BitBucket. Checkout the [index.json](./schemas/index.json) for a full list of available options.
45+
<details>
46+
<summary>What does this command do?</summary>
4947

50-
2. Create a Personal Access Token (PAT) to authenticate with a code host(s):
48+
- Pull and run the Sourcebot docker image from [ghcr.io/taqlaai/sourcebot:main](https://github.com/taqlaai/sourcebot/pkgs/container/sourcebot). You'll need to make sure you have [docker installed](https://docs.docker.com/get-started/get-docker/) to do this.
49+
- Sourcebot will index itself to prepare for your search request.
50+
- Map port 3000 between your machine and the docker image (`-p 3000:3000`).
51+
</details>
5152

52-
<div>
53-
<details open>
54-
<summary>
55-
<picture>
56-
<source media="(prefers-color-scheme: dark)" srcset=".github/images/github-favicon-inverted.png">
57-
<img src="https://github.com/favicon.ico" width="16" height="16" alt="GitHub icon">
58-
</picture>
59-
GitHub
60-
</summary>
61-
Generate a GitHub Personal Access Token (PAT) [here](https://github.com/settings/tokens/new). If you're only indexing public repositories select the `public_repo` scope; otherwise, select the `repo` scope.
53+
## Configuring Sourcebot
6254

63-
You'll need to pass this PAT each time you run Sourcebot, so we recommend adding it as an environment variable. In this guide, we'll add the Github PAT as an environment variable called `GITHUB_TOKEN`:
64-
```sh
65-
export GITHUB_TOKEN=<your-token-here>
66-
```
55+
Sourcebot supports indexing and searching through public and private repositories hosted on
56+
<picture>
57+
<source media="(prefers-color-scheme: dark)" srcset=".github/images/github-favicon-inverted.png">
58+
<img src="https://github.com/favicon.ico" width="16" height="16" alt="GitHub icon">
59+
</picture> GitHub,
60+
<img src="https://gitlab.com/favicon.ico" width="16" height="16" />GitLab, and
61+
<img src="https://bitbucket.org/favicon.ico" width="16" height="16" /> BitBucket. This section will guide you through configuring the repositories that Sourcebot indexes.
6762

68-
If you'd like to persist this environment variable across shell sessions, please add this line to your shell config file (ex. `~/.bashrc`, `~/.bash_profile`, etc)
69-
63+
1. Create a new folder on your machine that stores your configs and `.sourcebot` cache, and navigate into it:
64+
```
65+
mkdir sourcebot_workspace
66+
cd sourcebot_workspace
67+
```
7068

71-
</details>
69+
2. Create a new config following the [configuration schema](https://raw.githubusercontent.com/TaqlaAI/sourcebot/main/schemas/index.json) to specify which repositories Sourcebot should index. For example to index Sourcebot itself:
7270

73-
<details>
74-
<summary><img src="https://gitlab.com/favicon.ico" width="16" height="16" /> GitLab</summary>
75-
76-
TODO
71+
```
72+
touch my_config.json
73+
echo `{
74+
"$schema": "https://raw.githubusercontent.com/TaqlaAI/sourcebot/main/schemas/index.json",
75+
"Configs": [
76+
{
77+
"Type": "github",
78+
"GitHubOrg": "TaqlaAI",
79+
"Name": "sourcebot"
80+
}
81+
]
82+
}` > my_config.json
83+
```
7784

78-
</details>
85+
3. Run Sourcebot and point it to the new config you created:
7986

80-
<details>
81-
<summary><img src="https://bitbucket.org/favicon.ico" width="16" height="16" /> BitBucket</summary>
87+
```
88+
docker run -p 3000:3000 --rm --name sourcebot -e CONFIG_PATH=./my_config.json -v $(pwd):/data ghcr.io/taqlaai/sourcebot:main
89+
```
8290

83-
TODO
91+
This command will also mount the current directory (`-v $(pwd):/data`) to allow Sourcebot to persist the `.sourcebot` cache.
8492

85-
</details>
86-
</div>
93+
### (Optional) Provide an access token to index private repositories
94+
In order to allow Sourcebot to index your private repositories, you must provide it with an access token.
8795

88-
3. Launch the latest image from the [ghcr registry](https://github.com/TaqlaAI/sourcebot/pkgs/container/sourcebot):
96+
<div>
97+
<details>
98+
<summary>
99+
<picture>
100+
<source media="(prefers-color-scheme: dark)" srcset=".github/images/github-favicon-inverted.png">
101+
<img src="https://github.com/favicon.ico" width="16" height="16" alt="GitHub icon">
102+
</picture> GitHub
103+
</summary>
89104

90-
<div>
91-
<details open>
92-
<summary>
93-
<picture>
94-
<source media="(prefers-color-scheme: dark)" srcset=".github/images/github-favicon-inverted.png">
95-
<img src="https://github.com/favicon.ico" width="16" height="16" alt="GitHub icon">
96-
</picture>
97-
GitHub
98-
</summary>
105+
Generate a GitHub Personal Access Token (PAT) [here](https://github.com/settings/tokens/new) and make sure you select the `repo` scope.
99106

100-
Run the `sourcebot` docker image, passing in the Github PAT you generated in the previous step as an environment variable called `GITHUB_TOKEN`:
101-
```sh
102-
docker run -p 3000:3000 --rm --name sourcebot -v $(pwd):/data -e GITHUB_TOKEN=$GITHUB_TOKEN ghcr.io/taqlaai/sourcebot:main
103-
```
104-
</details>
107+
You'll need to pass this PAT each time you run Sourcebot by setting the GITHUB_TOKEN environment variable:
105108

106-
<details>
107-
<summary><img src="https://gitlab.com/favicon.ico" width="16" height="16" /> GitLab</summary>
109+
<pre>
110+
docker run -p 3000:3000 --rm --name sourcebot -e <b>GITHUB_TOKEN=[your-github-token]</b> -v $(pwd):/data ghcr.io/taqlaai/sourcebot:main
111+
</pre>
108112

109-
```sh
110-
docker run -p 3000:3000 --rm --name sourcebot -v $(pwd):/data -e GITLAB_TOKEN=<token> ghcr.io/taqlaai/sourcebot:main
111-
```
113+
</details>
112114

113-
</details>
115+
<details>
116+
<summary><img src="https://gitlab.com/favicon.ico" width="16" height="16" /> GitLab</summary>
114117

115-
<details>
116-
<summary><img src="https://bitbucket.org/favicon.ico" width="16" height="16" /> BitBucket</summary>
118+
TODO
117119

118-
TODO
120+
</details>
119121

120-
</details>
121-
</div>
122+
<details>
123+
<summary><img src="https://bitbucket.org/favicon.ico" width="16" height="16" /> BitBucket</summary>
122124

123-
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:
125+
TODO
124126

125-
```sh
126-
INFO spawned: 'node-server' with pid 10
127-
INFO spawned: 'zoekt-indexserver' with pid 11
128-
INFO spawned: 'zoekt-webserver' with pid 12
129-
run [zoekt-mirror-github -dest /data/.sourcebot/repos -delete -org <org>]
130-
...
131-
INFO success: node-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
132-
INFO success: zoekt-indexserver entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
133-
INFO success: zoekt-webserver entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
134-
```
127+
</details>
128+
</div>
135129

136-
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.
137130

138-
4. Go to `http://localhost:3000` - once an index has been created, you can start searching.
131+
## Build from source
132+
>[!NOTE]
133+
>You don't need to build Sourcebot in order to use it! If you'd just like to use Sourcebot, please read [how to configure Sourcebot](#configuring-sourcebot).
139134
140-
## Building Sourcebot
135+
If you'd like to make changes to Sourcebot you'll need to build from source:
141136

142137
1. Install <a href="https://go.dev/doc/install"><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>. Note that a NodeJS version of at least `21.1.0` is required.
143138

@@ -167,7 +162,7 @@ The zoekt binaries and web dependencies are placed into `bin` and `node_modules`
167162
{
168163
"Type": "github",
169164
"GitHubOrg": "TaqlaAI",
170-
"Name": "^sourcebot$"
165+
"Name": "sourcebot"
171166
}
172167
]
173168
}
@@ -216,14 +211,15 @@ The zoekt binaries and web dependencies are placed into `bin` and `node_modules`
216211

217212
## Telemetry
218213

219-
By default, Sourcebot collects anonymized usage data through [PostHog](https://posthog.com/) to help us improve the performance and reliability of our tool. We do not collect or transmit [any information related to your codebase](https://github.com/search?q=repo:TaqlaAI/sourcebot++captureEvent&type=code). All events are [sanitized](https://github.com/TaqlaAI/sourcebot/blob/main/src/app/posthogProvider.tsx) to ensure that no sensitive or identifying details leave your machine. The data we collect includes general usage statistics and metadata such as query performance (e.g., search duration, error rates) to monitor the application's health and functionality. This information helps us better understand how Sourcebot is used and where improvements can be made :)
214+
By default, Sourcebot collects anonymized usage data through [PostHog](https://posthog.com/) to help us improve the performance and reliability of our tool. We do not collect or transmit [any information related to your codebase](https://github.com/search?q=repo:TaqlaAI/sourcebot++captureEvent&type=code). In addition, all events are [sanitized](https://github.com/TaqlaAI/sourcebot/blob/main/src/app/posthogProvider.tsx) to ensure that no sensitive or identifying details leave your machine. The data we collect includes general usage statistics and metadata such as query performance (e.g., search duration, error rates) to monitor the application's health and functionality. This information helps us better understand how Sourcebot is used and where improvements can be made :)
220215
221216
If you'd like to disable all telemetry, you can do so by setting the environment variable `SOURCEBOT_TELEMETRY_DISABLED` to `1` in the docker run command:
222-
```sh
223-
docker run -e SOURCEBOT_TELEMETRY_DISABLED=1 /* additional args */ ghcr.io/taqlaai/sourcebot:main
224-
```
225217

226-
Or if you are building locally, add the following to your [.env](./.env) file:
218+
<pre>
219+
docker run -e <b>SOURCEBOT_TELEMETRY_DISABLED=1</b> /* additional args */ ghcr.io/taqlaai/sourcebot:main
220+
</pre>
221+
222+
Or if you are [building locally](#building-sourcebot), add the following to your [.env](./.env) file:
227223
```sh
228224
SOURCEBOT_TELEMETRY_DISABLED=1
229225
NEXT_PUBLIC_SOURCEBOT_TELEMETRY_DISABLED=1

0 commit comments

Comments
 (0)