Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Commit 3dd15ae

Browse files
committed
Update README
1 parent 839f67b commit 3dd15ae

File tree

2 files changed

+72
-4
lines changed

2 files changed

+72
-4
lines changed

CONTRIBUTING.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 72 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,86 @@
33
Codebased is the most powerful code search tool that runs on your computer.
44

55
Here's why it's great:
6+
67
- Search, simplified: Combines semantic and full-text search to find what you're looking for, not just what you typed.
78
- Search code, not just text: Searches for complete code structures, not just lines of text, in 11 languages.
89
- Ignores uninteresting files: Respects your `.gitignore` file(s) and ignores hidden directories.
910
- Instant editing: Selecting a search result opens your favorite editor at the correct file and line number.
1011
- Fast: Indexes your code in seconds, searches in milliseconds, and updates in real-time as you edit your code.
1112
- Open-source, runs locally: No code is stored on remote servers.
1213

13-
## Table of Contents
14+
## Getting Started
15+
16+
The fastest way to install Codebased is with [pipx](https://github.com/pypa/pipx?tab=readme-ov-file#install-pipx):
17+
18+
```shell
19+
pipx install codebased
20+
```
21+
22+
Verify the installation by running:
23+
24+
```shell
25+
codebased --version
26+
```
27+
28+
If this fails, please double-check your pipx installation.
29+
30+
Next, run the following command in a Git repository to start searching:
31+
32+
```shell
33+
codebased search
34+
```
35+
36+
The first time you run Codebased, it will create a configuration file at `~/.codebased/config.toml`.
37+
It will prompt you for an OpenAI key, you can access a testing key on the [Discord](https://discord.gg/cQrQCAKZ).
38+
39+
Once this is finished, `codebased` will create an index of your codebase, stored in `.codebased` at the root of your
40+
repository.
41+
This takes seconds for most projects, but can take a few minutes for large projects.
42+
Most of the time is spent creating embeddings using the OpenAI API.
43+
44+
Once the index is created, a terminal UI will open with a search bar.
45+
At this point, you can start typing a search query and results will appear as you type.
46+
47+
- You can use the arrow keys and the mouse to navigate the results.
48+
- A preview of the selected result is displayed.
49+
- Pressing enter on the highlighted result opens the file in your editor at the correct line number.
50+
- Pressing escape returns to the search bar.
51+
- As you edit your code, the index will be updated in real-time, and future searches will reflect your changes.
52+
53+
Codebased will run `stat` on all non-ignored files in your repository, which can take a few seconds, but after that
54+
will listen for filesystem events, so it's recommended to use the TUI.
55+
56+
# Development
57+
58+
If you'd like to contribute, bug fixes are welcome, as well as anything in the list
59+
of [issues](https://github.com/codebased-sh/codebased/issues).
60+
61+
Especially welcome is support for your favorite language, as long as:
62+
63+
1. There's a tree-sitter grammar for it.
64+
2. There are Python bindings for it maintained by the excellent [amaanq](https://pypi.org/user/amaanq/).
65+
66+
Also, if there's anything ripgrep does that Codebased doesn't, feel free to file an issue / PR.
67+
68+
Clone the repository:
69+
70+
```shell
71+
git clone https://github.com/codebased-sh/codebased.git
72+
```
73+
74+
Install the project's dependencies (requires [poetry](https://python-poetry.org), using a virtual environment is
75+
recommended):
76+
77+
```shell
78+
poetry install
79+
```
80+
81+
Run the tests (some tests require an `OPENAI_API_KEY` environment variable, usage is de minimis):
1482

15-
- [Appendix](#appendix)
16-
- [Languages](#languages)
83+
```shell
84+
poetry run pytest
85+
```
1786

1887
# Appendix
1988

0 commit comments

Comments
 (0)