npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

kodu

v2.1.3

Published

High-performance CLI to prepare codebase for LLMs, automate reviews, and draft commits.

Readme

Kodu

Bundle your codebase for LLMs. Strip noise. Ship faster.

npm version License


What it does

| Problem | Kodu | | :--- | :--- | | Copy-pasting files one by one into ChatGPT | kodu pack bundles your entire project in one command | | Hitting token limits with comments and docs | kodu clean strips comments deterministically via AST | | Sending irrelevant files to LLMs | kodu pack --deps traces only the real import graph from your entry point |


Install

npm install -g kodu

Or run without installing:

npx kodu pack --copy

kodu init

Add .kodu/context.txt to .gitignore so generated context files are never committed:

kodu init

Run once after cloning or setting up the project.


kodu pack

Bundle project files into a single context file optimized for LLMs.

# Pack everything and copy to clipboard
kodu pack --copy

# Pack only specific directories
kodu pack --path src --path tests --copy

# Just see what files would be included
kodu pack --list

# Exclude extra patterns on the fly
kodu pack --exclude "**/*.test.ts" --exclude "docs/" --copy

# Save to a custom path
kodu pack --out /tmp/context.txt

# Use plain text format instead of XML
kodu pack --format text --copy

Dependency-aware packing

Instead of bundling the entire project, trace only the files reachable from your entry point:

# Pack src/index.ts and every file it imports (recursively)
kodu pack src/index.ts --deps --copy

# Multiple entry points
kodu pack src/server.ts src/worker.ts --deps --copy

# Limit traversal depth (direct imports only)
kodu pack src/index.ts --deps --deps-depth 1 --list

# See why each file was included
kodu pack src/index.ts --deps --explain

# Combine with --list and --explain for a quick audit
kodu pack src/index.ts --deps --list --explain

Example --explain output:

src/main.ts  ← entry point
src/app.module.ts  ← import from src/main.ts
src/core/config/config.service.ts  ← import from src/core/config/config.module.ts
src/shared/constants.ts  ← import from src/core/file-system/fs.service.ts

--deps uses ts-morph to resolve the TypeScript import graph, so it correctly handles tsconfig path aliases, re-exports, index files, and type-only imports. node_modules are excluded automatically.

Output format

By default, kodu wraps each file in XML tags — the format that LLMs parse most reliably:

<files>
<file path="src/index.ts">
// your code here
</file>

<file path="src/utils.ts">
// more code
</file>
</files>

Use --format text for legacy // file: path style headers.

Options

| Flag | Description | |------|-------------| | -c, --copy | Copy result to clipboard | | -o, --out <path> | Output file path (default: .kodu/context.txt) | | -p, --path <path> | Include only this directory/glob (repeatable) | | -e, --exclude <pattern> | Additional exclude pattern (repeatable) | | -l, --list | Print file list only, no content | | -f, --format <xml\|text> | Output format (default: xml) | | --clean | Strip comments in-memory before packing (files not modified) | | -t, --template <name> | Wrap output in a prompt template from .kodu/prompts/ | | --deps | Trace import graph from entry point(s) instead of globbing | | --deps-depth <n> | Max import traversal depth (default: unlimited) | | --explain | Print why each file was included (use with --deps) |


kodu clean

Remove comments from source files using AST-based parsing. No AI, fully deterministic.

# Preview what would be removed (with byte/token savings)
kodu clean --dry-run

# Show every removed comment, not just first 3
kodu clean --dry-run --verbose

# Clean only git-staged files
kodu clean --staged

# Clean only git-changed files (staged + unstaged + untracked)
kodu clean --changed

# Target specific files or directories
kodu clean src/utils.ts src/helpers/

# Remove JSDoc too (overrides config)
kodu clean --no-jsdoc

# Backup originals before modifying
kodu clean --backup

# Read from stdin, write to stdout (great for scripting)
cat src/foo.ts | kodu clean --stdin

# Clean all project files
kodu clean

Supports .ts, .tsx, .js, .jsx, .mjs, .cjs, .html. Respects cleaner.whitelist in kodu.json (e.g. //! to preserve important comments).

Options

| Flag | Description | |------|-------------| | -d, --dry-run | Show what will be removed without modifying files | | -v, --verbose | Show all removed comments in dry-run (not just first 3) | | -c, --changed | Clean only git-changed files (staged + unstaged + untracked) | | -s, --staged | Clean only git-staged files | | -n, --no-jsdoc | Remove JSDoc comments (overrides keepJSDoc in config) | | -b, --backup | Save originals to .kodu/backup/ before modifying | | --stdin | Read from stdin, write cleaned result to stdout |


Configuration

Create kodu.json in your project root:

{
  "cleaner": {
    "whitelist": ["//!"],
    "keepJSDoc": true,
    "useGitignore": true
  },
  "packer": {
    "ignore": ["package-lock.json", "dist", "coverage"],
    "useGitignore": true
  }
}

Both commands work without a config file using sensible defaults.

Custom pack template

Point prompts.pack at a markdown file to wrap packed context in a prompt:

{
  "prompts": {
    "pack": ".kodu/prompts/pack.md"
  }
}

Available template variables: {{context}}, {{fileList}}, {{tokenCount}}, {{usdEstimate}}.


Privacy

  • All processing runs locally
  • No data sent anywhere
  • API keys are never stored — only read from env vars