export-tree
v1.0.1
Published
Zero-config CLI that prints your project's directory tree with every export. Gitignore-aware, code-files only. Paste-ready for AI prompts or quick onboarding.
Maintainers
Readme
export-tree
Zero-config CLI that prints your project's directory tree with every export. Gitignore-aware, code-files only. Paste-ready for AI prompts or quick onboarding.
Migrating from
@eloquence98/ctx? This is the same tool, renamed. Runnpm uninstall -g @eloquence98/ctxthennpm i -g export-tree.
Quick Start
No installation required. Run it directly with npx:
npx export-tree ./path-to-projectWhat It Does
export-tree provides a high-level structural map of a project. It identifies:
- Folders
- Files
- Exported symbols (both ES modules and CommonJS, when trivially detectable)
Exports that cannot be statically determined from source text are silently ignored.
Example Output
src/
├─ app.tsx → App
├─ utils.ts → formatDate, parseCurrency
└─ components/
├─ button.tsx → Button
├─ modal.tsx → Modal, ModalPropsFiles whose exports cannot be determined are listed without symbols.
Supported Export Patterns
ES Modules:
export function, export const/let/var, export class, export type, export interface, export default function/class
CommonJS:
exports.name = ..., module.exports.name = ..., module.exports = { name1, name2 }, module.exports = function/class
Why This Exists
When working with LLMs, new contributors, or legacy codebases, you don't always need the content of the files immediately, you need to understand the topology of the project first.
export-tree gives you that map.
- Copy the output.
- Paste it into an LLM context window.
- Ask informed questions about the architecture before dumping raw code.
What It Does Not Do
export-tree is intentionally shallow. That is why it is reliable.
- Does not interpret architecture or infer domains
- Does not explain code intent
- Does not refactor or execute code
- Does not read
node_modules,.git, or environment files - Does not parse re-exports, barrel files, or computed names
See LIMITATIONS.md for detailed edge cases.
Configuration
No configuration required.
export-tree automatically ignores:
node_modules,.git- Build outputs (
dist,build,.next) - Environment files (
.env) - Test files (
.test.,.spec.) - Hidden files and directories
Only .ts, .tsx, .js, .jsx files are scanned. Both ES module and CommonJS exports are detected.
Install (optional)
npm i -g export-treeThen run:
export-tree ./src
# or the shorter alias
etree ./srcPhilosophy
Don't explain the code. Show the codebase as it exists.
export-tree prefers truthful omission over incorrect inference. If something cannot be determined reliably, it is excluded.
