Visualise detailed file structures on CLI

Shreyas Prakash headshot

Shreyas Prakash

I wanted an easy way in which I could visualise any directory that i’m navigating on the CLI. Yes, you did have standard npm packages such as “tree” for example, but those were not very helpful for me to understand the overall size of the files. I wanted a more “detailed” tree that could help me gauge how the codebase looks like.

For this reason, I created this package — dftree. This generates more visual UX-friendly representations of directory structures using Unicode box-drawing characters.

You can find the dftree npm package for installation instructions and usage details. This utility helps developers:

  • Visualize complex folder structures in the terminal
  • Generate directory trees for documentation
  • Explore project organization with customizable output
  • Export directory structure as text files or for console display

The tool uses a depth-first traversal algorithm to generate the tree visualization with proper indentation and branch characters.

Example output:

📂 project-root
├── 📂 src
│   ├── 📂 components
│   │   ├── 📄 Button.jsx
│   │   └── 📄 Card.jsx
│   ├── 📂 utils
│   │   └── 📄 helpers.js
│   └── 📄 index.js
├── 📄 README.md
└── 📄 package.json

Install it globally with:

npm install -g dftree

This package is a handy utility for visualizing project structures.

Subscribe to get future posts via email (or grab the RSS feed). 2-3 ideas every month across design and tech

