.treeignore is a configuration file format for tree-it, a CLI tool that generates visual directory trees for documentation and project visualization.

A .treeignore file lets you control what appears in your project trees by defining exclusion rules, reusable profiles, and configuration tags — all from a single file placed in your project root.

Quick Start

Create a .treeignore file in your project root:

node_modules/
dist/
.git/
/target
 
tree_docs = [
    "tests/",
    "benches/"
]
 
tree_public = [
    "internal/",
    ".env"
]

Then run tree-it:

# generates the general tree + all profile trees
tree-it
 
# generates only the tree_docs profile
tree-it --profile tree_docs

Documentation

SectionDescription
formatComplete file format specification
matchingPattern matching rules and examples
profilesProfile system reference
resolutionIgnore file resolution strategy
tagsTag system reference

How It Works

.treeignore serves two purposes:

  1. Ignore file — lines outside variable assignments are exclusion patterns that apply to every tree.
  2. Configuration source — variable assignments define profiles and tags that control how different tree views are generated.

When tree-it runs, it looks for .treeignore in the target directory. If found, it uses it as the sole configuration source (.gitignore is ignored). If .treeignore is absent, tree-it falls back to .gitignore for exclusion rules only. If neither file exists, the full directory tree is generated.

Current Status

The .treeignore format is at v0.1 and is consumed by tree-it (MVP).

Stable in v0.1: global exclusion patterns, profile definitions, root-anchored matching, pattern matching (documented subset), ignore file resolution priority.

Parsed but not yet applied: global tags, profile tags, tag precedence behavior.

Planned: negation patterns (!pattern), extended matching semantics, additional tag options.