
Text
- 58 installs
- 604 repo stars
- Updated July 15, 2026
- vercel-labs/bash-tool
text is an agent skill that analyzes and transforms text files using bash scripts for stats, search, extract, and word frequency.
About
The text skill processes text files using standard bash tools through four bundled scripts: stats.sh for line, word, and character counts; search.sh for pattern search with optional count and context flags; extract.sh for line ranges or section extraction between start and end patterns; and wordfreq.sh for ranked word frequency analysis. Each script is invoked via bash with documented arguments, enabling agents to gather file statistics, grep-like searches with context, targeted line extraction, and top-N word frequency reports without writing custom one-off commands. Examples show searching logs for ERROR with two lines of context, extracting lines 10 through 20, and listing the ten most frequent words in an article. The skill assumes text files on disk and relies on shell execution rather than language-specific parsers. It suits quick document inspection, log triage, and lightweight text analytics inside agent workflows where reproducible script entry points are preferred over ad hoc awk or sed one-liners. No network access or external services are required.
- stats.sh reports lines, words, and characters for any text file.
- search.sh supports pattern search with --count and --context flags.
- extract.sh pulls line ranges or content between pattern boundaries.
- wordfreq.sh ranks word frequencies with optional --top limit.
- Wraps grep, sed, awk, and wc via consistent bash script interfaces.
Text by the numbers
- 58 all-time installs (skills.sh)
- +1 installs in the week ending Jul 27, 2026 (Skillselion tracking)
- Ranked #286 of 560 CLI & Terminal skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Jul 27, 2026 (Skillselion catalog sync)
text capabilities & compatibility
- Capabilities
- file statistics via stats.sh · pattern search with context via search.sh · line and section extraction via extract.sh · word frequency ranking via wordfreq.sh
- Use cases
- debugging · documentation
What text says it does
Process text files using standard bash tools (grep, sed, awk, wc).
Get statistics about a text file (lines, words, characters).
Count word frequencies in a text file.
npx skills add https://github.com/vercel-labs/bash-tool --skill textAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 58 |
|---|---|
| repo stars | ★ 604 |
| Security audit | 3 / 3 scanners passed |
| Last updated | July 15, 2026 |
| Repository | vercel-labs/bash-tool ↗ |
How do I quickly analyze, search, extract, or count words in text files with consistent bash commands?
Analyze and transform text files using bash wrapper scripts for stats, search, extract, and word frequency operations.
Who is it for?
Agents or developers needing repeatable bash-based text file stats, search, extraction, and word frequency.
Skip if: Skip for structured data formats needing dedicated parsers or large-scale text pipelines beyond single-file scripts.
When should I use this skill?
User asks to analyze text files, search logs, extract line ranges, or count word frequencies with bash tools.
What you get
Structured text statistics, search results, extracted sections, or word frequency rankings from bundled scripts.
Files
Text Processing Skill
Process text files using standard bash tools (grep, sed, awk, wc).
Available Scripts
stats.sh
Get statistics about a text file (lines, words, characters).
bash /skills/text/scripts/stats.sh document.txtsearch.sh
Search for patterns in text files.
bash /skills/text/scripts/search.sh <file> <pattern> [--count] [--context <lines>]extract.sh
Extract specific lines or sections from a file.
bash /skills/text/scripts/extract.sh <file> --lines <start>-<end>
bash /skills/text/scripts/extract.sh <file> --between <start_pattern> <end_pattern>wordfreq.sh
Count word frequencies in a text file.
bash /skills/text/scripts/wordfreq.sh document.txt [--top <n>]Examples
# Get file statistics
bash /skills/text/scripts/stats.sh readme.txt
# Search with context
bash /skills/text/scripts/search.sh log.txt "ERROR" --context 2
# Extract lines 10-20
bash /skills/text/scripts/extract.sh file.txt --lines 10-20
# Top 10 most frequent words
bash /skills/text/scripts/wordfreq.sh article.txt --top 10#!/bin/bash
# Extract specific lines or sections from a file
if [ -z "$1" ]; then
echo "Usage: extract.sh <file> --lines <start>-<end>" >&2
echo " extract.sh <file> --between <start_pattern> <end_pattern>" >&2
exit 1
fi
FILE="$1"
shift
if [ ! -f "$FILE" ]; then
echo "Error: File not found: $FILE" >&2
exit 1
fi
case "$1" in
--lines|-l)
RANGE="$2"
START=$(echo "$RANGE" | cut -d'-' -f1)
END=$(echo "$RANGE" | cut -d'-' -f2)
sed -n "${START},${END}p" "$FILE"
;;
--between|-b)
START_PAT="$2"
END_PAT="$3"
sed -n "/${START_PAT}/,/${END_PAT}/p" "$FILE"
;;
*)
echo "Unknown option: $1" >&2
echo "Use --lines or --between" >&2
exit 1
;;
esac
#!/bin/bash
# Search for patterns in text files
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: search.sh <file> <pattern> [--count] [--context <lines>]" >&2
exit 1
fi
FILE="$1"
PATTERN="$2"
shift 2
COUNT_ONLY=false
CONTEXT=0
while [ $# -gt 0 ]; do
case "$1" in
--count|-c)
COUNT_ONLY=true
;;
--context|-C)
CONTEXT="$2"
shift
;;
esac
shift
done
if [ ! -f "$FILE" ]; then
echo "Error: File not found: $FILE" >&2
exit 1
fi
if [ "$COUNT_ONLY" = true ]; then
MATCHES=$(grep -c "$PATTERN" "$FILE")
echo "Matches found: $MATCHES"
elif [ "$CONTEXT" -gt 0 ]; then
grep -n -C "$CONTEXT" "$PATTERN" "$FILE"
else
grep -n "$PATTERN" "$FILE"
fi
#!/bin/bash
# Get statistics about a text file
if [ -z "$1" ]; then
echo "Usage: stats.sh <file>" >&2
exit 1
fi
FILE="$1"
if [ ! -f "$FILE" ]; then
echo "Error: File not found: $FILE" >&2
exit 1
fi
echo "=== Text Statistics: $FILE ==="
echo ""
LINES=$(wc -l < "$FILE" | tr -d ' ')
WORDS=$(wc -w < "$FILE" | tr -d ' ')
CHARS=$(wc -c < "$FILE" | tr -d ' ')
echo "Lines: $LINES"
echo "Words: $WORDS"
echo "Characters: $CHARS"
echo ""
echo "=== First 5 lines ==="
head -5 "$FILE"
echo ""
echo "=== Last 5 lines ==="
tail -5 "$FILE"
#!/bin/bash
# Count word frequencies in a text file
if [ -z "$1" ]; then
echo "Usage: wordfreq.sh <file> [--top <n>]" >&2
exit 1
fi
FILE="$1"
TOP=0
shift
while [ $# -gt 0 ]; do
case "$1" in
--top|-t)
TOP="$2"
shift
;;
esac
shift
done
if [ ! -f "$FILE" ]; then
echo "Error: File not found: $FILE" >&2
exit 1
fi
# Convert to lowercase, split into words, count and sort
RESULT=$(tr '[:upper:]' '[:lower:]' < "$FILE" | \
tr -cs '[:alpha:]' '\n' | \
grep -v '^$' | \
sort | \
uniq -c | \
sort -rn)
if [ "$TOP" -gt 0 ]; then
echo "$RESULT" | head -"$TOP"
else
echo "$RESULT"
fi
Related skills
FAQ
What does the text skill produce?
File statistics, pattern search output, extracted line sections, or ranked word frequency counts from bundled scripts.
When should I use the text skill?
When you need quick text file analysis via stats.sh, search.sh, extract.sh, or wordfreq.sh bash wrappers.
Is the text skill safe to install?
Review the Security Audits panel on this page before installing in production.