{"_id":"@avinashchby/repopack","name":"@avinashchby/repopack","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@avinashchby/repopack","version":"0.1.0","description":"Pack an entire codebase into a single LLM-optimized markdown file","type":"module","main":"dist/index.js","bin":{"repopack":"dist/index.js"},"scripts":{"build":"tsc","dev":"tsc --watch","start":"node dist/index.js","test":"vitest run","test:watch":"vitest","lint":"tsc --noEmit","prepublishOnly":"npm run build"},"keywords":["llm","codebase","context","markdown","chatgpt","claude","gemini","repopack"],"author":"","license":"MIT","dependencies":{"clipboardy":"^4.0.0","commander":"^12.1.0","fast-glob":"^3.3.2","ignore":"^6.0.2","strip-comments":"^2.0.1","tiktoken":"^1.0.18"},"devDependencies":{"@types/node":"^22.10.0","typescript":"^5.7.0","vitest":"^2.1.0"},"engines":{"node":">=18.0.0"},"gitHead":"71258f5bc97d87337de613de93b08bfb92926c9a","types":"./dist/index.d.ts","_id":"@avinashchby/repopack@0.1.0","_nodeVersion":"25.5.0","_npmVersion":"11.8.0","dist":{"integrity":"sha512-iBEDKZqftW+3tI9BIKrVgVtoXJ82ZHe/hwt+QRrLvNgrhHoPOxbrnx5ccSzs0AlRWLnVskMkrBKZHzHzLY0bHg==","shasum":"cd1a70ec43e037fbbbe4e2dba8743df6ab09fb22","tarball":"https://registry.npmjs.org/@avinashchby/repopack/-/repopack-0.1.0.tgz","fileCount":23,"unpackedSize":49260,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIF+Emilvq3fl7GN06RFG52+bndLeDvqsLFjtgmq16c5jAiBAOwD0QeTodiRXXX8d3bQI8KOiTFqAgTgcOc2smgbelg=="}]},"_npmUser":{"name":"avinashchby","email":"avinashchby@gmail.com"},"directories":{},"maintainers":[{"name":"avinashchby","email":"avinashchby@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/repopack_0.1.0_1773912839837_0.11292522081837086"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-19T09:33:59.755Z","0.1.0":"2026-03-19T09:33:59.998Z","modified":"2026-03-19T09:34:00.248Z"},"maintainers":[{"name":"avinashchby","email":"avinashchby@gmail.com"}],"description":"Pack an entire codebase into a single LLM-optimized markdown file","keywords":["llm","codebase","context","markdown","chatgpt","claude","gemini","repopack"],"license":"MIT","readme":"# repopack\n\nPack an entire codebase into a single LLM-optimized markdown file.\n\n---\n\n## Install\n\n```sh\nnpm install -g repopack\n```\n\nOr run without installing:\n\n```sh\nnpx repopack\n```\n\nRequires Node.js >= 18.\n\n---\n\n## Usage\n\n```sh\n# Pack current directory → repopack-output.md\nnpx repopack\n\n# Pack a specific directory with a custom output file\nnpx repopack ./src -o context.md\n\n# Truncate largest files first to stay under a token budget\nnpx repopack --max-tokens 100000\n\n# Only include TypeScript files, skip tests\nnpx repopack --include \"*.ts,*.tsx\" --exclude \"*.test.*\"\n\n# Strip comments and collapse blank lines (shrinks token count)\nnpx repopack --compress\n\n# Print token stats without writing any file\nnpx repopack --stats\n\n# Copy output to clipboard instead of writing a file\nnpx repopack --copy\n```\n\n### All options\n\n| Flag | Default | Description |\n|------|---------|-------------|\n| `[dir]` | `.` | Directory to pack |\n| `-o, --output <file>` | `repopack-output.md` | Output file path |\n| `--include <globs>` | `**/*` | Comma-separated glob patterns to include |\n| `--exclude <globs>` | — | Comma-separated glob patterns to exclude |\n| `--max-tokens <n>` | — | Token budget; drops largest files first until under limit |\n| `--compress` | off | Strip comments and collapse blank lines |\n| `--stats` | off | Print token stats to stdout, skip file write |\n| `--copy` | off | Copy output to clipboard instead of writing a file |\n\n---\n\n## Output format\n\n```markdown\n# Repository: my-project\nGenerated by repopack | 42 files | ~18,400 tokens\n\n## File Tree\n```\nmy-project\n├── src\n│   ├── index.ts\n│   └── utils.ts\n└── package.json\n```\n\n## src/index.ts\n```typescript\n// ... file contents\n```\n\n## src/utils.ts\n```typescript\n// ... file contents\n```\n```\n\nEach file gets a level-2 heading with its relative path and a fenced code block with the correct language tag. Paste the whole file directly into any chat or API call.\n\n---\n\n## Smart defaults\n\nThe following are excluded automatically, with no configuration needed:\n\n- `node_modules/`\n- `.git/`\n- Lock files: `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, `bun.lockb`\n- Environment files: `.env`, `.env.*`\n- Binary files: images, fonts, audio, video, archives, executables, PDFs\n\nYour `.gitignore` rules are also respected automatically.\n\n---\n\n## Token counting\n\nrepopack uses `cl100k_base` (tiktoken) to count tokens — the same encoding used by GPT-4. Claude and Gemini token counts are approximated with the same encoder, which is accurate to within ~5% for typical source code.\n\n`--stats` output shows usage against each model's context window:\n\n```\nTotal tokens: 18,400\n\nModel context usage:\n  GPT-4      18,400 / 128,000 tokens (14.4%)\n  Claude     18,400 / 200,000 tokens (9.2%)\n  Gemini     18,400 / 1,000,000 tokens (1.8%)\n```\n\n**Context limits used for comparison:**\n\n| Model | Limit |\n|-------|-------|\n| GPT-4 | 128,000 tokens |\n| Claude | 200,000 tokens |\n| Gemini | 1,000,000 tokens |\n\nUse `--max-tokens` to truncate when you need to stay within a specific limit. Files are dropped largest-first until the output fits.\n\n---\n\n## .repopackignore\n\nPlace a `.repopackignore` file in your project root to exclude files that you don't want in `.gitignore`. Uses the same syntax as `.gitignore`.\n\n```\n# .repopackignore\ndist/\n*.generated.ts\nfixtures/\n```\n\nPriority order (highest to lowest): `--exclude` flag → `.repopackignore` → `.gitignore` → built-in defaults.\n\n---\n\n## Compression\n\n`--compress` reduces token count by:\n\n1. Stripping comments (JS/TS/Python; other languages are left untouched)\n2. Collapsing consecutive blank lines to a single blank line\n3. Trimming trailing whitespace per line\n\nTypical reduction is 10–30% depending on how comment-heavy the codebase is.\n\n---\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","readmeFilename":"README.md","_rev":"1-54d64949266bd0b810b47b69f50cbeef"}