Skip to main content

treex

Git-aware directory tree utility

Command-line directory tree utility with metadata and Git ignore support.


About

treex recursively scans a directory and displays its contents as a tree, including file and directory metadata. It respects .gitignore rules inside Git repositories and provides additional options for filtering and customizing the output.

Features

  • Respects .gitignore rules inside Git repositories
  • Displays human-readable file sizes
  • Displays recursive directory sizes
  • Displays line counts for text files
  • Identifies binary and unreadable files by type
  • Optionally displays modification timestamps
  • Optionally includes or excludes paths using glob patterns
  • Optionally includes or excludes paths using regular expressions
  • Optionally limits the depth of the displayed tree

Status

Latest Version
Tests
Supported Python Versions

Requirements

  • Python 3.13+
  • UTF-8-compatible terminal

Installation

Install treex from PyPI using your preferred Python package manager:

  • pip: pip install treex-cli
  • pipx: pipx install treex-cli
  • uv: uv tool install treex-cli

Prebuilt wheels are available for common platforms. See Platform Support for details.


Git ignore support

treex uses Gitoxide (gix), a native Rust implementation of Git functionality, to evaluate .gitignore rules without invoking the Git executable. Git does not need to be installed for ignore matching to work.

When the specified directory is inside a Git working tree, treex respects applicable .gitignore rules by default. Outside a Git working tree, Git ignore filtering is disabled. Use --all to include files ignored by Git.


Usage

usage: treex [-h] [-V] [-a] [-m] [-q] [-d] [-s] [-i PATTERN] [-e PATTERN]
             [-I PATTERN] [-E PATTERN] [-D DEPTH]
             [directory]

List directory contents as a tree with file and directory metadata.

positional arguments:
  directory                    directory to scan (default: current directory)

options:
  -h, --help                   show this help message and exit
  -V, --version                show version information and exit
  -a, --all                    show all files, including those ignored by Git
  -m, --modified               show file modification times
  -q, --quiet                  don't show file metadata
  -d, --dirs                   show directories only
  -s, --summary                show summary only
  -i, --include PATTERN        include paths matching a glob pattern
  -e, --exclude PATTERN        exclude paths matching a glob pattern
  -I, --include-regex PATTERN  include paths matching a regular expression
  -E, --exclude-regex PATTERN  exclude paths matching a regular expression
  -D, --depth DEPTH            limit levels displayed below starting directory

Filtering paths

Use --include and --exclude to filter paths by glob pattern:

treex --include '*.py'
treex --exclude 'tests/*.py'
treex --include '*.py' --exclude 'test_*.py'

Use --include-regex and --exclude-regex to filter paths by regular expression:

treex --include-regex '^src/'
treex --exclude-regex '(^|/)tests/'
treex --include-regex '\.py$' --exclude-regex '(^|/)test_[^/]*\.py$'

Patterns match paths relative to the starting directory, using forward slashes as separators. Matching is case-sensitive. Glob patterns use * to match any characters, including directory separators. Regular expressions use Python's regex syntax. Exclusions take precedence over inclusions.

Note: quote glob and regex patterns to prevent the shell from interpreting them before treex receives them.


Screenshot

Screenshot

Platform support

Prebuilt wheels are available for Python 3.13+ on the following platforms:

Platform Architecture
Linux (glibc) x86_64, aarch64
Linux (musl) x86_64, aarch64
macOS Apple Silicon (ARM64)
Windows 32-bit (x86), 64-bit (x86_64)

These prebuilt binary wheels let you install the treex-cli package without compiling the Rust extension yourself.

Installing on other platforms

If a prebuilt binary is not available for your platform, you can install the package from the source distribution on PyPI or directly from the source repository. This requires a Rust toolchain.

For more information about installing Rust, see the official Rust installation guide

Metadata

Release files for treex-cli 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for treex-cli 0.2.0
File Size Uploaded Provenance
treex_cli-0.2.0.tar.gz 27.9 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for treex-cli 0.2.0
File
treex_cli-0.2.0-cp313-abi3-win_amd64.whl CPython 3.13 abi3 Windows x86-64 Details
treex_cli-0.2.0-cp313-abi3-win32.whl CPython 3.13 abi3 Windows x86-32 Details
treex_cli-0.2.0-cp313-abi3-musllinux_1_2_x86_64.whl CPython 3.13 abi3 Linux musl 1.2+ x86-64 Details
treex_cli-0.2.0-cp313-abi3-musllinux_1_2_aarch64.whl CPython 3.13 abi3 Linux musl 1.2+ ARM64 Details
treex_cli-0.2.0-cp313-abi3-manylinux_2_28_x86_64.whl CPython 3.13 abi3 Linux glibc 2.28+ x86-64 Details
treex_cli-0.2.0-cp313-abi3-manylinux_2_28_aarch64.whl CPython 3.13 abi3 Linux glibc 2.28+ ARM64 Details
treex_cli-0.2.0-cp313-abi3-macosx_11_0_arm64.whl CPython 3.13 abi3 macOS 11.0+ ARM64 Details

