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 Git's ignore rules 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

After installation, the treex command is available on your PATH.

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, 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

$ treex --help
usage: treex [OPTIONS] [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.


Demo

Demo


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.6

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.6
File Size Uploaded Provenance Actions
treex_cli-0.2.6.tar.gz 28.4 kB With provenance Details for treex_cli-0.2.6.tar.gz

Built distributions (wheels)

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

Total release size: 7.5 MB

Release files / treex_cli-0.2.6.tar.gz

Download URL treex_cli-0.2.6.tar.gz
Size 28.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bf7ec45b9f3754656e4562d3553c4242b7c1f4e514069992b654a252e48c6b91
BLAKE2b-256 checksum
How to use checksums
9403103cf601f0c31b28e100f998de1616ee91e801184e8f845c210503994685
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 Nov 22, 2026.

Transparency log

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

Download URL treex_cli-0.2.6-cp313-abi3-win_amd64.whl
Size 916.2 kB
Tags CPython 3.13 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
96c2f2006c04a05c84c54ac4a34d1e7073acc05477250d7fb472a4d0e2485039
BLAKE2b-256 checksum
How to use checksums
5024c4ca3f1bd18d06113a91ca61fdb26e204d01702d7529ef62f92377323d6e
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 Nov 22, 2026.

Transparency log

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

Download URL treex_cli-0.2.6-cp313-abi3-win32.whl
Size 849.9 kB
Tags CPython 3.13 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
089002ded741ee2265030987601e19d50adcc7a81b1996f9071d0dd5c1a5725e
BLAKE2b-256 checksum
How to use checksums
45799ea913e791d35096e71bdf6beaacb044bb2eb1aef77dc01753fa39ef910b
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 Nov 22, 2026.

Transparency log

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

Download URL treex_cli-0.2.6-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
0b8a30a5012672b36eb84adbcd6549fa04f995fc2c6da76ceb6aec3bf0e6ba85
BLAKE2b-256 checksum
How to use checksums
fceb203853f28f08eb9dd4e82cf457bbfeac947944f8a7ebc8f26c351df189f4
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 Nov 22, 2026.

Transparency log

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

Download URL treex_cli-0.2.6-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
9586458f6146d64fafcd817210735ede7efe5b20c378efd50d3493bcfdfdbf90
BLAKE2b-256 checksum
How to use checksums
709ece82d488c797ea2171c6cb5921d5c836485f314cae147412d77a53813c49
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 Nov 22, 2026.

Transparency log

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

Download URL treex_cli-0.2.6-cp313-abi3-manylinux_2_28_x86_64.whl
Size 1.2 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
ca0a7d58ee70f7d7a496bc03a9236b2e7342f307278b8a94c14a0a3ea392cd25
BLAKE2b-256 checksum
How to use checksums
6104fc424b46deafc64717b0846a90810f93db0b260011167bccc1e1375f00ec
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 Nov 22, 2026.

Transparency log

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

Download URL treex_cli-0.2.6-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
b25048a1379924367a92d9ccd804913603c1bf0ac47416b1986c2fd386e6c1c3
BLAKE2b-256 checksum
How to use checksums
d1e4cff5646c1ba5fa74280c9ed603f058ec65a0c122cb505bcbdd882849b870
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 Nov 22, 2026.

Transparency log

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

Download URL treex_cli-0.2.6-cp313-abi3-macosx_11_0_arm64.whl
Size 970.3 kB
Tags CPython 3.13 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4476563336855b10bc03e13d87fb4462f58667551795c6a6054fb083575f54b1
BLAKE2b-256 checksum
How to use checksums
861aaf590fa30e7aa527f4e6e1323e64a31227ef0e97c894a9d0ee6dbdfda764
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 Nov 22, 2026.

Transparency log

Security for treex-cli 0.2.6

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.6.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 Nov 22, 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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