Initial Commit

This commit is contained in:
Hayden Johnson 2024-07-28 18:27:22 -07:00
commit c34eb49184
2 changed files with 30 additions and 0 deletions

20
naive-prompt.sh Executable file
View file

@ -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-----------"

10
repo-size.sh Executable file
View file

@ -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"