🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

llmstxt

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

llmstxt

convert `sitemap.xml` to `llms.txt`

Source
npmnpm
Version
0.5.0
Version published
Weekly downloads
102
-37.04%
Maintainers
1
Weekly downloads
 
Created
Source

llmstxt

generate llms.txt–using your sitemap.xml.

 

Quickstart npm version

$ npx llmstxt gen https://dotenvx.com/sitemap.xml
  • expand example
    $ npx llmstxt gen https://dotenvx.com/sitemap.xml
    - [dotenvx run -f](https://dotenvx.com/docs/advanced/run-f.html): Compose multiple .env files for environment variables loading, as you need.
    - [dotenvx run --log-level](https://dotenvx.com/docs/advanced/run-log-level.html): Set `--log-level` to whatever you wish.
    - [dotenvx run --env HELLO=String](https://dotenvx.com/docs/advanced/run-overload.html): Override existing env variables. These can be variables already on your machine or variables loaded as files consecutively. The last variable seen will 'win'.
    - [dotenvx run --quiet](https://dotenvx.com/docs/advanced/run-quiet.html): Use `--quiet` to suppress all output (except errors).
    - [dotenvx run - Shell Expansion](https://dotenvx.com/docs/advanced/run-shell-expansion.html): Prevent your shell from expanding inline `$VARIABLES` before dotenvx has a chance to inject them. Use a subshell.
    ...
    

Basics

Basic usage

  • `gen https://yoursite.com/sitemap.xml`

    Outputs to stdout.

    $ llmstxt gen https://dotenvx.com/sitemap.xml
    - [dotenvx run -f](https://dotenvx.com/docs/advanced/run-f.html): Compose multiple .env files for environment variables loading, as you need.
    - [dotenvx run --log-level](https://dotenvx.com/docs/advanced/run-log-level.html): Set `--log-level` to whatever you wish.
    - [dotenvx run --quiet](https://dotenvx.com/docs/advanced/run-quiet.html): Use `--quiet` to suppress all output (except errors).
    ...
    
  • `gen https://yoursite.com/sitemap.xml > llms.txt`

    Write to file.

    $ llmstxt gen https://dotenvx.com/sitemap.xml > llms.txt
    

Advanced

Advanced options

  • `gen --exclude-path` - Exclude path(s)

    Exclude paths from generation.

    # exclude all blog posts
    $ llmstxt gen https://dotenvx.com/sitemap.xml --exclude-path "**/blog/**"
    
    # exclude all docs
    $ llmstxt gen https://dotenvx.com/sitemap.xml --exclude-path "**/docs/**"
    
    # exclude privacy and terms
    $ llmstxt gen https://dotenvx.com/sitemap.xml -ep "**/privacy**" -ep "**/terms**"
    
  • `gen --include-path` - Include path(s)

    Include paths for generation.

    # include all docs only
    $ llmstxt gen https://dotenvx.com/sitemap.xml --include-path "**/docs/**"
    
    # include all blogs only
    $ llmstxt gen https://dotenvx.com/sitemap.xml -ip "**/blog/**"
    
  • `gen --replace-title s/pattern/replacement/` - Replace string(s) from title

    Use --replace-title to remove redundant text from your page titles. For example, dotenvx's titles all end with | dotenvx. I want to replace those with empty string.

    $ llmstxt gen https://dotenvx.com/sitemap.xml --replace-title 's/\| dotenvx//'
    
  • `gen --title 'Your Heading'` - set title

    Set your website's heading 1 title.

    $ llmstxt gen https://dotenvx.com/sitemap.xml --title 'dotenvx'
    
  • `gen --description 'Some description'` - set description

    Set your website's description.

    $ llmstxt gen https://dotenvx.com/sitemap.xml --description 'This is a description' 
    

 

FAQ

Can you give me a real world example?

I'm using it to generate dotenvx.com/llms.txt with the following command:

npx llmstxt gen https://dotenvx.com/sitemap.xml -ep "**/privacy**" -ep "**/terms**" -ep "**/blog/**" -ep "**/stats/**" -ep "**/support/**" -rt 's/\| dotenvx//' -t 'dotenvx' > llms.txt

Keywords

llms.txt

FAQs

Package last updated on 20 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts