Skip to content

Latest commit

Β 

History

75 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

icon DirTreeGenerator

πŸš€ DirTreeGenerator is a lightweight desktop utility to generate clean, readable directory tree structures with configurable ignore rules.

Designed for developers who want to quickly document project structures in Markdown-friendly formats.


πŸ“‹ Overview

πŸ“Œ Latest Version: v2.1.0
πŸ“Œ Supported Operating System: Windows


✨ Features

  • Generate directory trees with classic tree-style formatting
    # A small demo for the formatting
    MyProject/
    β”œβ”€β”€ src/
    β”‚ β”œβ”€β”€ main/
    β”‚ β”‚ └── java/
    β”‚ └── test/
    β”œβ”€β”€ pom.xml
    └── README.md
    
  • Blacklist / Whitelist filtering
    • Ignore unwanted files or folders
    • Or only include explicitly listed entries
  • Select only the folders you want before exporting
  • Save output to file with one click
  • Modern dark UI powered by FlatLaf

πŸ“₯ Quick Start

1️⃣ Download

πŸ‘‰ Click here to download DirTreeGenerator.

2️⃣ Installation

  1. Download the .exe file.
  2. Run it.

That's it, nothing else required. (No Java installation required, as JRE is bundled.)


🧭 How to Use

  1. Click Open Folder to choose a root directory. MainFrontend.png
  2. The directory tree will be generated and displayed. ExampleTree.png
  3. Select the directories you want to export (or de-select the unwanted ones)
  4. Click Export to export the result to a text file
  5. (Optional) Open Settings to configure:
    • Filter mode (Blacklist / Whitelist)
    • Ignore rules
    • Default expanding layers

βš™οΈ Settings & Configuration

πŸ“„ Configuration File config.json

πŸ“Œ Automatically generated at C:\Users\<username>\AppData\Roaming\DirTreePrinter on first launch.

{
  "defaultExpandedLayers":3,
  "filterMode":"BLACKLIST",
  "rules":[".idea",".git","target"],
  "modified":false
}
  • defaultExpandedLayers: how many layers of folders will be expanded by default when a tree is displayed
  • filterMode: how will the ignore rules be applied
    • BLACKLIST β†’ exclude listed names
    • WHITELIST β†’ only include listed names
  • rules: the folders or files you specify

Note

All the settings in config.json can be configured in the settings panel of DirTreePrinter app, if you really want to change the configs manually, restart the app for the changes to take effect.


πŸ› οΈ Technical Overview

Project Structure

Generated by DirTreeGenerator:

