From c34eb491844ea010b53b655926b6bc147b3a07f6 Mon Sep 17 00:00:00 2001 From: Hayden Johnson Date: Sun, 28 Jul 2024 18:27:22 -0700 Subject: [PATCH] Initial Commit --- naive-prompt.sh | 20 ++++++++++++++++++++ repo-size.sh | 10 ++++++++++ 2 files changed, 30 insertions(+) create mode 100755 naive-prompt.sh create mode 100755 repo-size.sh diff --git a/naive-prompt.sh b/naive-prompt.sh new file mode 100755 index 0000000..17bba1c --- /dev/null +++ b/naive-prompt.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# List all files in the git repository excluding .gitignore and LICENSE files +FILES=$(git ls-files --exclude='\.gitignore' --exclude='LICENSE') + +# Print a heading indicating that the following is a list of files and their contents +echo -e "The following is a list of files and their contents. Use these files for context in answering any questions.\n" + +# Loop through all the files listed by git ls-files command +for file in $FILES; do + # Print the filename followed by a colon and newline + echo -e "${file}:\n\`\`\`" + # Read the contents of the file, outputting each line prefixed by a tab character + cat $file + # Print an extra newline for separation between files + echo -e "\`\`\`" +done + +# Print a footer indicating that the context has ended +echo -e "End Context\n-----------" diff --git a/repo-size.sh b/repo-size.sh new file mode 100755 index 0000000..8713f7b --- /dev/null +++ b/repo-size.sh @@ -0,0 +1,10 @@ +#!/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"