Read more

  1. My agentic engineering workflow (step by step)agentic-coding
  2. Keep hunting for co creative systemic loopsdesign-thinking
  3. Keep hunting for co creative loops
  4. Hammock driven developmentagentic-coding
  5. Peculiar ways number three fits into our funny little brains
  6. AI sandwich as a defacto principle for anything agentic engineering relatedagentic-coding
  7. How I write essays in 2026writing
  8. Authority in the guise of evidencecritical-rationalism
  9. Map is not the territoryphilosophy
  10. Self hypnosis as a manifestation ritualmeditation
  11. Hegelian dialectic for structured reasoning with AI agentsphilosophy
  12. How I prepare for tough negotiations nowadaysnegotiation
  13. When should we steelthread somethingproduct-development
  14. How to become a polyglot
  15. Breadboarding, shaping, slicing, and steelthreading solutions with AI agentsproduct-management
  16. Healthy conflict in teams have a tipping pointteam-building
  17. Deslopify AI writingwriting
  18. How I started building softwares with AI agents being non technicalagentic-coding
  19. Read raw transcriptsknowledge
  20. Legible and illegible tasks in organisationsproduct
  21. L2 Fat marker sketchesdesign
  22. Writing as moats for humanswriting
  23. Beauty of second degree probesdecision-making
  24. Boundary objects as the new prototypesprototyping
  25. One way door decisionsproduct
  26. Finished softwares should existproduct
  27. How I periodically rank my rough draftsobsidian
  28. Flipping questions on its headinterviewing
  29. Vibe writing maximswriting
  30. How I blog with Obsidian, Cloudflare, AstroJS, Githubwriting
  31. How I build greenfield apps with AI-assisted codingai-coding
  32. We have been scammed by the Gaussian distribution clubmathematics
  33. Classify incentive problems into stag hunts, and prisoners dilemmasgame-theory
  34. I was wrong about optimal stoppingmathematics
  35. Thinking like a shipmental-models
  36. Hyperpersonalised N=1 learningeducation
  37. New mediums for humans to complement superintelligenceai-coding
  38. Maxims for AI assisted codingai-coding
  39. Personal Website Starter Kitai-coding
  40. Virtual bookshelvesaesthetics
  41. It's computational everythingtrends
  42. Public gardens, secret routesdigital-garden
  43. Git way of learning to codeai-coding
  44. Kaomoji generatorsoftware
  45. Copy, Paste and Citeai-coding
  46. Style Transfer in AI writingai-coding
  47. Understanding codebases without using codeai-coding
  48. Vibe coding with Cursorai-coding
  49. Virtuoso Guide for Personal Memory Systemsmemory
  50. Writing in Future Pastwriting
  51. Publish Originally, Syndicate Elsewhereblogging
  52. Poetic License of Designdesign
  53. Idea in the shower, testing before breakfastsoftware
  54. Technology and regulation have a dance of ice and firetechnology
  55. How I ship "stuff"software
  56. Writing is thinkingwriting
  57. Song of Shapes, Words and Pathscreativity
  58. How do we absorb ideas better?knowledge
  59. Read writers who operatewriting
  60. Brew your ideas lazilyideas
  61. Trees, Branches, Twigs and Leaves — Mental Models for Writingwriting
  62. Compound Interest of Private Notesknowledge
  63. Conceptual Compression for LLMsai-coding
  64. Meta-analysis for contradictory research findingsdigital-health
  65. Proof of workproduct
  66. Gauging previous work of new joinees to the teamleadership
  67. Task management for product managersproduct
  68. Beauty of Zettelswriting
  69. Stitching React and Rails togetherai-coding
  70. Exploring "smart connections" for note takingknowledge
  71. Deploying Home Cooked Apps with Railssoftware
  72. Repetitive Copypromptingwriting
  73. Questions to ask every decadejournalling
  74. Balancing work, time and focusproductivity
  75. Hyperlinks are like cashew nutswriting
  76. Brand treatments, Design Systems, Vibesdesign
  77. How to spot human writing on the internetwriting
  78. Can a thought be an algorithm?product
  79. Opportunity Harvestingcareers
  80. How does AI affect UI?design
  81. Everything is a prioritisation problemproduct-management
  82. Nowlifestyle
  83. How I do product roastsproduct
  84. The Modern Startup Stacksoftware
  85. In-person vision transmissionproduct
  86. How might we help children invent for social good?social-design
  87. The meeting before the meetingmeetings
  88. Design that's so bad it's actually gooddesign
  89. Lessons learnt interview prepping for product rolesinterviewing
  90. Obsessing over personal websitessoftware
  91. English is the hot new programming languagesoftware
  92. Better way to think about conflictsconflict-management
  93. The role of taste in building productsdesign
  94. Dear enterprises, we're tired of your subscriptionssoftware
  95. Products need not be user centereddesign
  96. World's most ancient public health problemsoftware
  97. Pluginisation of Modern Softwaredesign
  98. Let's make every work 'strategic'consulting
  99. Making Nielsen's heuristics more digestibledesign
  100. Startups are a fertile ground for risk takingentrepreneurship
  101. Insights are not just a salad of factsdesign
  102. Minimum Lovable Productproduct
  103. Methods are lifejackets not straight jacketsmethodology
  104. How to arrive at on-brand colours?design
  105. Minto principle for writing memoswriting
  106. Importance of Whytask-management
  107. Quality Ideas Trump Executionsoftware
  108. How to hire a personal doctormental-models
  109. Why I prefer indie softwareslifestyle
  110. Use code only if no code failscode
  111. Self Marketing
  112. Personal Observation Techniquesdesign
  113. Design is a confusing worddesign
  114. A Primer to Service Design Blueprintsdesign
  115. Rapid Journey Prototypingdesign
  116. Visualise detailed file structures on CLIcli
  117. Do's and Don'ts of User Researchdesign
  118. Design Manifestodesign
  119. Complex project management for productproducts
  120. How might we enable patients and caregivers to overcome preventable health conditions?digital-health
  121. Pedagogy of the Uncharted — What for, and Where to?education
  122. Future of Ageing with Mehdi Yacoubiinterviewing
  123. Future of Tacit knowledge with Celeste Volpiinterviewing
  124. Future of Rural Innovation with Thabiso Blak Mashabainterviewing
  125. Future of Equity with Ludovick Petersinterviewing
  126. Future of work with Laetitia Vitaudinterviewing
  127. Future of Mental Health with Kavya Raointerviewing
  128. Future of unschooling with Che Vanniinterviewing
  129. How might we prevent acquired infections in hospitals?digital-health
  130. The why to endure any howentrepreneurship
  131. Design education amidst social tribulationsdesign
  132. How might we assist deafblind runners to navigate?social-design