DirTreePrinter/
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ main
β”‚   β”‚   β”œβ”€β”€ java
β”‚   β”‚   β”‚   └── unimilk
β”‚   β”‚   β”‚       └── dirtreeprinter
β”‚   β”‚   β”‚           β”œβ”€β”€ api
β”‚   β”‚   β”‚           β”‚   β”œβ”€β”€ settings
β”‚   β”‚   β”‚           β”‚   β”‚   β”œβ”€β”€ FilterMode.java
β”‚   β”‚   β”‚           β”‚   β”‚   β”œβ”€β”€ ISettings.java
β”‚   β”‚   β”‚           β”‚   β”‚   └── ISettingsManager.java
β”‚   β”‚   β”‚           β”‚   └── tree
β”‚   β”‚   β”‚           β”‚       β”œβ”€β”€ IDirTreeGenerator.java
β”‚   β”‚   β”‚           β”‚       β”œβ”€β”€ ITreeRenderer.java
β”‚   β”‚   β”‚           β”‚       └── TreeNode.java
β”‚   β”‚   β”‚           β”œβ”€β”€ backend
β”‚   β”‚   β”‚           β”‚   β”œβ”€β”€ settings
β”‚   β”‚   β”‚           β”‚   β”‚   β”œβ”€β”€ JsonSettingsManager.java
β”‚   β”‚   β”‚           β”‚   β”‚   β”œβ”€β”€ Settings.java
β”‚   β”‚   β”‚           β”‚   β”‚   └── YamlSettingsManager.java
β”‚   β”‚   β”‚           β”‚   β”œβ”€β”€ tree
β”‚   β”‚   β”‚           β”‚   β”‚   β”œβ”€β”€ DirTreeGenerator.java
β”‚   β”‚   β”‚           β”‚   β”‚   └── TreeRenderer.java
β”‚   β”‚   β”‚           β”‚   └── AppPaths.java
β”‚   β”‚   β”‚           β”œβ”€β”€ frontend
β”‚   β”‚   β”‚           β”‚   β”œβ”€β”€ export
β”‚   β”‚   β”‚           β”‚   β”‚   β”œβ”€β”€ ExportDialog.java
β”‚   β”‚   β”‚           β”‚   β”‚   └── ExportPreviewDialog.java
β”‚   β”‚   β”‚           β”‚   β”œβ”€β”€ settings
β”‚   β”‚   β”‚           β”‚   β”‚   β”œβ”€β”€ GeneralCard.java
β”‚   β”‚   β”‚           β”‚   β”‚   β”œβ”€β”€ IgnoreRulesCard.java
β”‚   β”‚   β”‚           β”‚   β”‚   β”œβ”€β”€ ListReorderTransferHandler.java
β”‚   β”‚   β”‚           β”‚   β”‚   β”œβ”€β”€ SettingsCards.java
β”‚   β”‚   β”‚           β”‚   β”‚   └── SettingsDialog.java
β”‚   β”‚   β”‚           β”‚   β”œβ”€β”€ tree
β”‚   β”‚   β”‚           β”‚   β”‚   β”œβ”€β”€ CheckBoxTreeCellEditor.java
β”‚   β”‚   β”‚           β”‚   β”‚   β”œβ”€β”€ CheckBoxTreeCellRenderer.java
β”‚   β”‚   β”‚           β”‚   β”‚   β”œβ”€β”€ TreeCellClickListener.java
β”‚   β”‚   β”‚           β”‚   β”‚   └── TreeDisplay.java
β”‚   β”‚   β”‚           β”‚   β”œβ”€β”€ worker
β”‚   β”‚   β”‚           β”‚   β”‚   └── ScanWorker.java
β”‚   β”‚   β”‚           β”‚   β”œβ”€β”€ LoadingOverlayPanel.java
β”‚   β”‚   β”‚           β”‚   β”œβ”€β”€ MainFrontend.java
β”‚   β”‚   β”‚           β”‚   └── RightClickMenu.java
β”‚   β”‚   β”‚           └── DirTreeApp.java
β”‚   β”‚   └── resources
β”‚   β”‚       β”œβ”€β”€ icons
β”‚   β”‚       β”‚   β”œβ”€β”€ icon.ico
β”‚   β”‚       β”‚   β”œβ”€β”€ icon16.png
β”‚   β”‚       β”‚   β”œβ”€β”€ icon32.png
β”‚   β”‚       β”‚   β”œβ”€β”€ icon48.png
β”‚   β”‚       β”‚   └── icon64.png
β”‚   β”‚       └── config.yml
β”‚   └── test
β”‚       └── java
β”‚           └── unimilk
β”‚               └── dirtreeprinter
β”‚                   β”œβ”€β”€ backend
β”‚                   β”‚   └── settings
β”‚                   β”‚       β”œβ”€β”€ JsonSettingsManagerTest.java
β”‚                   β”‚       └── SettingsTest.java
β”‚                   └── frontend
β”‚                       └── tree
β”‚                           └── CheckBoxTreeCellRendererTest.java
β”œβ”€β”€ .gitignore
β”œβ”€β”€ CHANGELOG.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ pom.xml
└── README.md

Technical Stack

  • Java
  • Swing
  • FlatLaf
  • Gson
  • Maven
  • exe4j

πŸ“¦ Build From Source

1. Clone the Repo

git clone https://github.com/X-xiaohan521/DirTreePrinter.git

2. Buid Using Maven

mvn clean package

The executable JAR will be generated in: target/


πŸ“œ Changelog

πŸ“Œ Only the latest version is listed here. See CHANGELOG.md for older versions.

[2.1.0] - 2026-02-09

πŸ†• What's New

  • Added a loading animation when scanning folders.
  • Added a right-click menu to send folders to ignore rules or open them in file explorer.
  • Added a Rescan button to rescan the root folder.
  • Added a default expanded layers setting for the tree display.

🌟 Improvements

  • Polished overall UI/UX experience.
  • Enabled drag-to-reorder for ignore rules.

πŸ›  Bugfixes

  • Fixed frontend freezing during folder scanning tasks.

πŸ’‘ Contributing

Want to help improve this software? Submit an Issue or Pull Request via GitHub.


πŸ“œ License

This plugin is released under the MIT license.

MIT License

Copyright (c) 2026 UniMilk

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.


πŸ“ž Contact Me

πŸ“§ Email: unimilk891@gmail.com

🌐 GitHub: X-xiaohan521


⭐ Final Words

Thank you for using DirTreeGenerator!

If you find this tool helpful, please star ⭐ ths repository or leave your feedback β€” your support means a lot to me! πŸš€

About

DirTreeGenerator is a lightweight desktop utility to generate clean, readable directory tree structures with configurable ignore rules.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages