hive.terminal-tools-fs-search
하는 일
이 스킬은 AI가 파일 안의 글자를 찾고 파일 이름으로 파일을 찾는 방법을 보여 줍니다. 프로젝트나 로그 폴더를 뒤져야 하는 모든 사람을 위한 것입니다.
사용하는 경우
- ✓프로젝트 전체에서 단어나 코드가 어디에 나타나는지 찾아야 할 때.
- ✓이름이나 패턴으로 파일을 찾고 싶을 때.
- ✓컴퓨터에서 파일 크기, 날짜, 폴더 내용을 확인해야 하는 경우.
스킬 링크
https://github.com/aden-hive/hive/blob/main/core/framework/skills/_preset_skills/terminal-tools-fs-search/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 프로젝트 폴더에서 예전 가격인 49달러를 언급하는 파일을 모두 찾아 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 파일 안의 텍스트를 찾기 위해 ripgrep을, 파일 이름을 찾기 위해 glob 검색을, 폴더 보기와 크기 및 날짜 확인을 위해 간단한 목록 명령을 사용합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Filesystem search
terminal-tools provides two structured search tools: terminal_rg (ripgrep for content) and terminal_glob (find files by name/glob). Predicate queries (mtime/size/type) and everything else (tree, stat, du) are just terminal_exec.
When to use what
| Task | Tool |
|---|---|
| Find code/text matching a pattern (project tree or any path) | terminal_rg (gitignore-aware; defaults to your session workdir) |
| Find files by name/glob (any path) | terminal_glob |
| Find files by mtime/size/type predicate | terminal_exec("find ...") (see references/find_predicates.md) |
| List a directory | terminal_exec("ls -la /path") |
| Tree view | terminal_exec("tree -L 2 /path") |
| Single-path stat | terminal_exec("stat /path") |
| Disk usage | terminal_exec("du -sh /path") or terminal_exec("du -h --max-depth=2 /") |
| Count matching lines in returned results | terminal_rg(...).total (check truncated before treating it as complete) |
terminal_rg — content search
ripgrep is fast, gitignore-aware, and has a deep flag surface. The structured wrapper exposes common search flags directly; extra_args accepts additional flags compatible with JSON output. Output modes such as --count and --files-with-matches are not compatible with this structured interface; use the CLI when that output is needed.
Quickstart installs and verifies ripgrep. Existing installations can be repaired with uv run scripts/ensure_ripgrep.py --install from the repository root. The runtime also checks Windows package-manager locations and current registry PATH entries; HIVE_RIPGREP_PATH can select an absolute executable path. Startup logs report the executable and version, or instructions to fix the missing dependency.
If ripgrep is unavailable, terminal_rg returns code="ripgrep_required" without searching by default. For an approximate search, explicitly set allow_fallback=True: this uses Python regex, a limited filetype table, and basename globs, and does not honor .gitignore. Even with opt-in, context, extra_args, unknown filetypes and complex globs require ripgrep and return an error. Inspect fallback_limitations; do not treat approximate results as a gitignore-aware inventory.
With context=N, surrounding lines are returned in context, separate from matches. Both contain path, line, and text; total counts only match entries.
Common patterns
# All Python files containing "TODO"
terminal_rg(pattern="TODO", path=".", type_filter="py")
# Case-insensitive, with context
terminal_rg(pattern="error", path="/var/log", ignore_case=True, context=2)
# Search hidden files (rg ignores them by default)
terminal_rg(pattern="api_key", path="~", hidden=True)
# Don't respect .gitignore (find files git would ignore)
terminal_rg(pattern="generated", path=".", no_ignore=True)
# Multi-line pattern (e.g., function definitions spanning lines)
terminal_rg(pattern=r"def\s+\w+\(.*\n.*\n", path="src", extra_args=["--multiline"])
# Specific filename glob
terminal_rg(pattern="version", path=".", glob="*.toml")
rg flag idioms
| Flag | Effect |
|---|---|
-tpy (type_filter="py") |
Only Python files |
-uu |
Don't respect any ignores (incl. .git/) |
--multiline (extra_args) |
Allow regex spanning lines |
--max-count (max_count) |
Stop after N matches per file |
--max-depth (max_depth) |
Limit recursion |
-w (extra_args) |
Whole word match |
-F (extra_args) |
Fixed string (no regex) |
See references/ripgrep_cheatsheet.md for the long form.
terminal_glob — find files by name
Lists files matching a glob, gitignore-aware (backed by rg --files). The pattern is widened for you so a bare stem Just Works — the actual glob run is returned as expanded_pattern:
lk_scan_post_reactors→ matched as**/*lk_scan_post_reactors*(recursive substring)*.py→ matched as**/*.py(recursive by default)src/**/*.py→ used verbatim
If rg is unavailable, filename search retains a best-effort walk with fallback="python-walk" and a note that .gitignore is not honored.
# Find a file by stem anywhere under a tree
terminal_glob(pattern="lk_scan_post_reactors", path="core/framework/skills")
# All YAML configs under /etc
terminal_glob(pattern="*.yaml", path="/etc")
# Include .gitignored / hidden / build-cache files
terminal_glob(pattern="*.log", path=".", include_ignored=True)
For predicate queries (modified in last N
자주 묻는 질문
텍스트 검색과 이름 검색은 어떻게 다른가요?
텍스트 검색은 파일 안에서 일치하는 단어를 찾고, 이름 검색은 파일 이름이나 패턴으로 파일을 찾습니다.
검색이 무시되는 파일을 건너뛰나요?
네. 프로젝트에서는 텍스트 검색이 gitignore 규칙을 따릅니다.
결과가 잘려 나온 경우는 어떻게 하나요?
결과를 완전하다고 보기 전에 잘렸는지 확인하라고 스킬이 안내합니다.
상세 정보
작성자의 원본 설명
Use terminal_rg / terminal_glob for all filesystem search — your project tree as well as system configs, /var/log, /etc, archive contents. Teaches the rg vs glob vs terminal_exec("find/ls/du/tree") split, common rg flag combos for code/logs/configs, glob patterns for finding files by name, the rule that mtime/size/type predicate queries drop to terminal_exec("find ..."), and that for tree views or single-file stat info you should just use terminal_exec instead of inventing a tool. Read before reaching for raw shell to grep or find anything.
repo: aden-hive/hive
인기도
- GitHub 스타
- 11k
- 순위
- #11813
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
browser-edge-cases
11k에이전트가 LinkedIn, X 같은 까다로운 사이트나 스크립트가 많은 페이지에서 실패하는 브라우저 자동화를 고치도록 돕습니다.
hive.browser-automation
11k에이전트가 hive-browser 도구로 내 Chrome 브라우저를 제어하도록 가르칩니다. 스크린샷과 클릭을 사용합니다.
hive.colony-progress-tracker
11k에이전트가 작업을 맡고 단계와 점검 내용을 공유 데이터베이스에 기록하도록 돕습니다. 작업이 진행되는 동안 추적됩니다.
hive.context-preservation
11k에이전트가 긴 도구 결과에서 핵심 사실을 메모로 저장해, 오래된 세부 내용이 기억에서 지워지기 전에 보존하도록 돕습니다.