Search for relevant information in text files without reading the entire file. Returns matching lines with context, scored by relevance. Useful for quickly finding specific information in large files.
The script uses token-based matching with scoring:
bash
# Basic search
python3 <skill_dir>/scripts/text-scan.py <file> --query "<search terms>"
# Brief format (line number + content)
python3 <skill_dir>/scripts/text-scan.py <file> --query "<search terms>" --brief
# JSON output (for programmatic use)
python3 <skill_dir>/scripts/text-scan.py <file> --query "<search terms>" --json
# Custom context window
python3 <skill_dir>/scripts/text-scan.py <file> --query "<search terms>" --before 3 --lines 5
# From stdin
cat <file> | python3 <skill_dir>/scripts/text-scan.py --query "<search terms>"
bash
# Find the runway in STATE.md
python3 <skill_dir>/scripts/text-scan.py /home/marek/.openclaw/workspace/STATE.md --query "runway"
# Find today's work hours
python3 <skill_dir>/scripts/text-scan.py /home/marek/.openclaw/workspace/STATE.md --query "today work hours"
# Find all log entries about a topic
python3 <skill_dir>/scripts/text-scan.py /home/marek/.openclaw/workspace/LOG.md --query "weather"
ParameterDescriptionDefault--query, -qSearch query (keywords)required--lines, -aLines after each match5--before, -bLines before each match2--max-results, -nMaximum results to return5--jsonJSON output formatfalse--briefBrief format onlyfalse--fuzzyEnable fuzzy matchingfalse--output, -oWrite results to filestdout
This skill integrates with the standard read tool workflow:
text-scan to quickly find relevant lines in a fileread to load the full file context--brief flag is fastest for quick scans--json output is useful for scripting/automationfind to scan multiple files: find . -name "*.md" | xargs ...