Draws a project's folder structure as a Markdown tree you can paste into a README, design doc, or pull request. It leaves out the noise (.git, node_modules, build output, .env files) so the tree shows the code. It also has a JSON mode, so scripts and coding agents can use it too.
Overview
project-tree-md draws a project's folder structure as a Markdown tree, ready to paste into a README, a design doc, or a pull request.
By default it skips version control and editor folders, dependencies, build and test output, system files, and .env files, so the tree shows the code and not the clutter. The output is wrapped in a code block, so you can pipe it straight into a file or your clipboard.
Version 0.1.0 was released in October 2026. Install it with go install github.com/neilsmahajan/project-tree-md@latest (Go 1.24 or later). It is also easy for scripts and coding agents to call, for example to describe a repository's layout in the docs they write.
Features
Drawing the tree
- Takes a directory as an argument, or uses the current one
- --depth limits how many levels deep the tree goes
- Directories come first, then files, sorted by name; directories end in /
- Symlinks are shown as name -> target and are not followed inside the tree
- --no-fence drops the surrounding code fence lines
Choosing what to leave out
- Skips .git, node_modules, build output, system files, and .env files by default
- --exclude takes a glob, matched against each file or folder name, and can be repeated
- --all includes dot files and the other default-hidden entries
- Keeps useful dot files such as .gitignore, .dockerignore, and .editorconfig
Works with coding agents
- --json prints the same filtered tree in a versioned schema (schemaVersion 1), with counts and any folders it could not read
- The tree goes to stdout; errors and warnings go to stderr
- Exit codes: 0 tree printed, 1 the directory (or a folder or symlink inside it) could not be read, 2 bad flags or arguments
- Folders or symlinks it cannot read are marked (unreadable) and the rest of the tree is still printed
- Never prompts and has no interactive mode, so it behaves the same in a terminal, a pipe, or CI
- Includes a SKILL.md that tells a coding agent when and how to use it
Technical Details
Testing and CI
CI runs the tests on Linux, macOS, and Windows, plus go vet, staticcheck, and gitleaks. Released under the MIT license.