Code Review Videos > Developer Productivity > Project Context Help Command

Project Context Help Command

When working with an LLM, it can be incredibly useful to provide all your existing code as context.

There are many ways to do this, but one I’ve found that is working well on smaller scale projects is the following:

OSX:

find . -type f -name "*.ts" -exec echo "==== {} ====" \; -exec cat {} \; | pbcopyCode language: PHP (php)

Ubuntu:

find . -type f -name "*.ts" -exec echo -e "\n===== {} =====\n" \; -exec cat {} \; | xclip -selection clipboardCode language: PHP (php)

Run from the src directory, or similar. This will recursively find any *.ts files and output the files name, then the contents, and copy everything to your clipboard.

You can then paste directly into your LLM of choice (good with Google Gemini, particularly due to its large context size) and get better output as a result.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.