Skip to content

Latest commit

 

History

History
269 lines (214 loc) · 7.65 KB

README.md

File metadata and controls

269 lines (214 loc) · 7.65 KB

treexx

treexx logo

Fast, extensible filesystem traversal and project inspection toolkit.

One engine. Multiple interfaces. Structured project intelligence.


Overview

treexx is a filesystem traversal and project inspection toolkit designed for developers and automated development tools.

It provides a unified engine for exploring filesystem structures, discovering files, applying filtering rules, collecting metadata, and presenting structured results.

The initial focus is a fast and reliable CLI with native .gitignore support. The architecture is designed to support additional interfaces, including MCP integrations for AI agents and development environments.

Core principles

  • Unified engine: All commands share the same traversal and filtering mechanisms.
  • Git-aware filtering: Respect .gitignore rules instead of relying on manually maintained exclusion lists.
  • Composable architecture: Separate filesystem traversal, filtering, application logic, and output formatting.
  • Multiple output formats: Human-readable terminal output and structured machine-readable data.
  • Extensibility: Support additional commands and interfaces without duplicating core functionality.

Architecture

treexx follows a layered architecture that separates user interfaces, application workflows, core filesystem operations, and output formatting.

                         CLI
                          |
                          v
                 +------------------+
                 |   Query Router   |
                 +--------+---------+
                          |
                          v
                 +------------------+
                 |  Application     |
                 |                  |
                 |  Use Cases       |
                 |  ls / tree       |
                 |  find / du       |
                 |  stats           |
                 +--------+---------+
                          |
                          v
                 +------------------+
                 |   Core Engine    |
                 |                  |
                 | +--------------+ |
                 | | Traversal    | |
                 | +--------------+ |
                 |                  |
                 | +--------------+ |
                 | | Filtering    | |
                 | +--------------+ |
                 +--------+---------+
                          |
                          v
                 +------------------+
                 |   Filesystem     |
                 +------------------+
                          |
                          v
                 +------------------+
                 | Output Strategies|
                 |                  |
                 | tree / ls / json |
                 +------------------+

Architectural components

Component Responsibility
CLI Command-line interface and argument parsing
Query Router Routes user commands to application workflows
Application Coordinates individual use cases
Traversal Recursively discovers filesystem entries
Filtering Applies .gitignore and other exclusion rules
Filesystem Provides filesystem access
Output Formats results for terminal and machine consumption

The core engine is independent of the CLI. This allows future interfaces, such as MCP, to reuse the same application workflows and filesystem capabilities.

Features

Planned functionality

Feature Description Status
Tree Recursive directory and file visualization Planned
Gitignore Git-compatible exclusion rules Planned
LS Directory listing Planned
Find Filesystem search Planned
DU Disk usage analysis Planned
Stats Project structure statistics Planned
JSON Structured machine-readable output Planned
Snapshots Save and compare project structures Future
MCP Integration with AI agents and IDEs Future

Git-aware traversal

One of the primary goals of treexx is to provide familiar filesystem exploration with automatic Git-aware filtering.

For example:

tree /f

On Windows displays the filesystem structure, including files.

The equivalent treexx command:

treex /f

will provide the same general functionality while respecting .gitignore.

Example project:

project/
├── app/
│   ├── main.py
│   └── config.py
├── tests/
│   └── test_main.py
├── .venv/
├── __pycache__/
├── node_modules/
├── dist/
├── .git/
├── .gitignore
└── pyproject.toml

With the following .gitignore:

.venv/
__pycache__/
node_modules/
dist/
.git/
*.pyc

The expected output:

project
├── app
│   ├── config.py
│   └── main.py
├── tests
│   └── test_main.py
├── .gitignore
└── pyproject.toml

Filtering is handled by a dedicated component rather than being embedded into the traversal implementation.

The filtering system is intended to support:

  • .gitignore patterns.
  • Nested .gitignore files.
  • Negation patterns (!).
  • Directory exclusions.
  • Additional configurable filtering rules.

Project structure

The initial project structure is intentionally minimal.

treexx/
├── src/
│   └── treexx/
│       ├── application/
│       │   ├── dto/
│       │   └── use_cases/
│       │
│       ├── core/
│       │   ├── traversal/
│       │   └── filtering/
│       │
│       ├── cli/
│       │
│       └── output/
│
├── tests/
│   ├── fixtures/
│   ├── integration/
│   └── unit/
│
├── assets/
├── pyproject.toml
├── README.md
└── LICENSE

Additional components will be introduced as the functionality grows.

Development roadmap

Phase 1 — Core foundation

  • Implement filesystem traversal.
  • Define traversal result models.
  • Implement filtering engine.
  • Add .gitignore support.
  • Handle filesystem errors and symbolic links.
  • Establish deterministic traversal behavior.

Phase 2 — CLI

  • Implement command routing.
  • Implement tree.
  • Implement ls.
  • Implement find.
  • Implement du.
  • Add JSON output.
  • Ensure consistent command behavior.

Phase 3 — Project inspection

  • Implement project statistics.
  • Add file metadata inspection.
  • Implement filtering diagnostics.
  • Add configurable exclusion rules.

Phase 4 — Advanced capabilities

  • Project snapshots.
  • Structural comparison between snapshots.
  • Extended filesystem analysis.
  • MCP server integration.
  • AI-agent-oriented project exploration.

Design philosophy

treexx is built around a few engineering principles:

  • KISS: Keep the architecture simple and understandable.
  • SOLID: Maintain clear responsibilities and component boundaries.
  • DRY: Reuse traversal, filtering, and output mechanisms.
  • YAGNI: Implement capabilities when they are needed, not merely because they might be useful.
  • Separation of concerns: Keep interfaces independent from core functionality.
  • Determinism: Produce predictable results for reproducible workflows.

The goal is not to build another collection of filesystem commands, but to create a reusable engine that can power multiple tools and interfaces.

License

See LICENSE.