redhat-et / redhat-et/docsclaw

Add glob tool for file search by name pattern

Open
#28 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2
Forks
1
Avg merge
6h 9m
Merged PRs (30d)
1

Description

Summary

Add a glob tool that finds files by name pattern within the workspace. Essential for discovering project structure and locating files.

Motivation

A coding agent needs to answer questions like "find all Go test files", "where is the main.go", "list all YAML configs." The exec tool can run find, but a dedicated tool provides:

  • Workspace boundary enforcement
  • Structured output (sorted file list)
  • No shell injection risk
  • Consistent cross-platform behavior

Proposed interface

{
  "name": "glob",
  "parameters": {
    "pattern": "string — glob pattern, e.g. '**/*.go', 'cmd/*/main.go'",
    "path": "string — optional subdirectory to search (default: workspace root)",
    "max_results": "integer — maximum files to return (default: 100)"
  }
}

Implementation notes

  • Use github.com/bmatcuk/doublestar/v4 for ** support (Go's filepath.Glob doesn't support **)
  • Or: shell out to fd if available, fall back to filepath.Walk + filepath.Match
  • Enforce workspace boundary (same logic as read_file)
  • Respect .gitignore if in a git repo
  • Sort results by path for deterministic output
  • Return one file path per line

Related

  • Part of the coding agent capabilities gap analysis
  • Pairs with edit_file (#26) and grep (#27) for code navigation + editing workflow
  • #7 — Specialized Dockerfiles (coding flavor would bundle fd)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing read_file workspace-boundary logic, then review the related edit_file (#26) and grep (#27) tools for interface conventions. Define the glob tool around the proposed pattern, path, and max_results parameters; done means workspace-safe, deterministic, gitignore-aware file paths with cross-platform behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.