ripgrep

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package ripgrep is a shared wrapper around the rg binary. It mirrors utils/ripgrep.ts from Claude Code: shared utility used by GrepTool, GlobalSearchDialog, and any other consumer that needs fast text search over files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Available

func Available() bool

Available reports whether rg is on PATH.

func Find

func Find() string

Find locates the rg binary, checking PATH then common Homebrew locations. Returns "" if not found.

Types

type Result

type Result struct {
	File    string
	Line    int
	Content string // matched line text (trimmed)
}

Result is one match from a ripgrep run.

func Search(pattern, dir string, maxResults int, extraArgs ...string) ([]Result, error)

Search runs rg with the given pattern in dir and returns matches. Returns nil results (not an error) if rg exits 1 (no matches). maxResults caps output; 0 = no limit.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL