gitdex scans a local codebase and converts it into clean text bundles that help LLMs understand the whole repository with less noise and better structure.
- root files become separate
.txtfiles - each top-level directory becomes one merged
.txt - every file block starts with its relative path
- binary files are skipped by default
.gitis skipped by defaultnode_modulesis skipped by default- output is written into a fresh
gitdex/folder
gitdex is not tied to NotebookLM.
One practical use case is this:
- run
gitdexinside a project - get the generated
.txtfiles inside./gitdex - import those files into NotebookLM
So NotebookLM support is simply one nice downstream workflow for the exported files — not the core identity of the project.
Input:
project/
README.md
package.json
src/
index.ts
utils/
helper.ts
docs/
intro.md
Output:
gitdex/
README.txt
package.txt
src.txt
docs.txt
src.txt
src/index.ts
import ...
---
src/utils/helper.ts
export function ...
Run it in the folder you want to export:
npx gitdexOr point it at another folder:
npx gitdex ../my-projectAfter a global install:
npm i -g gitdex
gitdexgitdex [input-directory] [options]
Options:
-o, --output <dir> Output directory (default: ./gitdex)
--include-node-modules Include node_modules
--include-dot-git Include .git
--include-binary Include binary files as UTF-8 text attempt
--force Clean an existing output directory
--silent Print only the final summary
-h, --help Show help
-v, --version Show version
This output format is intentionally simple:
- text only
- relative paths preserved at the top of each block
- top-level grouping keeps file count manageable
- easy to import into tools like NotebookLM, or inspect manually
gitdex/output is automatically excluded from scanning.- Symbolic links are skipped to avoid recursive surprises.
- If the output folder already exists and is not a gitdex-managed folder, the CLI stops unless you pass
--force. - Output filename collisions are handled automatically.
npm install
npm test
node ./bin/gitdex.js . --output ./gitdex-outThis project is configured for public npm publishing:
npm publish --access publicMIT