{"id":35646333,"url":"https://github.com/balazshevesi/get-llms","last_synced_at":"2026-01-18T19:43:53.940Z","repository":{"id":332410826,"uuid":"1127569783","full_name":"balazshevesi/get-llms","owner":"balazshevesi","description":"📚 CLI tool for fetching llms.txt files for all of your dependencies","archived":false,"fork":false,"pushed_at":"2026-01-05T11:47:12.000Z","size":313,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-13T19:51:09.325Z","etag":null,"topics":["agentic-coding","ai","ai-agents","javascript","npx","typescript","typescript-library"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/get-llms","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/balazshevesi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-04T06:40:20.000Z","updated_at":"2026-01-08T04:29:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/balazshevesi/get-llms","commit_stats":null,"previous_names":["balazshevesi/get-llms"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/balazshevesi/get-llms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balazshevesi%2Fget-llms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balazshevesi%2Fget-llms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balazshevesi%2Fget-llms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balazshevesi%2Fget-llms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/balazshevesi","download_url":"https://codeload.github.com/balazshevesi/get-llms/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balazshevesi%2Fget-llms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28549721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T19:22:41.102Z","status":"ssl_error","status_checked_at":"2026-01-18T19:22:26.310Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-coding","ai","ai-agents","javascript","npx","typescript","typescript-library"],"created_at":"2026-01-05T13:15:08.041Z","updated_at":"2026-01-18T19:43:53.934Z","avatar_url":"https://github.com/balazshevesi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# get-llms\n📚 CLI tool to fetch [`llms.txt`](https://llmstxt.org/) files for your npm dependencies\n\n## Install\n\nInstall it globally\n\n```bash\nnpm install -g get-llms\n```\n\nor just run it with npx\n\n```bash\nnpx get-llms\n```\n\n## Usage\n\n### Basic Usage\n\nFetch `llms.txt` files for all dependencies in your `package.json`:\n\n```bash\nget-llms\n```\n\n### Fetch Specific Packages\n\nYou can fetch specific packages without needing a `package.json`:\n\n```bash\nget-llms zod react-native\n```\n\n## CLI Options\n\n### Input Options\n\n#### `--package, -p \u003cpath\u003e`\nSpecify a custom path to `package.json` (default: `./package.json`)\n\n```bash\nget-llms --package ./packages/core/package.json\n```\n\n#### `--deps \u003ctypes\u003e`\nFilter which dependency types to include. Comma-separated list of:\n- `prod` - dependencies\n- `dev` - devDependencies\n- `peer` - peerDependencies\n- `optional` - optionalDependencies\n- `all` - all dependencies (default)\n\n```bash\nget-llms --deps prod,dev        # Only production and dev dependencies\nget-llms --deps prod            # Only production dependencies\n```\n\n#### Positional Arguments\nSpecify packages directly to fetch:\n\n```bash\nget-llms react @types/react\n```\n\n### Output Options\n\n#### `--output, -o \u003cdir\u003e`\nCustom output directory (default: `docs/llms`)\n\n```bash\nget-llms --output ./context/dependencies\n```\n\n#### `--filename, -f \u003cpattern\u003e`\nFilename pattern for output files. Use `{name}` as a placeholder for the package name (default: `{name}`)\n\n```bash\nget-llms --filename \"llms-{name}\"\n```\n\n#### `--extension, -e \u003cext\u003e`\nFile extension for output files (default: `txt`)\n\n```bash\nget-llms --extension md\n```\n\n### Behavior Options\n\n#### `--dry-run`\nPreview what would be done without writing any files\n\n```bash\nget-llms --dry-run\n```\n\n#### `--fallback \u003cstrategy\u003e`\nStrategy when `llms.txt` is not found:\n- `none` (default) - Skip packages without `llms.txt`\n- `readme` - Fall back to README.md from GitHub\n- `empty` - Create an empty file with a placeholder message\n- `skip` - Same as `none`\n\n```bash\nget-llms --fallback readme     # Use README.md as fallback\nget-llms --fallback empty      # Create empty files\n```\n\n##### Fallback Examples\n\n**With readme fallback:**\n```bash\nget-llms --fallback readme\n```\n\nResults in:\n```\n✅ package-name: Using readme fallback -\u003e package-name.txt\n```\n\n**With empty fallback:**\n```bash\nget-llms --fallback empty\n```\n\nCreates files containing:\n```\n# package-name\n\nNo llms.txt found for this package.\n```\n\n### Verbosity Options\n\n#### `--quiet, -q`\nOnly show errors (minimal output)\n\n```bash\nget-llms --quiet\n```\n\n#### `--verbose, -v`\nShow detailed output including:\n- Network requests being made\n- URLs being checked\n- Debug information\n\n```bash\nget-llms --verbose\n```\n\n**Note:** If both `-q` and `-v` are specified, the last one wins.\n\n### Filename Sanitization Options\n\nCustomize how special characters in package names are sanitized:\n\n#### `--space-replace \u003cchar\u003e`\nCharacter to replace spaces in filenames (default: `_`)\n\n```bash\nget-llms --space-replace \"_\"\n```\n\n#### `--slash-replace \u003cchar\u003e`\nCharacter to replace slashes in filenames (default: `-`)\n\n```bash\nget-llms --slash-replace \"-\"\n```\n\n#### `--at-replace \u003cchar\u003e`\nCharacter to replace `@` in scoped package names (default: empty string)\n\n```bash\nget-llms --at-replace \"\"\n```\n\n**Example:** `@types/node` becomes `types-node.txt` with default settings\n\n## Complete Examples\n\n### Example 1: Fetch with readme fallback and save as markdown\n```bash\nget-llms \\\n  --fallback readme \\\n  --extension md \\\n  --output ./docs/handbook\n```\n\n### Example 2: Only production dependencies with custom naming\n```bash\nget-llms \\\n  --deps prod \\\n  --filename \"{name}-reference\" \\\n  --extension txt \\\n  --output ./context/prod\n```\n\n### Example 3: Fetch specific packages with custom sanitization\n```bash\nget-llms @types/node @types/react \\\n  --space-replace \"_\" \\\n  --slash-replace \"_\" \\\n  --at-replace \"at_\"\n```\n\nThis might create:\n- `at_types_node.txt`\n- `at_types_react.txt`\n\n### Example 4: Verbose dry run with all dependencies\n```bash\nget-llms \\\n  --deps all \\\n  --dry-run \\\n  --verbose\n```\n\n### Example 5: Complex workflow - production deps with empty fallback\n```bash\nget-llms \\\n  --deps prod \\\n  --fallback empty \\\n  --output ./docs/llms-production \\\n  --quiet\n```\n\n## Output Structure\n\nBy default, files are saved to:\n```\ndocs/llms/\n  ├── zod.txt\n  ├── react-native.txt\n  └── [package-name].txt\n```\n\nWith `--fallback readme`, successful files may include fallback indicators in the summary.\n\n## How It Works\n\nThe tool searches for `llms.txt` files in this order:\n\n1. Check the package's `package.json` for an `llms` or `llmsFull` field\n2. Try standard URLs: `{homepage}/llms.txt` and `{homepage}/docs/llms.txt`\n3. If GitHub repository, search README for links containing \"docs\"\n4. Apply fallback strategy if specified\n\n```mermaid\nflowchart TD\n    A([package]) --\u003e B{is there an 'llms' key in the 'package.json'?}\n\n    B -- yes --\u003e FOUND([we've found it])\n    B -- no --\u003e C{is the package homepage a github link?}\n\n    C -- yes --\u003e D{does the github 'readme.txt' mention the word 'docs' in a hyperlink?}\n    C -- no --\u003e E{does 'link/llms.txt' return a txt file?}\n\n    D -- yes --\u003e E\n    D -- no --\u003e NOFILE([there likely isn't a 'llms.txt' for that package Either use the 'README.txt', or use an external service like context7])\n\n    E -- yes --\u003e FOUND\n    E -- no --\u003e F{does 'link/docs/llms.txt' return a txt file?}\n\n    F -- yes --\u003e FOUND\n    F -- no --\u003e NOFILE\n```\n\n## Exit Codes\n\n- `0` - Success\n- `1` - Package.json not found or cannot be parsed\n\n## Contributing\n\nIssues and contributions welcome! Report bugs at: [https://github.com/balazshevesi/get-llms/issues](https://github.com/balazshevesi/get-llms/issues), or contact me on twitter [@balazs_hevesi](https://x.com/balazs_hevesi)\n\n## Roadmap and vision\n\nThe [`llms.txt`](https://llmstxt.org/) spec is still young and un-opinionated. Some packages and some documentation-sites already ship an `llms.txt` file, others don’t, and the ones that do sometimes invent their own markdown dialect. \n\nAs adoption grows we expect the format to stabilise, turning “antigenic-coding” into a first-class workflow.\n\n### Specifying `llms.txt`\n\nToday the cleanest way to publish documentation with an `llms.txt` is to add an `\"llms\"` key to `package.json`:\n\n```json\n\"llms\": \"./README.txt\"\n```\n\nWhen the registry starts indexing that field we’ll be able to fetch the *exact* documentation that and feed it into the coding-agent's context. (this will also require the URLs for fetching documentation versions to be standardized)\n\nExample: [zod](https://github.com/colinhacks/zod/blob/main/packages/zod/package.json#L75)\n\n### Practical integration\n\nBecause the format is still fluid, treat `llms.txt` as *best-effort* documentation:\n\n- 90 % of the time an agent can slurp the file directly.  \n- If it’s 25k tokens or more, you might want to fall back to a cache, a RAG layer, or a service such as [Context7](https://context7.com/). (AI-agents such have a limit on the file sizes they're willing to read, and will truncate the file to fit their context window)\n\n### Why this will matter tomorrow\n\nVibe-coded apps are about to become legacy and enter a maintenance phase. When that happens, ai coding-agents will need the docs for **old** versions of the packages. `llms.txt` is the lowest-friction way to provide the ai with the correct documentation.\n\nExternal services (like Context7) are great, but bundling the required context is simpler, cheaper.\n\n## License\n\n[MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalazshevesi%2Fget-llms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbalazshevesi%2Fget-llms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalazshevesi%2Fget-llms/lists"}