GitHub

boltz search

Search for regex patterns in files across your codebase.

Usage

boltz search <pattern> [path]
boltz search <pattern> [path] --json

Examples

Basic Search

$ boltz search "func" .
cmd/search.go:47:func runSearch(cmd *cobra.Command, args []string) {
cmd/symbols.go:44:func runSymbols(cmd *cobra.Command, args []string) {
cmd/tree.go:22:func runTree(cmd *cobra.Command, args []string) {

3 matches found

Regex Search

$ boltz search "func.*Handler" .
api/handlers.go:12:func CreateUserHandler(w http.ResponseWriter, r *http.Request) {
api/handlers.go:45:func DeleteUserHandler(w http.ResponseWriter, r *http.Request) {

2 matches found

JSON Output

$ boltz search "TreeCmd" . --json
{
  "pattern": "TreeCmd",
  "matches": [
    {"file": "cmd/tree.go", "line": 13, "content": "var TreeCmd = &cobra.Command{"},
    {"file": "main.go", "line": 34, "content": "rootCmd.AddCommand(cmd.TreeCmd)"}
  ],
  "total": 2
}

Options

  • --json - Output results as JSON

Use Cases

  • Find all TODOs and FIXMEs
  • Locate symbol usages across files
  • Search for patterns in code
  • Feed search results to AI assistants