Project Hierarchy Explorer provides commands that output a text version of your open project's hierarchy. You can output to either a file or the output console depending on your configuration. Easily share and discuss your project structure with other contributors, or give it to your favorite AI for greatly improved clarity in your prompts.
Features
Generate a full project hierarchy that includes all files and directories, excluding those specified in the ignorePatterns configuration
Generate a subtree hierarchy of just the directory you care about.
After selecting this command you will be prompted to enter the relative path to the directory you wish to use as root for this generation. See the below example for more details.
Example
Imagine we have a project with the following structure:
We wish to only display the hierarchy of the pages directory. We could use the Generate Subtree command to achieve this. Run the command, and in the prompt window enter src/pages
and the resulting output in this example would be:
pages
├─ index.js
└─ posts
└─ [slug].js
Configuration Options
All configurations are prepended with project-hierarchy-explorer, for example:
project-hierarchy-explorer.ignorePatterns
Configurations
ignorePatterns
The ignorePatterns setting can be added to your workspace or user settings to ignore specific files or directories when generating the project hierarchy. It uses the glob pattern syntax.
This can be very powerful when used for validation with something like ChatGPT.
Note:
If you plan to run the Generate Subtree command as a task, you will need to supply the relativePath parameter in your tasks.json instead of relying on the input popup. Use the below example as a reference: