Split large Markdown files into manageable chunks based on headings. Useful for feeding docs into AI assistants with context window limits.
- Split by heading level (h1-h6)
- Auto-numbered files to preserve order
- Sanitized, human-readable filenames
- Configurable output directory and filename prefixes
npm install
npm run buildnpx splitdown <input-file> [options]Split by H2 headings (default):
npx splitdown README.mdSplit by H1 headings to a specific directory:
npx splitdown docs.md --level 1 --output ./chapters| Option | Alias | Default | Description |
|---|---|---|---|
--output |
-o |
./split-output |
Output directory |
--level |
-l |
2 |
Heading level to split on (1-6) |
--prefix |
-p |
section- |
Filename prefix |
--preview |
Preview only, no files written | ||
--index |
Generate INDEX.md with links |
npm install
npm run dev # watch mode
npm run build # production buildMIT