Fast, extensible filesystem traversal and project inspection toolkit.
One engine. Multiple interfaces. Structured project intelligence.
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.
- Unified engine: All commands share the same traversal and filtering mechanisms.
- Git-aware filtering: Respect
.gitignorerules 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.
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 |
+------------------+
| 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.
| 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 |
One of the primary goals of treexx is to provide familiar filesystem exploration with automatic Git-aware filtering.
For example:
tree /fOn Windows displays the filesystem structure, including files.
The equivalent treexx command:
treex /fwill 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/
*.pycThe 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:
.gitignorepatterns.- Nested
.gitignorefiles. - Negation patterns (
!). - Directory exclusions.
- Additional configurable filtering rules.
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.
- Implement filesystem traversal.
- Define traversal result models.
- Implement filtering engine.
- Add
.gitignoresupport. - Handle filesystem errors and symbolic links.
- Establish deterministic traversal behavior.
- Implement command routing.
- Implement
tree. - Implement
ls. - Implement
find. - Implement
du. - Add JSON output.
- Ensure consistent command behavior.
- Implement project statistics.
- Add file metadata inspection.
- Implement filtering diagnostics.
- Add configurable exclusion rules.
- Project snapshots.
- Structural comparison between snapshots.
- Extended filesystem analysis.
- MCP server integration.
- AI-agent-oriented project exploration.
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.
See LICENSE.