repo_prompt_context/repo-size.sh
2024-07-28 18:27:22 -07:00

11 lines
315 B
Bash
Executable file

#!/bin/bash
COUNTS=$(git ls-files --exclude='\.gitignore' --exclude='LICENSE' | xargs wc | tail -n 1)
WORDS=$(echo $COUNTS | awk '{print $2}')
BYTES=$(echo $COUNTS | awk '{print $3}')
TOKENS=($((WORDS / 4)))
echo "words in repo: $WORDS"
echo "bytes in repo: $BYTES"
echo "tokens in repo (~words / 4): $TOKENS"