splitdown
v1.1.0
Published
Split markdown files by headings for easier sharing with AI assistants
Readme
Splitdown
Split large Markdown files into manageable chunks based on headings. Useful for feeding docs into AI assistants with context window limits.
Features
- Split by heading level (h1-h6)
- Auto-numbered files to preserve order
- Sanitized, human-readable filenames
- Configurable output directory and filename prefixes
Installation
npm install
npm run buildUsage
npx splitdown <input-file> [options]Examples
Split by H2 headings (default):
npx splitdown README.mdSplit by H1 headings to a specific directory:
npx splitdown docs.md --level 1 --output ./chaptersOptions
| 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 |
Development
npm install
npm run dev # watch mode
npm run build # production buildLicense
MIT
