A CLI tool that generates codebase context for LLMs
npm install llmify> A CLI tool that generates a comprehensive text file containing your codebase context for Large Language Models (LLMs)



- š Visual Project Structure - Crawls project directories and creates a tree structure
- š File Content Extraction - Includes the content of all relevant text files
- š§ Context Optimization - Formats output in a way that's optimized for LLM context
- š Intelligent Filtering - Respects .gitignore and .llmignore patterns
- š ļø Highly Customizable - Control depth, paths, include/exclude patterns
Download the appropriate binary for your platform from the Releases page.
``bashClone the repository
git clone https://github.com/username/llmify.git
cd llmify
š Quick Start
`bash
Basic usage - creates llm.txt in the current directory
llmifyPaste into your favorite LLM
cat llm.txt | pbcopy # macOS
cat llm.txt | xclip # Linux
type llm.txt | clip # Windows
`š©āš» Usage Examples
`bash
Specify a different root directory
llmify /path/to/your/projectSpecify a different output file
llmify -o context_for_gpt.txtOnly include content from a specific subdirectory or file
llmify -p src/components
llmify --path main.goExclude specific patterns
llmify -e ".log" -e "/.cache/"Include specific files that would otherwise be excluded
llmify -i "config/important.json"Limit directory depth for large projects
llmify -d 3Disable .gitignore processing
llmify --no-gitignoreSee detailed output (helpful for debugging)
llmify -v
`š§ Using
.llmignoreCreate a
.llmignore file in your project's root directory to specify patterns that should be excluded from LLM context. This uses the same syntax as .gitignore. These rules apply after the --path filter, if used.Example
.llmignore:`
Exclude large data files
data/*.csv
*.json.gzExclude generated documentation
docs/generated/Exclude specific libraries
lib/external/
`šÆ Full CLI Options
`
Usage:
llmify [directory] [flags]Flags:
-e, --exclude strings Glob patterns to exclude (can be used multiple times)
--exclude-binary Attempt to exclude binary files based on content detection (default: true)
--header Include a header with project info (default: true)
-i, --include strings Glob patterns to include (overrides excludes, use carefully)
-d, --max-depth int Maximum directory depth to crawl (0 for unlimited)
--no-gitignore Do not use .gitignore rules
--no-llmignore Do not use .llmignore rules
-o, --output string Name of the output file (default "llm.txt")
-p, --path string Only include files/directories within this specific relative path
-v, --verbose Enable verbose logging
-h, --help Display help information
`š” Example Output
Click to see example output
`
============================================================
Project Root: /path/to/your/project
Generated At: 2023-06-15T10:30:45Z
============================================================File Tree Structure
`
yourproject/
āāā .gitignore
āāā main.go
āāā utils.go
āāā docs/
āāā README.md
āāā usage.md
`============================================================
File Contents
$3
`
node_modules/
*.log
dist/
`---
$3
`go
package mainimport (
"fmt"
)
func main() {
fmt.Println("Hello, world!")
}
`---
$3
`go
package main// ... file content here ...
`
``MIT License - See LICENSE file for details.
---
Made with ā¤ļø for better LLM interactions
Star on GitHub