Skip to main content

A Rich + Typer powered tree viewer that summarizes directories when they get busy.

Project description

ttree 🍵-🌳

ttree is an alternative to tree that keeps directory browsing readable, summarizing noisy folders, colorizing output, and optionally hiding dotfiles.

Features

  • Renders a hierarchical tree with coloring for directories, files, and summaries.
  • Crowded directories are collapsed: file clusters become summaries like 5 py, 3 md files and subdirectories collapse to N directories.
  • Dotfiles stay hidden unless you opt in with -a/--all.
  • Need plain output for CI logs? pass --no-color or set NO_COLOR=1.
  • A live progress spinner appears when scanning large trees on a TTY.

Installation

Requires Python 3.11+.

With uv:

uv tool install tea-tree

With pip:

pip install tea-tree

For local development, install via uv:

uv sync --extra dev

or use pip install -e .[dev]. After installation the ttree console script is available on your PATH.

Usage

ttree [DIRECTORY] [OPTIONS]

Common examples:

# summarize files once there are more than 2 siblings
ttree ~/Developer -m 2

# include dotfiles and show fewer subdirectories before collapsing
ttree src -a -d 5

# print version information immediately
ttree -V

During development, uv run ttree -- --help or python -m ttree behave the same without installing the entry point.

Key options

  • DIRECTORY (default .): root folder to inspect.
  • -m, --max-files-to-list: maximum files to display individually before summarizing. Set to 0 to always show summaries.
  • -d, --max-dirs-to-list: maximum subdirectories to list before using N directories. Set to 0 to only emit counts.
  • -a, --all: include entries starting with ..
  • --no-color: disable Rich colors (equivalent to exporting NO_COLOR=1).

Example Output

$ ttree demo -m 2 -d 3
demo
├── api
│   ├── handlers
│   └── models
├── docs
│   └── 3 directories
├── scripts
│   └── 4 py, 1 sh files
└── tests
    ├── unit
    └── 5 directories

The actual CLI uses color and dimmed summaries via Rich; the example above shows the structure you can expect.

WIP, mostly written by GPT-5-Codex

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tea_tree-0.1.4.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tea_tree-0.1.4-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file tea_tree-0.1.4.tar.gz.

File metadata

  • Download URL: tea_tree-0.1.4.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for tea_tree-0.1.4.tar.gz
Algorithm Hash digest
SHA256 df461696645b9cfedc833bf01e79f4e8ea2cf6969a634c71b2938b5e50076aed
MD5 327d9fb0297eacb0d786f41d17bdf7d0
BLAKE2b-256 79e71e2a0e9b2c880b81f870d8f63019e3f27a5168077eb06f121966e439fae7

See more details on using hashes here.

File details

Details for the file tea_tree-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: tea_tree-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for tea_tree-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8ff5a35f55cd60e3a85cbb6c232af5d20e027612458f509981b7f6b57c26a991
MD5 d770d6c24aa9fa3511a84bce85aeb3e4
BLAKE2b-256 99611a2fe64791aac7e43e1fe98ef044e210b7938db842ad819939c1db79b14e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page