project-tree-md
v3.3.3
Published
Enterprise codebase intelligence, directory tree generator & 2D/3D code visualizer suite. Generates interactive Code Relationship Graphs, Mind Maps, Markdown, JSON, HTML, SVG, Mermaid, and ZIP bundles. Zero dependencies. Node.js 20+.
Downloads
2,211
Maintainers
Keywords
Readme
🔥 Key Features & Capabilities
- 🌐 Interactive 2D & 3D Code Graph: Explore codebase imports, exports, and module relationships with 3D WebGL spatial sphere and flat 2D canvas (
ptree --visualize). - 🧠 Interactive Horizontal Mind Map: Auto-layout node hierarchy with curved Bezier connectors, pan/zoom, and live JSON data editor (
ptree --mindmap). - 📁 Dedicated Output File Names: Every command writes to its own task-specific file to prevent overwriting (
GIT_STATUS_TREE.md,CHANGED_FILES_TREE.md,SORTED_TREE.md,PROJECT_DUPLICATES.md,DEPTH_TREE.md, etc.). - 🌿 Git Integration & Changed Files Filter: Highlight modified, added, and untracked files (
[Modified],[Added],[Untracked]) or filter tree to changed files only (ptree --git-status,ptree --changed-only). - 🔍 Duplicate File Analyzer: Detect and report duplicate files across the repository (
ptree --duplicates). - 📏 Lines of Code & File Size Details: Inspect line counts, byte sizes, permissions, and OS owner for every file (
ptree --details,ptree --permissions,ptree --owner). - 📦 ZIP Bundle Generator & Multi-Format Exporter: Package all visual and structured reports into a single ZIP archive (
ptree --bundle). - ⚡ Zero Dependencies: 100% pure Node.js standard library with lightning-fast execution.
🚀 Quick Start (No Install Required)
Run directly in any project directory with npx:
| Feature / Command | Command | Dedicated Output File |
| :--- | :--- | :--- |
| 📄 Markdown Tree (Default) | npx ptree | PROJECT_STRUCTURE.md |
| 🌐 2D/3D Code Relationship Graph | npx ptree --visualize | CODE_GRAPH.html (auto-opens) |
| 🧠 Interactive Mind Map | npx ptree --mindmap | PROJECT_MINDMAP.html (auto-opens) |
| 📏 Lines of Code & File Size | npx ptree --details | FORMATTED_TREE.md |
| 🌿 Git Status Badges | npx ptree --git-status | GIT_STATUS_TREE.md |
| 🔄 Changed Files Only | npx ptree --changed-only | CHANGED_FILES_TREE.md |
| 📋 Duplicate File Finder | npx ptree --duplicates | PROJECT_DUPLICATES.md |
| 🔀 Sorted Tree | npx ptree --sort size | SORTED_TREE.md |
| 🏷️ File Attributes | npx ptree --modified --permissions | FILE_ATTRIBUTES.md |
| 📊 Terminal Analytics Dashboard | npx ptree --dashboard | (Terminal Stdout Report) |
| 📦 ZIP Package Bundle | npx ptree --bundle | project-analysis.zip |
🌐 2D & 3D Code Architecture Graph (--visualize)
Transform any codebase into dynamic, interactive 2D canvas & 3D WebGL graphs showing complete architecture, dependency graphs, state flows, hooks, models, and service relationships:
npx ptree --visualize🧠 Interactive Horizontal Mind Map (--mindmap)
Transform your codebase into a clean, horizontal node-based interactive Mind Map (PROJECT_MINDMAP.html) with Bezier line connectors and live node editing:
npx ptree --mindmap📁 Dedicated Task Outputs & Export System
Every option flag automatically outputs to a dedicated unique filename to ensure your reports never overwrite each other:
# Line counts and file sizes
npx ptree --details # -> FORMATTED_TREE.md
# Git status badges
npx ptree --git-status # -> GIT_STATUS_TREE.md
# Filter to changed files only
npx ptree --changed-only # -> CHANGED_FILES_TREE.md
# Duplicate files analysis
npx ptree --duplicates # -> PROJECT_DUPLICATES.md
# Depth limit tree
npx ptree --depth 2 # -> DEPTH_TREE.md
# Custom exclude pattern
npx ptree --exclude "assets" # -> FILTERED_TREE.md📊 Competitor Comparison Matrix
| Capability / Feature | project-tree-md | tree-cli | tree-node-cli | OS tree |
| :--- | :---: | :---: | :---: | :---: |
| Zero External Dependencies | ✅ 0 Dependencies | ❌ 10+ Dependencies | ❌ Multiple | ⚠️ OS Dependent |
| 2D / 3D WebGL Code Graph | ✅ Yes (--visualize) | ❌ No | ❌ No | ❌ No |
| Interactive Bezier Mind Map | ✅ Yes (--mindmap) | ❌ No | ❌ No | ❌ No |
| Multi-Format Export (JSON, SVG, ZIP)| ✅ 9+ Formats | ❌ Text Only | ❌ Text Only | ❌ Text Only |
| Duplicate File Detection | ✅ Yes (--duplicates) | ❌ No | ❌ No | ❌ No |
| Git Status Badges (--git-status)| ✅ Built-in | ❌ No | ❌ No | ❌ No |
| Dedicated Output Filenames | ✅ No Overwriting | ❌ Overwrites | ❌ Overwrites | ❌ Overwrites |
| Execution Speed (10k files) | ⚡ < 500ms | 🐢 ~1.8s | 🐢 ~1.5s | ⚡ ~600ms |
❓ Frequently Asked Questions (FAQ)
Simply open your terminal in your project directory and run:
npx project-tree-mdThis scans your project and generates a clean, GitHub-ready PROJECT_STRUCTURE.md file formatted with emoji or unicode tree connectors and file stats.
Run:
npx ptree --duplicatesThis inspects files across your workspace and exports a clean deduplication summary to PROJECT_DUPLICATES.md.
Unlike the standard operating system tree utility, project-tree-md requires zero system-level installation, automatically respects .gitignore and sensitive file lists, provides 2D/3D WebGL code relationship visualizers, interactive mind maps, Git status indicators, and outputs to dedicated Markdown, JSON, SVG, and HTML files.
Run:
npx ptree --visualizeThis automatically parses your import/export dependency graph and opens CODE_GRAPH.html in your default browser featuring 2D Canvas force-directed layouts and 3D WebGL spatial sphere representations.
No! project-tree-md has zero third-party npm dependencies and uses 100% pure Node.js standard libraries. You can run it instantly using npx project-tree-md or npx ptree without installing anything globally.
⚙️ Configuration File (project-tree.config.json)
Customize behavior globally or per-project using a project-tree.config.json file in your root folder:
{
"theme": "emoji",
"details": true,
"respectIgnore": true,
"exclude": "dist|build|coverage",
"maxDepth": 5
}💻 Programmatic API
Use project-tree-md inside your Node.js scripts and workflows:
const { generateTree, scan, computeStats, generateUniversalGraph, toMindmapHtml } = require('project-tree-md');
// Generate complete project markdown
const result = generateTree({
rootDir: process.cwd(),
details: true,
theme: 'emoji'
});
console.log(result.markdown);📄 License
Distributed under the MIT License. See LICENSE for more details.
