Skip to content

TheGreatAxios/llms-txt-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

llms-txt-generator

Generate llms.txt files from local codebases or websites using local or hosted LLMs.

Features

  • Local codebase analysis: AST-powered TypeScript/JavaScript parsing
  • Web crawling: Static site extraction via Cheerio
  • LLM agnostic: Works with LMStudio, Ollama, OpenAI, Anthropic, or any OpenAI-compatible endpoint
  • Git integration: Auto-update via pre-commit hooks
  • Zero config: Sensible defaults, optional config files

Installation

Via npm/bun (recommended)

bun add -g llms-txt-generator
# or
npm install -g llms-txt-generator

From source

git clone https://github.com/thegreataxios/llms-txt-generator
cd llms-txt-generator
bun install
bun run build
sudo ln -s $(pwd)/dist/llms-txt /usr/local/bin/llms-txt

Usage

Quick start

# Initialize config (optional)
llms-txt init

# Generate from local codebase
llms-txt generate

# Install git hook for auto-updates
llms-txt hook install

Commands

# Generate llms.txt
llms-txt generate --mode local --path . --output ./llms.txt

# Generate from website
llms-txt generate --mode web --url https://example.com

# Using different LLM providers
llms-txt generate --llm.provider lmstudio --llm.model glm-4.7-flash
llms-txt generate --llm.provider ollama --llm.model llama3.2
llms-txt generate --llm.provider openai --llm.model gpt-4o --llm.apiKey sk-...

# List available providers
llms-txt providers

# Generate npm scripts
llms-txt npm-scripts

Configuration

Config files (optional):

  • .llms-txtrc.json - Project-local
  • ~/.config/llms-txt/config.json - Global

Priority: CLI args → local config → global config → defaults

{
  "llm": {
    "provider": "lmstudio",
    "model": "glm-4.7-flash"
  },
  "input": {
    "mode": "local",
    "includePatterns": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx", "**/*.md"],
    "excludePatterns": ["node_modules/**", "dist/**", "build/**", ".git/**"]
  },
  "output": {
    "path": "./llms.txt"
  }
}

Development

bun install
bun run dev --help
bun run typecheck
bun run build

License

MIT

About

LLMs.txt Generator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors