- Visualise & export the file/directory structure of your current workspace in one click
- Automatic file structure generation using
Watch Mode - Current version : 1.0.0
- NestGen: Generate File Structure
- NestGen: Toggle Watch Mode
- 📁 Generate directory tree for any workspace or folder
- 📝 Export structure to file (
.txt,.md, or.json) - 📋 Copy generated tree to clipboard
- ⚙️ Configurable maximum depth for traversal
- 📂 Respects
.gitignorerules - 🚫 Automatically excludes
.gitdirectories - 🔠 Alphabetically sorts files & folders
- 🖱️ Status bar button for one-click generation
- 👀 In-editor preview with silent live updates
- 🔄 Watch Mode to auto-regenerate on file changes
- ⏱️ Debounced filesystem watching for performance
- ♻️ Watch state persists across reloads
- 🧩 Multi-root workspace support
- 📦 Multiple output formats (Plain Text, Markdown, JSON)
- 🔌 Public API for other extensions & tools
- 🚀 Async filesystem traversal for large workspaces
- No external dependencies
- Works out-of-the-box with VS Code
1.102.0 and above
- VSCode Marketplace: Search for "NestGen" in the VSCode Extensions Marketplace
- Install: Click on "Install" to add NestGen to your VSCode setup
- Reload: Reload VSCode to activate NestGen
This extension contributes the following setting:
nestgen.maxDepth: (number) Maximum depth for tree generation- Default is
10
- Default is
fileStructureGenerator.watchMode: (boolean)- Automatically regenerate file structure when files change
- Default:
false
NestGen exposes a public API that allows other VS Code extensions to generate a file/directory tree programmatically
const nestgen = vscode.extensions.getExtension("eshansud.nestgen");
if (nestgen) {
await nestgen.activate();
const { generateTree } = nestgen.exports;
const tree = await generateTree("/absolute/path/to/workspace", {
maxDepth: 5,
format: "text", // "text" | "md" | "json"
});
console.log(tree);
}- Parameters
| Name | Type | Description |
|---|---|---|
rootPath |
string |
Absolute path to the directory to scan |
options.maxDepth |
number |
Maximum traversal depth |
options.format |
"text" | "md" | "json" |
Output format |
- Returns
Promise<string>;- Clipboard copy might not work in some remote/SSH VS Code contexts
- Very large workspaces may take longer to generate the initial tree
- See CHANGELOG.md for a complete list of changes
- Suggestions, issues, & contributions are welcome!
We value your feedback! If you encounter any issues or have suggestions for improvement, please don't hesitate to file an issue on our GitHub repository.
Enjoy!