Zero-config CLI that prints your project's directory tree with every export.
Gitignore-aware, code-files only. Honors the target directory's root .gitignore.
Migrating from
@eloquence98/ctx? This is the same tool, renamed. Runnpm uninstall -g @eloquence98/ctxthennpm i -g export-tree.
No installation required. Run it directly with npx:
npx export-tree ./path-to-projectexport-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.
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.
export function, export const/let/var, export class, export type, export interface, export default function/class
exports.name = ..., module.exports.name = ..., module.exports = { name1, name2 }, module.exports = function/class
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.
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 limitation.md for detailed edge cases.
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
- Rules from the target directory's root
.gitignore
Source files (.ts, .tsx, .js, .jsx) are scanned for exports. Common project and configuration files are included in the tree without export parsing.
Display-only files include package.json, tsconfig.json, jsconfig.json, README.md, LICENSE, and common *.config.* files.
npm i -g export-treeThen run:
export-tree ./src
# or the shorter alias
etree ./srcDon'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.