@@ -195,8 +195,10 @@ explainthisrepo github.com/owner/repo
195195explainthisrepo https://github.com/owner/repo/issues/123
196196explainthisrepo https://github.com/owner/repo? tab=readme
197197explainthisrepo git@github.com:owner/repo.git
198+ explainthisrepo owner/repo/path/to/file.py
198199explainthisrepo .
199200explainthisrepo ./path/to/directory
201+ explainthisrepo ./path/to/file.py
200202```
201203
202204All inputs are normalized internally to ` owner/repo ` .
@@ -344,6 +346,38 @@ When analyzing a file:
344346- The explanation focuses on purpose, logic, and behavior
345347- This makes it easy to understand unfamiliar files without scanning entire repositories.
346348
349+ ## GitHub File Analysis
350+
351+ ExplainThisRepo can analyze a single file directly from a GitHub repository without cloning it.
352+
353+ ``` bash
354+ explainthisrepo owner/repo/path/to/file.py
355+ ```
356+ Supports all explanation modes:
357+
358+ ``` bash
359+ explainthisrepo owner/repo/path/to/file.py --quick
360+ explainthisrepo owner/repo/path/to/file.py --simple
361+ explainthisrepo owner/repo/path/to/file.py --detailed
362+ ```
363+
364+ When analyzing a GitHub file:
365+ - The file is fetched directly via the GitHub API
366+ - Only valid text files are processed (binary files are rejected)
367+ - File size is capped to prevent unsafe or truncated analysis
368+ - The explanation focuses on the file’s purpose, logic, and behavior
369+
370+ Input format must be:
371+
372+ ``` bash
373+ explainthisrepo owner/repo/path/to/file
374+ ```
375+
376+ This is different from local file analysis:
377+
378+ ``` bash
379+ explainthisrepo ./path/to/file.py
380+ ```
347381### Custom output
348382
349383` --output ` , ` -o ` → Specify output file or directory (default: ` EXPLAIN.md ` )
0 commit comments