@@ -44,25 +44,36 @@ uv pip install -e ".[dev]"
4444
4545## Usage
4646
47- ``` python
48- # Basic usage
47+ ``` bash
48+ # Generate llms.txt from current directory
4949python llms.py
50-
51- # The script will:
52- # 1. Scan the current directory
53- # 2. Process files according to .gitignore rules
54- # 3. Generate llms.txt with compressed content
5550```
5651
52+ The script will:
53+
54+ 1 . Scan the current directory recursively
55+ 2 . Process files according to .gitignore rules
56+ 3 . Generate ` llms.txt ` with compressed content
57+
5758## Output Format
5859
5960The generated ` llms.txt ` file follows this structure:
6061
61- ``` python
62- # Project metadata
63- < file > path/ to/ file .py< / file >
62+ ``` python
63+ # Project: llmstxt
64+
65+ # # Project Structure
66+ This file contains the compressed and processed contents of the project.
67+
68+ # ## File Types
69+ - .py
70+ - .js
71+ - .java
72+ ...
73+
74+ < file > src/ main.py< / file >
6475< metadata>
65- path: path / to / file .py
76+ path: src / main .py
6677type : py
6778size: 1234 bytes
6879< / metadata>
@@ -77,13 +88,38 @@ def example():
7788 """ Docstring preserved."""
7889 return True
7990< / code>
91+
92+ < file > src/ utils.js< / file >
93+ < metadata>
94+ path: src/ utils.js
95+ type : js
96+ size: 567 bytes
97+ < / metadata>
98+
99+ < code lang= ' javascript' >
100+ function helper() {
101+ return true;
102+ }
103+ < / code>
80104```
81105
82106## Configuration
83107
84- - Maximum file size: 100KB (configurable)
85- - Supported file extensions: .py, .js, .java, .c, .cpp, .h, .hpp, .sh, .txt, .md, .json, .xml, .yaml, .yml, .toml, .ini
86- - Respects .gitignore rules
108+ The tool can be configured through function parameters:
109+
110+ ``` python
111+ generate_llms_txt(
112+ output_file = " llms.txt" , # Output filename
113+ max_file_size = 100 * 1024 , # Max file size (100KB)
114+ allowed_extensions = ( # Supported file types
115+ " .py" , " .js" , " .java" ,
116+ " .c" , " .cpp" , " .h" , " .hpp" ,
117+ " .sh" , " .txt" , " .md" ,
118+ " .json" , " .xml" , " .yaml" ,
119+ " .yml" , " .toml" , " .ini"
120+ )
121+ )
122+ ```
87123
88124## Development
89125
0 commit comments