ascerra/tree-ai

Run tree-ai in a directory to get a tree view annotated with AI-generated descriptions of files and folders.

3

stars

19

commits

Go

primary language

Jan 29, 2026

updated

README

tree-ai

tree-ai is a command-line tool that augments the traditional tree command with AI-generated descriptions for files and folders. It uses IBM Granite language models to provide concise summaries of each element in your directory tree, helping you quickly understand unfamiliar projects.

Features

  • 🧠 AI-generated summaries of files and directories
  • πŸ” Fully recursive traversal with --max-depth
  • πŸ“ Customizable prompt instructions --prompt
  • βœ‚οΈ Can strictly enforce one line with --truncate
  • 🧰 Support for both local and remote AI models
  • πŸ“¦ Works offline if model is cached

Installation

πŸ”§ For Developers (from source)

Clone the repository and install from source:

git clone https://github.com/your-org/tree-ai.git
cd tree-ai
make install
source .venv/bin/activate

Usage

To use your own model, you must export your API key and provide both --model and --endpoint:

export TREE_AI_API_KEY=<your-api-key>
bin/tree-ai ./ \
  --endpoint=https://your-model-endpoint.example.com/v1/completions \
  --model=your-model-id

Show up levels based on preference:

bin/tree-ai ./ --max-depth=3

Use a custom instruction for summarization with --prompt:

bin/tree-ai ./ --prompt "Summarize what this file contributes to the project."

Use --truncate to keep summaries to one line (useful for compact output):

bin/tree-ai ./ --truncate

Include hidden files and directories (like tree -a):

bin/tree-ai ./ --include-dotfiles

Enable verbose output for debugging:

bin/tree-ai ./ --verbose

Output Example

❯ bin/tree-ai ./ --endpoint="<model endpoint>" --truncate          
⚠️  AI-generated summaries may be inaccurate or outdated.
└── LICENSE ➀ grants users permission to use, modify, and distribute the project's software
└── Makefile ➀ as a build and testing automation tool for the tree-ai project
└── README.md ➀ This file serves as the project's documentation and user guide
β”œβ”€β”€ bin ➀ serves as a centralized location for executable scripts and utilities
β”‚   └── tree-ai ➀ outlines the architecture and details for integrating an AI model
β”œβ”€β”€ cmd ➀ houses the command-line interface (CLI) implementation for the project
β”‚   └── root.go ➀ The purpose of this file is to define the command-line interface

Testing

make test

License

MIT License

Contributors

ascerra

19 commits

ascerra/tree-ai

Run tree-ai in a directory to get a tree view annotated with AI-generated descriptions of files and folders.

3

stars

19

commits

Go

primary language

Jan 29, 2026

updated

README

tree-ai

tree-ai is a command-line tool that augments the traditional tree command with AI-generated descriptions for files and folders. It uses IBM Granite language models to provide concise summaries of each element in your directory tree, helping you quickly understand unfamiliar projects.

Features

  • 🧠 AI-generated summaries of files and directories
  • πŸ” Fully recursive traversal with --max-depth
  • πŸ“ Customizable prompt instructions --prompt
  • βœ‚οΈ Can strictly enforce one line with --truncate
  • 🧰 Support for both local and remote AI models
  • πŸ“¦ Works offline if model is cached

Installation

πŸ”§ For Developers (from source)

Clone the repository and install from source:

git clone https://github.com/your-org/tree-ai.git
cd tree-ai
make install
source .venv/bin/activate

Usage

To use your own model, you must export your API key and provide both --model and --endpoint:

export TREE_AI_API_KEY=<your-api-key>
bin/tree-ai ./ \
  --endpoint=https://your-model-endpoint.example.com/v1/completions \
  --model=your-model-id

Show up levels based on preference:

bin/tree-ai ./ --max-depth=3

Use a custom instruction for summarization with --prompt:

bin/tree-ai ./ --prompt "Summarize what this file contributes to the project."

Use --truncate to keep summaries to one line (useful for compact output):

bin/tree-ai ./ --truncate

Include hidden files and directories (like tree -a):

bin/tree-ai ./ --include-dotfiles

Enable verbose output for debugging:

bin/tree-ai ./ --verbose

Output Example

❯ bin/tree-ai ./ --endpoint="<model endpoint>" --truncate          
⚠️  AI-generated summaries may be inaccurate or outdated.
└── LICENSE ➀ grants users permission to use, modify, and distribute the project's software
└── Makefile ➀ as a build and testing automation tool for the tree-ai project
└── README.md ➀ This file serves as the project's documentation and user guide
β”œβ”€β”€ bin ➀ serves as a centralized location for executable scripts and utilities
β”‚   └── tree-ai ➀ outlines the architecture and details for integrating an AI model
β”œβ”€β”€ cmd ➀ houses the command-line interface (CLI) implementation for the project
β”‚   └── root.go ➀ The purpose of this file is to define the command-line interface

Testing

make test

License

MIT License

Contributors

ascerra

19 commits

Languages

Go

62.1%

Python

28.1%

Shell

6.4%

Makefile

3.3%