I made kontxt, a CLI that packages Git repositories into token-budgeted Markdown

Wait 5 sec.

I built a TypeScript CLI called kontxt for generating structured Markdown context from a repository. The basic command is: kontxt -e It produces a Markdown file containing the repository tree and included file contents under .kontxt/. The more useful part is selecting context based on Git state: kontxt -e --changed kontxt -e --staged kontxt -e --stash kontxt -e --stash 'stash@{1}' kontxt -e --since main For larger repositories, output can be split into deterministic parts based on a maximum token budget: kontxt -e --32k kontxt -e --64k kontxt -e --128k Each generated part contains the complete repository tree while remaining within the selected token budget. There is also a JS/TS skeleton mode: kontxt -e --changed --skeleton It attempts to preserve imports, declarations, class/function/type signatures and test names while dropping implementation bodies. Unsupported files fall back to their full contents. The CLI respects both .gitignore and .kontxtignore. Install: npm install -g kontxt-cli Or run it without installing: npx kontxt-cli --help Requirements: Node.js 18 or newer. GitHub: https://github.com/knownIndie/kontxt-cli npm: https://www.npmjs.com/package/kontxt-cli I would appreciate technical criticism, particularly around: - CLI naming and flag design - Token-budget splitting behaviour - Git edge cases - Output format - Language-aware skeleton generation The project currently uses a custom non-commercial source-available licence. The code can be viewed, modified and used non-commercially, but commercial use requires permission.   submitted by   /u/known_indie_explorer [link]   [comments]