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

get-llms

v1.0.5

Published

CLI tool for fetching llms.txt files for all of your dependencies

Readme

get-llms

📚 CLI tool to fetch llms.txt files for your npm dependencies

Install

Install it globally

npm install -g get-llms

or just run it with npx

npx get-llms

Usage

Basic Usage

Fetch llms.txt files for all dependencies in your package.json:

get-llms

Fetch Specific Packages

You can fetch specific packages without needing a package.json:

get-llms zod react-native

CLI Options

Input Options

--package, -p <path>

Specify a custom path to package.json (default: ./package.json)

get-llms --package ./packages/core/package.json

--deps <types>

Filter which dependency types to include. Comma-separated list of:

  • prod - dependencies
  • dev - devDependencies
  • peer - peerDependencies
  • optional - optionalDependencies
  • all - all dependencies (default)
get-llms --deps prod,dev        # Only production and dev dependencies
get-llms --deps prod            # Only production dependencies

Positional Arguments

Specify packages directly to fetch:

get-llms react @types/react

Output Options

--output, -o <dir>

Custom output directory (default: docs/llms)

get-llms --output ./context/dependencies

--filename, -f <pattern>

Filename pattern for output files. Use {name} as a placeholder for the package name (default: {name})

get-llms --filename "llms-{name}"

--extension, -e <ext>

File extension for output files (default: txt)

get-llms --extension md

Behavior Options

--dry-run

Preview what would be done without writing any files

get-llms --dry-run

--fallback <strategy>

Strategy when llms.txt is not found:

  • none (default) - Skip packages without llms.txt
  • readme - Fall back to README.md from GitHub
  • empty - Create an empty file with a placeholder message
  • skip - Same as none
get-llms --fallback readme     # Use README.md as fallback
get-llms --fallback empty      # Create empty files
Fallback Examples

With readme fallback:

get-llms --fallback readme

Results in:

✅ package-name: Using readme fallback -> package-name.txt

With empty fallback:

get-llms --fallback empty

Creates files containing:

# package-name

No llms.txt found for this package.

Verbosity Options

--quiet, -q

Only show errors (minimal output)

get-llms --quiet

--verbose, -v

Show detailed output including:

  • Network requests being made
  • URLs being checked
  • Debug information
get-llms --verbose

Note: If both -q and -v are specified, the last one wins.

Filename Sanitization Options

Customize how special characters in package names are sanitized:

--space-replace <char>

Character to replace spaces in filenames (default: _)

get-llms --space-replace "_"

--slash-replace <char>

Character to replace slashes in filenames (default: -)

get-llms --slash-replace "-"

--at-replace <char>

Character to replace @ in scoped package names (default: empty string)

get-llms --at-replace ""

Example: @types/node becomes types-node.txt with default settings

Complete Examples

Example 1: Fetch with readme fallback and save as markdown

get-llms \
  --fallback readme \
  --extension md \
  --output ./docs/handbook

Example 2: Only production dependencies with custom naming

get-llms \
  --deps prod \
  --filename "{name}-reference" \
  --extension txt \
  --output ./context/prod

Example 3: Fetch specific packages with custom sanitization

get-llms @types/node @types/react \
  --space-replace "_" \
  --slash-replace "_" \
  --at-replace "at_"

This might create:

  • at_types_node.txt
  • at_types_react.txt

Example 4: Verbose dry run with all dependencies

get-llms \
  --deps all \
  --dry-run \
  --verbose

Example 5: Complex workflow - production deps with empty fallback

get-llms \
  --deps prod \
  --fallback empty \
  --output ./docs/llms-production \
  --quiet

Output Structure

By default, files are saved to:

docs/llms/
  ├── zod.txt
  ├── react-native.txt
  └── [package-name].txt

With --fallback readme, successful files may include fallback indicators in the summary.

How It Works

The tool searches for llms.txt files in this order:

  1. Check the package's package.json for an llms or llmsFull field
  2. Try standard URLs: {homepage}/llms.txt and {homepage}/docs/llms.txt
  3. If GitHub repository, search README for links containing "docs"
  4. Apply fallback strategy if specified
flowchart TD
    A([package]) --> B{is there an 'llms' key in the 'package.json'?}

    B -- yes --> FOUND([we've found it])
    B -- no --> C{is the package homepage a github link?}

    C -- yes --> D{does the github 'readme.txt' mention the word 'docs' in a hyperlink?}
    C -- no --> E{does 'link/llms.txt' return a txt file?}

    D -- yes --> E
    D -- no --> NOFILE([there likely isn't a 'llms.txt' for that package Either use the 'README.txt', or use an external service like context7])

    E -- yes --> FOUND
    E -- no --> F{does 'link/docs/llms.txt' return a txt file?}

    F -- yes --> FOUND
    F -- no --> NOFILE

Exit Codes

  • 0 - Success
  • 1 - Package.json not found or cannot be parsed

Contributing

Issues and contributions welcome! Report bugs at: https://github.com/balazshevesi/get-llms/issues, or contact me on twitter @balazs_hevesi

Roadmap and vision

The llms.txt 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.

As adoption grows we expect the format to stabilise, turning “antigenic-coding” into a first-class workflow.

Specifying llms.txt

Today the cleanest way to publish documentation with an llms.txt is to add an "llms" key to package.json:

"llms": "./README.txt"

When 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)

Example: zod

Practical integration

Because the format is still fluid, treat llms.txt as best-effort documentation:

  • 90 % of the time an agent can slurp the file directly.
  • 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. (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)

Why this will matter tomorrow

Vibe-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.

External services (like Context7) are great, but bundling the required context is simpler, cheaper.

License

MIT License