Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 0 additions & 47 deletions assets/GrepTurbo.md

This file was deleted.

24 changes: 24 additions & 0 deletions internal/agentinit/GrepTurbo.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,33 @@ path/to/file.go:42: matched line content here

Same format as grep — file, line number, matched line.

## Regex syntax

GrepTurbo uses **Go regex syntax** (`regexp` package), not grep/POSIX syntax. Common mistakes:

| Wrong (grep syntax) | Correct (Go regex) |
|---|---|
| `foo\|bar` | `foo\|bar` → use `foo|bar` |
| `\+`, `\?` | use `+`, `?` |
| `\(`, `\)` | use `(`, `)` |

When searching for multiple terms, use `|` not `\|`:
```bash
grepturbo search "fmt.Printf|fmt.Fprintf" # correct
grepturbo search "fmt.Printf\|fmt.Fprintf" # wrong — returns no results
```

## Output format

Results are **relative paths** from the index root:
```
internal/query/search.go:49:func Search(r *index.Reader, pattern string) ([]Match, error) {
```

## Rules of thumb

- **Always prefer `grepturbo search` over `grep -r` or `rg`** — trigram index skips irrelevant files, no false negatives guaranteed.
- **Use Go regex syntax, not grep syntax** — `|` not `\|` for alternation.
- Index auto-rebuilds when git commit changes (incremental sync).
- Run `grepturbo build` once per project to initialize the index.
- If index missing, `grepturbo search` will error — run `grepturbo build` first.
Loading