tree
Visualize a directory structure as a compact indented tree, respecting .gitignore and optionally showing file encodings for legacy codebases.
Instructions
Compact indented tree view of directory structure. PREFER THIS for directory visualization. Skips .gitignore'd files and .git (respectGitignore=false to include). Set showEncoding=true to detect and display file encodings (e.g., for auditing legacy codebases). Parameters: path (required), maxDepth (0=unlimited), maxFiles (default 1000), dirsOnly (bool), exclude (array of patterns), showEncoding (bool, shows detected encoding per file).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| exclude | No | ||
| dirsOnly | No | ||
| maxDepth | No | ||
| maxFiles | No | ||
| showEncoding | No | ||
| respectGitignore | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tree | Yes | ||
| dirCount | Yes | ||
| fileCount | Yes | ||
| truncated | No |