Generate llms.txt files from local codebases or websites using local or hosted LLMs.
- 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
bun add -g llms-txt-generator
# or
npm install -g llms-txt-generatorgit 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# Initialize config (optional)
llms-txt init
# Generate from local codebase
llms-txt generate
# Install git hook for auto-updates
llms-txt hook install# 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-scriptsConfig 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"
}
}bun install
bun run dev --help
bun run typecheck
bun run buildMIT