
Text
Give your coding agent small bash helpers to pull line ranges or grep patterns from repo files during reviews, debugging, and doc extraction.
Install
npx skills add https://github.com/vercel-labs/bash-tool --skill textWhat is this skill?
- extract.sh: --lines start-end or --between start_pattern end_pattern via sed
- search.sh: pattern search with optional --count and --context N line grep output
- Explicit usage errors and missing-file handling for agent-callable scripts
- Reduces full-file dumps when the agent only needs a section or match count
Adoption & trust: 47 installs on skills.sh; 580 GitHub stars; 3/3 security scanners passed (skills.sh audits).
Recommended Skills
Lark Drivelarksuite/cli
Lark Sharedlarksuite/cli
Lark Minuteslarksuite/cli
Tzstxixu-me/skills
Runcomfy Cliagentspace-so/runcomfy-agent-skills
Caveman Helpjuliusbrussee/caveman
Journey fit
Primary fit
The skill ships executable shell utilities agents invoke while working in the codebase—first shelf is Build agent-tooling. Bash extract/search scripts are tooling that augments the agent’s terminal workflow, not a shipped product feature.
Common Questions / FAQ
Is Text safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Text
#!/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 --- name: text description: Analyze and transform text files using bash tools --- # 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 bash /skills/text/scripts/stats.sh document.txt ``` ### search.sh Search for patterns in text files. ```bash bash /skills/text/scripts/search.sh <file> <pattern> [--count] [--context <lines>] ``` ### extract.sh Extract specific lines or sections from a file. ```bash 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 bash /skills/text/scripts/wordfreq.sh document.txt [--top <n>] ``` ## Examples ```bash # 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 ```