kontxt-cli
v0.1.1
Published
CLI for packaging codebases into AI-ready context files.
Maintainers
Readme
kontxt-cli
kontxt packages a codebase into AI-ready markdown context files.
The supported path is the extended pipeline.
The old -o legacy flow still exists, but it is deprecated.
npm package:
Install
npm
npm install -g kontxt-cliThis installs the kontxt command globally.
pnpm
pnpm add -g kontxt-cliThis installs the kontxt command globally.
Verify
kontxt --helpRun Without Global Install
With npm:
npx kontxt-cli --helpWith pnpm:
pnpm dlx kontxt-cli --helpThis runs the published package directly without a global install.
Requirements
- Node.js 18 or newer
Usage
Run kontxt inside the repository you want to package.
Extended Summary
kontxt -eThis runs the extended pipeline and writes a single summary file under:
.kontxt/<DD-M-YYYY>-summary.mdYou can also provide a custom file name:
kontxt -e -o custom.mdThat writes:
.kontxt/custom.mdExtended Split Mode
kontxt -e --32k
kontxt -e --64k
kontxt -e --128kThis writes split summaries under:
.kontxt/32k-token/.kontxt/64k-token/.kontxt/128k-token/
Generated files are deterministic:
part-001.mdpart-002.mdpart-003.md
Split-mode rules:
- must be used with
-e - use only one split flag at a time
- each part stays within the selected token budget based on the final rendered markdown
- each part includes the full repository tree
- each run removes old markdown part files in that split directory before writing the new set
-ocannot be combined with split mode
Tree Only
kontxt -tThis prints the repository tree in the terminal and does not write summary files.
Deprecated Legacy Mode
kontxt -o
kontxt -o custom.mdThis still works, but it is deprecated and should not be the path you rely on.
Typical Workflow
- Open the target repository in your terminal.
- Run
kontxt -efor one full summary, orkontxt -e --32k/--64k/--128kfor split output. - Open the generated files in
.kontxt/. - Feed the output to your LLM or downstream tooling.
Ignore Rules
kontxt respects .gitignore and .kontxtignore.
If .kontxtignore does not exist, kontxt creates it automatically.
Example .kontxtignore:
dist
coverage
.env
*.logCLI Reference
# help
kontxt --help
# extended single summary
kontxt -e
kontxt -e -o custom.md
# extended split summary
kontxt -e --32k
kontxt -e --64k
kontxt -e --128k
# tree only
kontxt -t
# deprecated legacy mode
kontxt -o
kontxt -o custom.mdDevelopment
With npm:
npm install
npm run build
npm testWith pnpm:
pnpm install
pnpm run build
pnpm testAdditional scripts:
npm run test:all
npm run test:legacy:deprecated