grep

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildMatcher added in v0.3.0

func BuildMatcher(query string, opts Options) (func(string) bool, error)

BuildMatcher returns a predicate reporting whether a text fragment matches the query. Regex mode compiles a case-insensitive regexp; otherwise the query is a case-insensitive fixed-string substring test. Exported so other sources (OpenCode) share the exact same match semantics as the claude grep.

func Filter

func Filter(query string, opts Options) (map[string]struct{}, error)

Filter scans every session JSONL under ~/.claude/projects and returns the set of paths whose user/assistant content matches the query. agent-*.jsonl files are excluded.

Empty / whitespace-only query returns (nil, nil) to signal "no filtering".

Types

type Options added in v0.1.1

type Options struct {
	// Regex turns the query into a case-insensitive regular expression.
	// When false (default), the query is matched as a case-insensitive
	// fixed string, which means regex metacharacters in the query are
	// treated as literals.
	Regex bool
}

Options controls Filter behavior.

Jump to

Keyboard shortcuts

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