BetterTree

Hi all,

I just quickly want to showcase a tool I created for interacting with certain AI-powered chatbots. If you’ve ever used an AI for coding a project, you’re probably familiar with the problem: as the project grows larger, the AI seems to lose track of how the project is structured and what the files are all about.

To solve this, I used to take the following tedious approach:

  1. List the file structure using the tree command.
  2. Copy and paste the structure into the chat.
  3. Manually copy and paste the content of each relevant file to convey all the necessary context.

Not ideal, right? That’s why I created BetterTree!

What is BetterTree?

BetterTree is a command-line tool that makes it easy to share your project’s structure and file contents with your favorite AI companion. It works like the tree command but takes it further by displaying file contents up to a specified size and line limit.

You can configure:

  • Which directories and files to exclude using environment variables.
  • File size and line count limits via command-line arguments.
  • Specific file extensions to show, so you only share what’s relevant.

Installation

Here’s how you can install BetterTree:

  1. Clone the repository: git clone https://github.com/Geibinger/BetterTree.git && cd BetterTree
  2. Run the installation script: chmod +x install.sh ./install.sh
  3. Reload your shell configuration: source ~/.bashrc

Examples

  • Show the project structure with default settings: bettertree
  • Display only Python files with a size limit of 5 KB and up to 500 lines per file: bettertree -s 5 -l 500 -e .py

Find it on GitHub!

You can find the full project and more details here:
GitHub Repository: BetterTree

I hope BetterTree helps make your coding workflow smoother and saves you time! That’s it—goodbye, and thanks for the fish!

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Scroll to Top