explainthisrepo 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +134 -86
- package/dist/config.js +2 -2
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
# ExplainThisRepo
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
_The fastest way to understand any codebase in plain English using real project signals. Not blind AI summarization._
|
|
4
4
|
|
|
5
|
-
ExplainThisRepo
|
|
6
|
-
|
|
7
|
-
It helps developers quickly understand unfamiliar codebases by deriving architectural explanations from real project structure and code signals, producing a clear, structured `EXPLAIN.md`.
|
|
5
|
+
ExplainThisRepo analyzes real project signals; configs, entrypoints, manifests, dependencies graph, file structure and high-signal files producing a clear, structured `EXPLAIN.md` that explains what the codebase does and how it is organized in plain English.
|
|
8
6
|
|
|
9
7
|
[](https://pypi.org/project/explainthisrepo/)
|
|
10
8
|
[](https://pepy.tech/projects/explainthisrepo)
|
|
@@ -14,45 +12,99 @@ It helps developers quickly understand unfamiliar codebases by deriving architec
|
|
|
14
12
|
[](https://www.npmjs.com/package/explainthisrepo)
|
|
15
13
|
[](https://explainthisrepo.com)
|
|
16
14
|
|
|
17
|
-
---
|
|
18
|
-
|
|
19
15
|

|
|
20
|
-
---
|
|
21
16
|
|
|
22
17
|
## Key Features
|
|
23
18
|
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
- Analyzes local project directories using the same pipeline as GitHub repositories
|
|
31
|
-
- Generates a structured plain-English explanation grounded in actual project files
|
|
19
|
+
- Understand any GitHub repository in seconds
|
|
20
|
+
- Derives architectural summaries from repository structure and code signals.
|
|
21
|
+
Not blind AI summarization.
|
|
22
|
+
- Translates complex code structures into plain English
|
|
23
|
+
- Extract architecture signals from configs, entrypoints, and manifests
|
|
24
|
+
- Works with GitHub repositories, local directories, private repositories, and monorepos
|
|
32
25
|
- Outputs the explanation to an `EXPLAIN.md` file in your current directory or prints it directly in the terminal
|
|
33
|
-
-
|
|
26
|
+
- Multiple explanation modes (quick, simple, detailed)
|
|
34
27
|
|
|
35
|
-
|
|
28
|
+
## Installation
|
|
36
29
|
|
|
37
|
-
|
|
30
|
+
### Option 1: install with pip (recommended):
|
|
38
31
|
|
|
39
|
-
|
|
32
|
+
Requirements: Python 3.9+
|
|
40
33
|
|
|
41
|
-
|
|
34
|
+
```bash
|
|
35
|
+
pip install explainthisrepo
|
|
36
|
+
explainthisrepo owner/repo
|
|
42
37
|
|
|
43
|
-
|
|
38
|
+
# pip install explainthisrepo
|
|
39
|
+
# explainthisrepo .
|
|
40
|
+
```
|
|
44
41
|
|
|
45
|
-
|
|
42
|
+
Alternatively,
|
|
46
43
|
|
|
47
|
-
|
|
44
|
+
```bash
|
|
45
|
+
pipx install explainthisrepo
|
|
46
|
+
explainthisrepo owner/repo
|
|
47
|
+
```
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
To install support for specific models:
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
```bash
|
|
52
|
+
pip install explainthisrepo[gemini]
|
|
53
|
+
pip install explainthisrepo[openai]
|
|
54
|
+
pip install explainthisrepo[anthropic]
|
|
55
|
+
pip install explainthisrepo[groq]
|
|
56
|
+
```
|
|
52
57
|
|
|
53
|
-
|
|
58
|
+
### Option 2: Install with npm
|
|
54
59
|
|
|
55
|
-
|
|
60
|
+
Install globally and use forever:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npm install -g explainthisrepo
|
|
64
|
+
explainthisrepo owner/repo
|
|
65
|
+
|
|
66
|
+
# npm install -g explainthisrepo
|
|
67
|
+
# explainthisrepo .
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Or without install:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npx explainthisrepo owner/repo
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Replace `owner/repo` with the GitHub repository identifier (e.g., `facebook/react`).
|
|
77
|
+
|
|
78
|
+
### Option 3: Download standalone binary
|
|
79
|
+
|
|
80
|
+
Prebuilt standalone binaries are available for macOS, Linux, and Windows.
|
|
81
|
+
|
|
82
|
+
> Standalone binaries require no Python or Node installation and run as a single executable.
|
|
83
|
+
|
|
84
|
+
Download the latest release:
|
|
85
|
+
|
|
86
|
+
[github.com/calchiwo/ExplainThisRepo/releases/latest](https://github.com/calchiwo/ExplainThisRepo/releases/latest)
|
|
87
|
+
|
|
88
|
+
Or install directly:
|
|
89
|
+
|
|
90
|
+
macOS
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
curl -L https://github.com/calchiwo/ExplainThisRepo/releases/latest/download/explainthisrepo-darwin-arm64 -o explainthisrepo
|
|
94
|
+
chmod +x explainthisrepo
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Linux
|
|
98
|
+
```bash
|
|
99
|
+
curl -L https://github.com/calchiwo/ExplainThisRepo/releases/latest/download/explainthisrepo-linux-x64 -o explainthisrepo
|
|
100
|
+
chmod +x explainthisrepo
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Windows (PowerShell)
|
|
104
|
+
|
|
105
|
+
```powershell
|
|
106
|
+
curl -L https://github.com/calchiwo/ExplainThisRepo/releases/latest/download/explainthisrepo-win-x64.exe -o explainthisrepo.exe
|
|
107
|
+
```
|
|
56
108
|
|
|
57
109
|
## Configuration
|
|
58
110
|
|
|
@@ -61,8 +113,9 @@ ExplainThisRepo supports multiple LLM models:
|
|
|
61
113
|
- Gemini
|
|
62
114
|
- OpenAI
|
|
63
115
|
- Ollama (local or cloud-routed)
|
|
64
|
-
|
|
65
|
-
|
|
116
|
+
- Anthropic
|
|
117
|
+
- Groq
|
|
118
|
+
- OpenRouter
|
|
66
119
|
|
|
67
120
|
Use the built-in `init` command to configure your preferred model:
|
|
68
121
|
|
|
@@ -70,49 +123,35 @@ Use the built-in `init` command to configure your preferred model:
|
|
|
70
123
|
explainthisrepo init
|
|
71
124
|
# or npx explainthisrepo init
|
|
72
125
|
```
|
|
126
|
+
|
|
73
127
|
> For details about how initialization works, see [INIT.md](INIT.md).
|
|
74
128
|
|
|
75
|
-
## Installation
|
|
76
129
|
|
|
77
|
-
|
|
130
|
+
## Flag options
|
|
78
131
|
|
|
79
|
-
|
|
132
|
+
- (no flag) → Full repository explanation written to `EXPLAIN.md`
|
|
80
133
|
|
|
81
|
-
|
|
82
|
-
pip install explainthisrepo
|
|
83
|
-
explainthisrepo owner/repo
|
|
84
|
-
```
|
|
134
|
+
- `--quick` → One-sentence summary
|
|
85
135
|
|
|
86
|
-
|
|
136
|
+
- `--simple` → Short, simplified explanation
|
|
87
137
|
|
|
88
|
-
|
|
89
|
-
pipx install explainthisrepo
|
|
90
|
-
explainthisrepo owner/repo
|
|
91
|
-
```
|
|
138
|
+
- `--detailed` → Deeper explanation including structure and architecture
|
|
92
139
|
|
|
93
|
-
|
|
140
|
+
- `--stack` → Tech stack breakdown from repo signals
|
|
94
141
|
|
|
95
|
-
|
|
96
|
-
pip install explainthisrepo[gemini]
|
|
97
|
-
pip install explainthisrepo[openai]
|
|
98
|
-
```
|
|
142
|
+
- `--version` → Check installed CLI version
|
|
99
143
|
|
|
100
|
-
|
|
144
|
+
- `--help` → Show usage guide
|
|
101
145
|
|
|
102
|
-
|
|
103
|
-
```bash
|
|
104
|
-
npm install -g explainthisrepo
|
|
105
|
-
explainthisrepo owner/repo
|
|
106
|
-
# or: npx explainthisrepo owner/repo
|
|
107
|
-
```
|
|
146
|
+
- `--doctor` → Check system health and active model diagnostics
|
|
108
147
|
|
|
109
|
-
|
|
148
|
+
- `--llm` → Override provider selection
|
|
110
149
|
|
|
111
|
-
|
|
150
|
+
- `--token/-t` → Set GitHub token for private repositories and to avoid rate limits
|
|
112
151
|
|
|
113
152
|
## Flexible Repository and Local Directory Input
|
|
114
153
|
|
|
115
|
-
Accepts various formats for repository input, full GitHub URLs, issue links, and SSH clone links
|
|
154
|
+
Accepts various formats for repository input, full GitHub URLs (with or without https), `owner/repo` format, issue links, query strings, and SSH clone links
|
|
116
155
|
|
|
117
156
|
```bash
|
|
118
157
|
explainthisrepo https://github.com/owner/repo
|
|
@@ -126,45 +165,47 @@ explainthisrepo ./path/to/directory
|
|
|
126
165
|
|
|
127
166
|
All inputs are normalized internally to `owner/repo`.
|
|
128
167
|
|
|
129
|
-
---
|
|
130
|
-
|
|
131
168
|
## Model selection
|
|
132
169
|
|
|
133
|
-
The `--llm` flag
|
|
170
|
+
The `--llm` flag selects which configured model backend to use for the current command.
|
|
134
171
|
|
|
135
172
|
```bash
|
|
136
173
|
explainthisrepo owner/repo --llm gemini
|
|
137
174
|
explainthisrepo owner/repo --llm openai
|
|
138
175
|
explainthisrepo owner/repo --llm ollama
|
|
176
|
+
explainthisrepo owner/repo --llm anthropic
|
|
177
|
+
explainthisrepo owner/repo --llm openrouter
|
|
178
|
+
explainthisrepo owner/repo --llm groq
|
|
139
179
|
```
|
|
140
180
|
|
|
141
181
|
`--llm` works with all modes (``--quick``, ``--simple``, ``--detailed``).
|
|
142
182
|
|
|
143
|
-
##
|
|
183
|
+
## Command line usage
|
|
144
184
|
|
|
145
|
-
###
|
|
185
|
+
### Default
|
|
146
186
|
Writes a full explanation to `EXPLAIN.md`:
|
|
147
187
|
|
|
148
188
|
```bash
|
|
149
189
|
explainthisrepo owner/repo
|
|
190
|
+
#e.g. explainthisrepo vercel/next.js
|
|
150
191
|
```
|
|
151
|
-
Example:
|
|
152
|
-
```bash
|
|
153
|
-
explainthisrepo facebook/react
|
|
154
|
-
```
|
|
155
|
-
---
|
|
156
192
|
|
|
157
193
|
### Quick mode
|
|
158
194
|
|
|
159
195
|
Prints a one-sentence summary to stdout:
|
|
160
|
-
|
|
161
196
|
```bash
|
|
162
197
|
explainthisrepo owner/repo --quick
|
|
198
|
+
# explainthisrepo facebook/react --quick
|
|
163
199
|
```
|
|
164
|
-
|
|
200
|
+
|
|
165
201
|
```bash
|
|
166
|
-
explainthisrepo
|
|
202
|
+
$ explainthisrepo vercel/next.js --quick
|
|
203
|
+
|
|
204
|
+
Next.js is a React framework that provides server-side rendering,
|
|
205
|
+
file-based routing, API routes, and build tooling for fullstack
|
|
206
|
+
web applications.
|
|
167
207
|
```
|
|
208
|
+
|
|
168
209
|

|
|
169
210
|
|
|
170
211
|
---
|
|
@@ -222,42 +263,41 @@ explainthisrepo . --stack
|
|
|
222
263
|
|
|
223
264
|
When analyzing a local directory:
|
|
224
265
|
- Repository structure is derived from the filesystem
|
|
225
|
-
- High signal files (
|
|
266
|
+
- High signal files (configs, entrypoints, manifests) are extracted locally
|
|
226
267
|
- No GitHub APIs calls are made
|
|
227
268
|
- All prompts and outputs remain identical
|
|
228
269
|
|
|
229
270
|
This allows analysis of projects directly from the local filesystem, without requiring a GitHub repository.
|
|
230
271
|
|
|
231
|
-
###
|
|
272
|
+
### For private repositories, use the --token/-t option.
|
|
232
273
|
|
|
233
|
-
|
|
274
|
+
Setting a `GITHUB_TOKEN` environment variable is recommended to avoid rate limits when analyzing public repositories.
|
|
234
275
|
|
|
235
276
|
```bash
|
|
236
|
-
|
|
277
|
+
export GITHUB_TOKEN=yourActualTokenHere
|
|
237
278
|
```
|
|
238
279
|
|
|
239
|
-
|
|
280
|
+
### Version
|
|
240
281
|
|
|
241
|
-
|
|
242
|
-
Use the `--doctor` flag to verify the environment, network connectivity, and API key configuration:
|
|
282
|
+
Check the installed CLI version:
|
|
243
283
|
|
|
244
284
|
```bash
|
|
245
|
-
explainthisrepo --
|
|
285
|
+
explainthisrepo --version
|
|
246
286
|
```
|
|
247
287
|
|
|
248
|
-
###
|
|
288
|
+
### Diagnostics
|
|
249
289
|
|
|
250
|
-
|
|
290
|
+
Use the `--doctor` flag to verify the environment, network connectivity, and API key configuration:
|
|
251
291
|
|
|
252
292
|
```bash
|
|
253
|
-
|
|
293
|
+
explainthisrepo --doctor
|
|
254
294
|
```
|
|
255
295
|
|
|
256
296
|
## Termux (Android) install notes
|
|
257
297
|
|
|
258
298
|
Termux has some environment limitations that can make `pip install explainthisrepo` fail to create the `explainthisrepo` command in `$PREFIX/bin`.
|
|
259
299
|
|
|
260
|
-
|
|
300
|
+
However, it's recommended you install using:
|
|
261
301
|
|
|
262
302
|
```bash
|
|
263
303
|
pip install --user -U explainthisrepo
|
|
@@ -269,7 +309,7 @@ Make sure your user bin directory is on your PATH:
|
|
|
269
309
|
export PATH="$HOME/.local/bin:$PATH"
|
|
270
310
|
```
|
|
271
311
|
|
|
272
|
-
> Tip: Add the PATH export to your
|
|
312
|
+
> Tip: Add the PATH export to your `~/.bashrc` or `~/.zshrc` so it persists.
|
|
273
313
|
|
|
274
314
|
### Alternative (No PATH changes)
|
|
275
315
|
|
|
@@ -287,6 +327,18 @@ Installing Gemini support may require building Rust-based dependencies on Androi
|
|
|
287
327
|
pip install --user -U "explainthisrepo[gemini]"
|
|
288
328
|
```
|
|
289
329
|
|
|
330
|
+
For mobile environments like Termux where compiling Python dependencies can be slow,
|
|
331
|
+
you can also run ExplainThisRepo using the Node.js version:
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
npx explainthisrepo owner/repo
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
## Special Thanks
|
|
338
|
+
|
|
339
|
+
- @Spectra010s for implementing the Node.js version of ExplainThisRepo and improving installation support for mobile environments like Termux
|
|
340
|
+
- @HalxDocs for implementing the `--detailed` mode for deeper architectural explanations
|
|
341
|
+
|
|
290
342
|
## Contributions
|
|
291
343
|
|
|
292
344
|
Contributions are welcome!
|
|
@@ -296,14 +348,10 @@ If you find a bug, have an idea, or want to improve the tool:
|
|
|
296
348
|
- Open an issue for bugs/feature requests
|
|
297
349
|
- Or submit a pull request for fixes/improvements
|
|
298
350
|
|
|
299
|
-
---
|
|
300
|
-
|
|
301
351
|
## License
|
|
302
352
|
|
|
303
353
|
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
|
304
354
|
|
|
305
|
-
---
|
|
306
|
-
|
|
307
355
|
## Author
|
|
308
356
|
|
|
309
357
|
Caleb Wodi
|
package/dist/config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import
|
|
4
|
+
import { parse } from "@iarna/toml";
|
|
5
5
|
const CONFIG_DIR_NAME = "ExplainThisRepo";
|
|
6
6
|
const CONFIG_FILE_NAME = "config.toml";
|
|
7
7
|
export function getConfigPath() {
|
|
@@ -38,7 +38,7 @@ export function loadConfig() {
|
|
|
38
38
|
return {};
|
|
39
39
|
}
|
|
40
40
|
try {
|
|
41
|
-
return
|
|
41
|
+
return parse(raw);
|
|
42
42
|
}
|
|
43
43
|
catch (err) {
|
|
44
44
|
throw new Error("Invalid config.toml format");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "explainthisrepo",
|
|
3
|
-
"version": "0.9.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.9.2",
|
|
4
|
+
"description": "The fastest way to understand any codebase in plain English. Not blind AI summarization",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": "Caleb Wodi <calebwodi33@gmail.com>",
|
|
@@ -27,7 +27,9 @@
|
|
|
27
27
|
"developer-tools"
|
|
28
28
|
],
|
|
29
29
|
"bin": {
|
|
30
|
-
"explainthisrepo": "dist/cli.js"
|
|
30
|
+
"explainthisrepo": "dist/cli.js",
|
|
31
|
+
"explain-this-repo": "dist/cli.js",
|
|
32
|
+
"etr": "dist/cli.js"
|
|
31
33
|
},
|
|
32
34
|
"files": [
|
|
33
35
|
"dist",
|
|
@@ -50,7 +52,8 @@
|
|
|
50
52
|
"commander": "^14.0.3",
|
|
51
53
|
"dotenv": "^17.2.3",
|
|
52
54
|
"openai": "^4.0.0",
|
|
53
|
-
"ora": "^9.3.0"
|
|
55
|
+
"ora": "^9.3.0",
|
|
56
|
+
"toml": "^3.0.0"
|
|
54
57
|
},
|
|
55
58
|
"devDependencies": {
|
|
56
59
|
"@types/node": "^22.0.0",
|