rrt tree
rrt tree
Section titled “rrt tree”Render a project tree with gitignore-aware filtering.
Overview
Section titled “Overview”rrt tree prints a repository or directory tree suitable for terminal review,
docs snippets, and quick project orientation.
The command is read-only and intentionally deterministic:
- stable ordering (directories first, then files)
- optional depth limiting for large repositories
- optional hidden-file inclusion
- optional directories-only mode
Ignore behavior
Section titled “Ignore behavior”When the selected root is inside a Git repository, ignore checks use Git’s own
exclude engine via git check-ignore, so matching follows active repository
rules and precedence semantics.
When the root is not in a Git worktree, the command falls back to a conservative
local skip list for well-known transient directories (for example .git,
node_modules, .venv) while still honoring explicit CLI flags.
Output formats
Section titled “Output formats”classic(default): platform-aware tree connectors throughGLYPHS.treeascii: forced ASCII connectors for paste-safe logs or legacy terminalsmarkdown: nested bullet output for Markdown docs and issue commentsrich: Rich tree rendering when the optional package is installed; falls back toclassicwith a warning when Rich is unavailable
Common options
Section titled “Common options”--root PATHselects the traversal root--max-depth Nlimits recursion depth (unlimited by default)--dirs-onlysuppresses files--show-hiddenincludes dotfiles and dot-directories
Failure behavior
Section titled “Failure behavior”The command exits non-zero when:
- the root path does not exist
- the root path is not a directory
Unreadable subdirectories are reported as warnings and do not fail the command.
Examples
Section titled “Examples”rrt treerrt tree --format asciirrt tree --format markdown --max-depth 3rrt tree --root src/repo_release_tools --dirs-onlyrrt tree --format markdown --inject README.md --anchor project-treerrt tree --format markdown --inject README.md --anchor project-tree --dry-runEmbedding a tree into a Markdown file
Section titled “Embedding a tree into a Markdown file”Use --inject and --anchor to automatically update a block inside any
Markdown document without touching the surrounding prose.
Step 1 — add anchor markers once (HTML comments, invisible when rendered):
## Project layout
Some intro text above — preserved on every run.
<!-- rrt:auto:start:project-tree --><!-- rrt:auto:end:project-tree -->
Some text below — also preserved.Step 2 — run rrt tree with --inject:
rrt tree --format markdown --inject README.md --anchor project-treeOnly the content between the markers is replaced; everything else in the file stays untouched.
Anchor ID rules
Section titled “Anchor ID rules”An anchor ID must start with an ASCII letter or digit followed by any combination of ASCII letters, digits, dots, underscores, or hyphens.
Valid examples: project-tree, src.layout, tree_v2
Caveats
Section titled “Caveats”- Symlinked directories are listed but not recursively traversed.
- The root itself is not printed as a tree node; output begins with its children.
- Rich formatting is optional and never required for baseline output.
Related docs
Section titled “Related docs”Badge families are intentionally complete for the current icon registry across platform, registry, and language labels; see src/repo_release_tools/tools/platform.py if you think one is missing.
Chat is powered by Context7, a third-party service with its own terms and privacy policy.