{"_id":"@c.v.e/repo2ai","name":"@c.v.e/repo2ai","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@c.v.e/repo2ai","version":"0.1.0","description":"Pack a local repository into a clean, token-aware Markdown context file for AI coding agents.","type":"module","license":"MIT","keywords":["ai","cli","typescript","markdown","developer-tools","code-context","chatgpt","claude","codex"],"repository":{"type":"git","url":"git+https://github.com/PrryK/repo2ai.git"},"bugs":{"url":"https://github.com/PrryK/repo2ai/issues"},"homepage":"https://github.com/PrryK/repo2ai#readme","bin":{"repo2ai":"dist/cli.js"},"engines":{"node":">=20"},"scripts":{"build":"tsup","prepack":"npm run build","test":"vitest run","typecheck":"tsc --noEmit"},"dependencies":{"commander":"^12.1.0","fast-glob":"^3.3.2","ignore":"^5.3.2"},"devDependencies":{"@types/node":"^20.17.10","tsup":"^8.3.5","typescript":"^5.7.2","vitest":"^2.1.8"},"gitHead":"d5c71559dc7ad1d0ecfe9f6c0f097f41661cb432","_id":"@c.v.e/repo2ai@0.1.0","_nodeVersion":"25.8.0","_npmVersion":"11.11.0","dist":{"integrity":"sha512-PtLQzkGEzDI0b0b5CawO9dEpg8NZDjqvhUKgMLp0CHj9bwRGEKB7wZi5rU3gZfRzg64tKGOtNcQsZadLboAKsw==","shasum":"b28708a778a3bf819909efa850ef143626c1ee7d","tarball":"https://registry.npmjs.org/@c.v.e/repo2ai/-/repo2ai-0.1.0.tgz","fileCount":9,"unpackedSize":153792,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD/kZFg9mjRv7wXN/1CqZ1s5CvndTQ8EWHLxwy+VJmMygIhAMeG16udsDBoFmoTkPTUpUeDOH+Np38CyNFaaxdSPyyx"}]},"_npmUser":{"name":"c.v.e","email":"lpk82666@163.com"},"directories":{},"maintainers":[{"name":"c.v.e","email":"lpk82666@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/repo2ai_0.1.0_1777552111372_0.20665396687500115"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-30T12:28:31.276Z","0.1.0":"2026-04-30T12:28:31.519Z","modified":"2026-04-30T12:28:31.794Z"},"maintainers":[{"name":"c.v.e","email":"lpk82666@163.com"}],"description":"Pack a local repository into a clean, token-aware Markdown context file for AI coding agents.","homepage":"https://github.com/PrryK/repo2ai#readme","keywords":["ai","cli","typescript","markdown","developer-tools","code-context","chatgpt","claude","codex"],"repository":{"type":"git","url":"git+https://github.com/PrryK/repo2ai.git"},"bugs":{"url":"https://github.com/PrryK/repo2ai/issues"},"license":"MIT","readme":"# repo2ai\n\n[![CI](https://github.com/PrryK/repo2ai/actions/workflows/ci.yml/badge.svg)](https://github.com/PrryK/repo2ai/actions/workflows/ci.yml)\n\nrepo2ai packs a local code repository into a clean, structured, token-aware Markdown context file for ChatGPT, Claude, Codex, and other AI coding agents.\n\nIt helps developers give an AI coding assistant the right project context without manually copying files.\n\n```sh\nrepo2ai .\n```\n\nBy default, this writes `repo-context.md` in the current working directory. repo2ai is local-first: it scans files on your machine and does not upload code, call external APIs, or integrate with AI APIs.\n\n## Features\n\n- Scans a local repository directory.\n- Respects default ignore rules, `.gitignore`, and `.repo2aiignore`.\n- Writes `repo-context.md` by default.\n- Uses a `30000` token budget by default.\n- Generates a directory tree, included files table, omitted files table, suggested prompt, and file contents.\n- Skips binary files, real `.env` files, lock file contents, and very large files by default.\n- Redacts common secrets before writing output.\n- Has no backend, no uploads, no external API calls, and no AI API integration.\n\n## Install\n\n```sh\nnpm install -g @c.v.e/repo2ai\n```\n\nThe npm package is scoped as `@c.v.e/repo2ai`, but the installed CLI command is still `repo2ai`.\n\nFor local development:\n\n```sh\nnpm install\nnpm run build\nnpm link\n```\n\n## Usage\n\n```sh\nrepo2ai .\nrepo2ai ./my-project --out context.md\nrepo2ai . --max-tokens 30000\nrepo2ai . --include src,README.md,package.json\nrepo2ai . --exclude tests,dist,node_modules\nrepo2ai . --tree-depth 3\n```\n\nBy default, `repo2ai .` writes `repo-context.md` in the current working directory. It does not print the full context to stdout.\n\nIf the output file already exists, repo2ai refuses to overwrite it:\n\n```text\n$ repo2ai .\nOutput file already exists: /path/to/repo-context.md. Use --force to overwrite or choose a different --out path.\n```\n\nUse `--force` to overwrite intentionally:\n\n```sh\nrepo2ai . --force\n```\n\n## Options\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `--out <file>` | `repo-context.md` | Output Markdown file. |\n| `--force` | `false` | Overwrite an existing output file. |\n| `--max-tokens <number>` | `30000` | Approximate token budget. |\n| `--include <patterns>` | none | Comma-separated include patterns. |\n| `--exclude <patterns>` | none | Comma-separated exclude patterns. |\n| `--tree-depth <number>` | `4` | Maximum directory tree depth. |\n| `--max-file-size <bytes>` | `250000` | Maximum file size to include. |\n\n## Text Demo\n\n```text\n$ repo2ai .\nWrote /Users/me/project/repo-context.md\nFiles included: 18\nApprox tokens: 24782\nOmitted files: 6\n```\n\nExample generated Markdown:\n\n````md\n# Repository Context\n\nGenerated by repo2ai.\n\n## Metadata\n\n- Root: /Users/me/project\n- Files included: 18\n- Approx tokens: 24782\n\n## Suggested Prompt\n\nYou are analyzing this codebase. Please understand the project structure first, then answer my question.\n\n## Directory Tree\n\n```text\n.\n|-- src\n|   `-- index.ts\n`-- package.json\n```\n````\n\n## Ignore And Safety Behavior\n\nrepo2ai applies default ignore rules for common dependency, build, cache, and coverage directories such as `.git`, `node_modules`, `dist`, `build`, `coverage`, `.next`, `.nuxt`, `.turbo`, `.cache`, `.venv`, `__pycache__`, `.pytest_cache`, `target`, and `vendor`.\n\nIt also reads `.gitignore` and `.repo2aiignore` from the scanned root.\n\nReal env files such as `.env`, `.env.local`, and `.env.production` are skipped by default and listed in the omitted files table. Safe templates such as `.env.example`, `.env.template`, and `.env.sample` may be included, but still pass through redaction.\n\nLock files such as `package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`, and `Cargo.lock` are not included as full contents by default. Manifest files such as `package.json`, `pyproject.toml`, `Cargo.toml`, and `go.mod` remain high priority.\n\n## Limitations\n\n- Token counts are approximate and use `Math.ceil(text.length / 4)`.\n- repo2ai does not call AI APIs, summarize code, or rank files with a model.\n- Binary files, real env files, lock file contents, and files above `--max-file-size` are skipped by default.\n- Redaction is best-effort and should not replace reviewing generated context before sharing it.\n- The MVP is CLI-only and does not include a backend, hosted service, or GUI.\n\n## Development\n\n```sh\nnpm install\nnpm run typecheck\nnpm test\nnpm run build\n```\n","readmeFilename":"README.md","_rev":"1-3b862d489d5da4b2336a663f018e731b"}