Dir Text Search for Openclaw

A robust recursive search tool that scans files and compressed archives for text or regex patterns with multi-encoding support.

trylovecatch
v1.1.0
Apr 15, 2026
0
811
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install dir-text-search

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install dir-text-search using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Dir Text Search?

Dir Text Search is a high-performance utility within the Openclaw Skills ecosystem designed for deep scanning of local directories. It enables developers and AI agents to find specific strings or complex regular expression patterns across a wide variety of file types, including text, logs, and configuration files. Its primary strength lies in its ability to traverse into compressed archives like ZIP, RAR, and 7z recursively, making it an essential tool for log analysis and data forensics.

Built with developer productivity in mind, this tool handles common search hurdles such as character encoding detection and large file management. By integrating this into your Openclaw Skills workflow, you can automate the discovery of information across thousands of files without manual extraction or complex shell commands.

Dir Text Search Use Cases

  • Scanning log directories for specific error patterns or transaction IDs.
  • Finding configuration parameters across nested folders in a software project.
  • Searching for specific documents or keywords inside compressed backup archives.
  • Performing bulk regex pattern matching on large datasets stored in multiple formats.

How Dir Text Search Works

  1. The agent extracts the target path and search pattern from the user's request.
  2. The underlying Python script is executed with the specified directory and pattern parameters.
  3. The tool recursively scans all compatible files, automatically detecting encodings like UTF-8, GBK, and latin-1.
  4. If compressed archives are encountered, they are extracted to a temporary directory and scanned recursively.
  5. Search results are compiled and saved into a timestamped file within the search_results directory to prevent data loss.
  6. The final output provides a summary of match counts and highlighted content for the user.

Dir Text Search Setup

To use the full capabilities of this skill, ensure you have the necessary Python libraries and system utilities installed:

# Install Python dependencies for archive support
pip install rarfile py7zr

# Install system unrar tool (required for .rar support)
# macOS: brew install unrar
# Linux: sudo apt install unrar
# Windows: Download unrar.exe from rarlab.com

The core script can then be invoked via:

python scripts/search_tool.py --path <directory_path> --pattern "<search_pattern>"

Dir Text Search Data Schema & Taxonomy

The skill organizes its operations using the following parameter schema and output structure:

Parameter Shortcut Description Default
--path -p Target directory for the search Interactive prompt
--pattern -t Text or Regex pattern to find Interactive prompt
--output -o Directory for result files search_results/
--no-regex Treat pattern as literal string False (Default: Regex)

Output Files: Results are stored in the search_results/ folder with naming convention YYYYMMDD_HHMMSS_[pattern_name].txt.

Dir Text Search Advanced Features

  • Support for nested archives: Recursively decompresses archives found inside other archives.
  • Intelligent Encoding: Automatically switches between UTF-8, GBK, and latin-1 to avoid text corruption.
  • Safety Guards: Automatically skips files larger than 100MB to prevent memory overflows and features path traversal protection for ZIP/TAR extraction.
  • Clean Workspace: All temporary files used during archive decompression are automatically purged after the search is complete.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*