🌳 CodeTree
A powerful and flexible VS Code extension + CLI tool to generate directory trees in a clean, readable ASCII format.
Perfect for documentation, README files, debugging project structures, or just visualizing your folders.
✨ Features
- 📁 Generate directory trees instantly
- ⚡ Works directly inside VS Code
- 🧠 Smart Quick Pick interface (choose what to do with the output)
- 📋 Copy tree to clipboard
- 📄 Open tree in a new editor tab
- 💾 Save tree as a
.txt file
- 🎯 Right-click any folder in the Explorer to generate a tree
- ⚙️ Fully configurable via
settings.json
- 🖥️ CLI support for terminal usage
🚀 Usage (VS Code)
🔹 Command Palette
Press:
Ctrl + Shift + P
Search for:
Generate Tree
Then choose what you want to do:
- 📄 Open in editor
- 📋 Copy to clipboard
- 💾 Save as file
🔹 Right-click (Explorer)
- Right-click any folder
- Click:
Generate Tree
- Choose your desired output
🧪 Example Output
📁 project/
├── 📄 index.js
├── 📁 src/
│ ├── 📄 app.js
│ └── 📄 utils.js
└── 📄 package.json
⚙️ Configuration
You can customize behavior via your VS Code settings.json:
{
"generateTree.useEmoji": true,
"generateTree.showFileSize": false,
"generateTree.maxDepth": 5,
"generateTree.useGitignore": true,
"generateTree.ignore": ["dist", "build"]
}
🖥️ CLI Usage
You can also use it in the terminal:
code-tree
Example with flags:
code-tree --max-depth 2 --no-emoji
🧠 How It Works
This project is built with a modular architecture:
- Core → tree generation engine
- CLI → terminal interface
- VS Code Extension → editor integration
This allows maximum flexibility and scalability.
📦 Installation
From VS Code Marketplace
(Coming soon)
Local Installation
npm install -g code-ascii-tree-generator
🛠️ Development
pnpm install
pnpm run build
Run extension:
F5 (inside VS Code)
📌 Roadmap
- 🌐 Interactive tree view (WebView)
- 🎨 Themed / styled output
- 📄 Export to Markdown / JSON
- 🔍 Search & filter tree
- ⚡ Performance optimizations for large projects
🤝 Contributing
Feel free to open issues or submit pull requests!
📄 License
MIT
⭐ Support
If you like this project, consider giving it a star on GitHub!