Total release size: 7.3 MB

Release files / treex_cli-0.2.0.tar.gz

Download URL treex_cli-0.2.0.tar.gz
Size 27.9 kB
Tags Source
SHA-256 checksum
How to use checksums
03782664850c21c879f491c92acce20b9643c3cac3c4d5fbedd64c02cef9fb10
BLAKE2b-256 checksum
How to use checksums
d94145d0ed89a7725b2b69cbc1defb3b2f6a926946f4d0de0f242d68a6b02634
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / treex_cli-0.2.0-cp313-abi3-win_amd64.whl

Download URL treex_cli-0.2.0-cp313-abi3-win_amd64.whl
Size 872.5 kB
Tags CPython 3.13 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
e335d633ca3dbcdb5a46e55e0387c57ab6f30854e1705953f75abe9fa1533f32
BLAKE2b-256 checksum
How to use checksums
b757e481fa02ff28ea8c5ef81fe82de389e217a682242c4c86d59a8eaface767
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / treex_cli-0.2.0-cp313-abi3-win32.whl

Download URL treex_cli-0.2.0-cp313-abi3-win32.whl
Size 813.5 kB
Tags CPython 3.13 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
ae01b171a7622ed6ff6a17254b231bcbfd5ee93fa47e462dc703de9f07e8cac9
BLAKE2b-256 checksum
How to use checksums
556a120565c83ec6fe1a234a07298d361b792d6325572e64cc0a6ebd35dbf814
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / treex_cli-0.2.0-cp313-abi3-musllinux_1_2_x86_64.whl

Download URL treex_cli-0.2.0-cp313-abi3-musllinux_1_2_x86_64.whl
Size 1.2 MB
Tags CPython 3.13 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
7c29ef62afa430cb9308de4c603fb5b86627cee4acfcbe541bb63c18efd32d8e
BLAKE2b-256 checksum
How to use checksums
2a81039bc6aeac9cd03c5dea8d46f565e7c327d3873ca2f09a022d117132a576
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / treex_cli-0.2.0-cp313-abi3-musllinux_1_2_aarch64.whl

Download URL treex_cli-0.2.0-cp313-abi3-musllinux_1_2_aarch64.whl
Size 1.2 MB
Tags CPython 3.13 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
570bcc56e38b272407bf6a3a7017c4e58793814f67273adc2e6bdefc148bb44b
BLAKE2b-256 checksum
How to use checksums
7012ed5d9da48a401fb0e7bfed18bc9634cb22b307c36c6ed013ff9d6f40c213
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / treex_cli-0.2.0-cp313-abi3-manylinux_2_28_x86_64.whl

Download URL treex_cli-0.2.0-cp313-abi3-manylinux_2_28_x86_64.whl
Size 1.1 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
32da7380daf75f9b8a3e500a3fc32c374447b0411831857a15c523b85b0084bb
BLAKE2b-256 checksum
How to use checksums
59b04e57a65f75543dc797820b89fc23d867311c9cce81df95bfe5a3dc8862ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / treex_cli-0.2.0-cp313-abi3-manylinux_2_28_aarch64.whl

Download URL treex_cli-0.2.0-cp313-abi3-manylinux_2_28_aarch64.whl
Size 1.1 MB
Tags CPython 3.13 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
9e55746f986d35f341f94da10f334d0cc5a84a57d7497fe24dd2fb9e78460427
BLAKE2b-256 checksum
How to use checksums
d1eec97502d39bd600cd9b84627c3acd90640f991e789ee560819feb7e1d07fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / treex_cli-0.2.0-cp313-abi3-macosx_11_0_arm64.whl

Download URL treex_cli-0.2.0-cp313-abi3-macosx_11_0_arm64.whl
Size 959.0 kB
Tags CPython 3.13 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8a49cdcf3719100d365e97028eed701a2a9ba7ae1772536ad7a5734546bdde43
BLAKE2b-256 checksum
How to use checksums
011e60ff4bd3a645e94591d072b5129cde45a136e9244910865849eba5721ec0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for treex-cli 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 8 files in this release have been uploaded with provenance metadata.

Select from 8 files

Attestation for treex_cli-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page