Practical overview
When it fits
Use it when a coding assistant needs relevant project structure and file contents, and you want to control which files are included before supplying that context.
Who it is for
- Developers who want to give an LLM selected codebase context for debugging or continuing a project.
- People preparing focused code review or troubleshooting prompts from project files.
Documented uses
- Create a directory-tree-and-files text bundle from a project.
- Narrow the included files by type, path pattern or interactive selection.
- Save or copy project context for use in an external coding assistant.
Requirements & limits
The documented CLI can be installed through pipx, pip or Homebrew. The repository specifies the GPL-3.0 license.
- Interactive selection is available alongside extension and glob-pattern filtering.
- Gptree respects .gitignore by default and excludes common directories including .git, __pycache__ and .vscode.
- Safe mode can limit file count and total size; clipboard output and named output files are supported.
- Global and project-specific configuration can preserve preferences and selections.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install Gptree and prepare a project context bundle
Install the CLI, then generate a text bundle from a coding project for an LLM prompt.
Before you start
- Python package installation via pipx or pip, or Homebrew.
- A coding project directory.
Steps
Install with
pipx install gptree-cli, the command below, or the documented Homebrew tap and install commands.pip install gptree-cliIn the project directory, run
gptree.To choose files interactively, run
gptree --interactive; add--include-file-types .py,.jsto filter by extension.Use
--copyto copy the result to the clipboard, or specify--output-fileto name the output file.
Expected outcome
A text output containing a directory tree and selected project file contents, ready to paste into an LLM prompt or save as a file.
Guide limitations
- Gptree prepares context but does not provide the LLM response or perform code changes.
- The documented interactive selection and filters determine which files are included.
Reuse a saved file selection
Save an interactive file selection in project configuration and reuse it for a later clipboard export.
Before you start
- Gptree installed.
- A coding project directory.
Steps
From the project directory, run
gptree --interactive --saveand make a file selection.For a later export, run
gptree --previous --copy.
Expected outcome
Gptree reuses the previously saved selection and copies the resulting project context to the clipboard.
Guide limitations
- The documented reuse flow depends on a previously saved file selection.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 13 October 2026
- Original website title
- travisvn/gptree · Official homepage title · retained in its source language

