| Crates.io | codebase-ash |
| lib.rs | codebase-ash |
| version | 0.1.0 |
| created_at | 2025-12-14 14:07:49.294082+00 |
| updated_at | 2025-12-14 14:07:49.294082+00 |
| description | Fast, offline semantic code search tool powered by tree-sitter |
| homepage | https://github.com/AshishSatish/codebase |
| repository | https://github.com/AshishSatish/codebase |
| max_upload_size | |
| id | 1984532 |
| size | 58,244 |
A fast, offline semantic code search tool powered by tree-sitter that lets you search for code patterns using natural language queries.
-i flag)--context optioncargo install codebase
This installs the codebase command globally on your system.
git clone https://github.com/AshishSatish/codebase.git
cd codebase
cargo build --release
The binary will be at target/release/codebase.exe (Windows) or target/release/codebase (Linux/Mac).
To install globally:
cargo install --path .
Download the latest release for your platform from GitHub Releases:
codebase-x86_64-pc-windows-msvc.zipcodebase-x86_64-apple-darwin.tar.gzcodebase-x86_64-unknown-linux-gnu.tar.gzExtract and add to your PATH.
# Find all functions in current directory
codebase "find functions"
# Find structs in a specific directory
codebase "find structs" --path src
# Search only Rust files
codebase "find functions" --ext rs
# Search multiple file types
codebase "find classes" --ext "py,js,ts"
# Find functions that parse files (ranked by relevance)
codebase "parse file tree-sitter" --path src --ext rs -i
# Show why each function matched
codebase "authentication validate user" --ext py -i --verbose
# Search for specific functionality across languages
codebase "handle http requests" --ext "js,ts,py" -i
Semantic mode (-i flag) searches by what the code does, not just patterns:
# Show 2 lines of context before and after each match
codebase "find structs" --context 2
# Short form
codebase "find impl" -C 3
# Find all Rust implementations with context
$ codebase "find impl" --ext rs -C 2
src\parser.rs
20:1
19
20 → impl SupportedLanguage {
21 /// Detect language from file extension
22 pub fn from_extension(ext: &str) -> Option<Self> {
# Find all TypeScript interfaces
$ codebase "find interface" --ext ts
src/types.ts
12:1 → interface UserConfig {
45:1 → interface DatabaseConnection {
<QUERY>: Natural language query (required)-p, --path <PATH>: Path to search (default: current directory)-e, --ext <EXT>: Filter by file extensions (e.g., "rs,py,js")-C, --context <N>: Show N lines of context around matches-v, --verbose: Show verbose output including parse errors-h, --help: Show help information| Language | Extensions |
|---|---|
| Rust | .rs |
| Python | .py |
| JavaScript | .js, .jsx |
| TypeScript | .ts, .tsx |
| C | .c, .h |
| C++ | .cpp, .hpp, .cc, .cxx, .hh |
This project uses tree-sitter and various tree-sitter language parsers.