OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

Gptree

Gptree is a Python command-line utility that combines a coding project’s directory tree and selected file contents into a text output for use as context in LLM prompts. It supports interactive selection, file-extension filters, glob patterns, saved selections, output files and clipboard copying.

Independent OpenViST project profile, based on linked sources.

Gptree — OpenViST project profile in AI Developer Tools & SDKs.
OpenViST project illustration. See the linked sources for product details.
Understand the project

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.
Before you choose

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.

Source-based practical guide

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

  1. Install with pipx install gptree-cli, the command below, or the documented Homebrew tap and install commands.

    Documented command
    pip install gptree-cli
  2. In the project directory, run gptree.

  3. To choose files interactively, run gptree --interactive; add --include-file-types .py,.js to filter by extension.

  4. Use --copy to copy the result to the clipboard, or specify --output-file to 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.
Source-based practical guide

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

  1. From the project directory, run gptree --interactive --save and make a file selection.

  2. 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.
Evidence and transparency

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