git-creeper 1.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 levantedev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,134 @@
1
+ # πŸ“– git-creeper
2
+
3
+ > Creep on your git history with smart insights and analytics
4
+
5
+ [![npm version](https://img.shields.io/npm/v/git-creeper.svg)](https://www.npmjs.com/package/git-creeper)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ A powerful CLI tool that analyzes git repositories with beautiful visualizations, statistics, and AI-powered features for smarter development workflows.
9
+
10
+ ## ✨ Features
11
+
12
+ ### πŸ€– Smart Features
13
+ - **Smart Commit Messages** - Pattern-based commit suggestions
14
+ - **Code Review Assistant** - Rule-based code analysis
15
+ - **Bug Risk Prediction** - Historical pattern analysis
16
+ - **Refactor Suggestions** - Code quality recommendations
17
+
18
+ ### πŸ“Š Analytics
19
+ - **Timeline** - Visual commit history
20
+ - **Statistics** - Repository metrics and patterns
21
+ - **Hotspots** - Frequently changed files
22
+ - **Contributors** - Team activity analysis
23
+ - **Insights** - Smart recommendations
24
+
25
+ ### πŸ” Tools
26
+ - **Changelog** - Auto-generate from commits
27
+ - **Compare** - Diff between branches/commits
28
+ - **Search** - Powerful commit search
29
+ - **Visualize** - ASCII charts and heatmaps
30
+ - **Export** - JSON, Markdown, HTML reports
31
+
32
+ ## πŸš€ Installation
33
+
34
+ ```bash
35
+ npm install -g git-creeper
36
+ ```
37
+
38
+ ## πŸ“š Usage
39
+
40
+ ```bash
41
+ # Show help
42
+ git-creeper
43
+
44
+ # Core features
45
+ git-creeper stats
46
+ git-creeper timeline
47
+ git-creeper hotspots
48
+
49
+ # AI features
50
+ git-creeper smart-commit
51
+ git-creeper review
52
+ git-creeper bug-risk
53
+ git-creeper refactor
54
+
55
+ # Analysis
56
+ git-creeper insights
57
+ git-creeper visualize
58
+ git-creeper export
59
+ ```
60
+
61
+ ## πŸ€– Smart Features
62
+
63
+ ### Smart Commit Messages
64
+ ```bash
65
+ git add .
66
+ git-creeper smart-commit
67
+ ```
68
+ Get intelligent commit suggestions based on file changes and patterns.
69
+
70
+ ### Code Review
71
+ ```bash
72
+ git add src/
73
+ git-creeper review
74
+ ```
75
+ Pattern-based review detecting issues like debug statements, long lines, and code quality problems.
76
+
77
+ ### Bug Risk Prediction
78
+ ```bash
79
+ git-creeper bug-risk
80
+ ```
81
+ Identify files with high bug probability based on historical patterns.
82
+
83
+ ### Refactor Suggestions
84
+ ```bash
85
+ git-creeper refactor
86
+ ```
87
+ Get recommendations for code improvements based on static analysis.
88
+
89
+ ## 🌍 Multi-Language
90
+
91
+ Supports English and Turkish with auto-detection:
92
+
93
+ ```bash
94
+ git-creeper lang tr # Turkish
95
+ git-creeper lang en # English
96
+ git-creeper lang auto # Auto-detect
97
+ ```
98
+
99
+ ## οΏ½ Example Output
100
+
101
+ ```
102
+ ╔════════════════════════════════════════════════════════════╗
103
+ β•‘ SMART COMMIT MESSAGE SUGGESTIONS β•‘
104
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
105
+
106
+ πŸ“ Suggested commit messages:
107
+ 1. feat: add user authentication system
108
+ 2. fix: resolve memory leak in parser
109
+ 3. refactor: improve error handling
110
+ 4. test: add unit tests for auth module
111
+ ```
112
+
113
+ ## πŸ› οΈ Requirements
114
+
115
+ - Node.js >= 14.0.0
116
+ - Git repository
117
+
118
+ ## πŸ“„ License
119
+
120
+ MIT Β© levantedev
121
+
122
+ ## οΏ½ Links
123
+
124
+ - [npm Package](https://www.npmjs.com/package/git-creeper)
125
+ - [GitHub Repository](https://github.com/levantedev/git-creeper)
126
+ - [Report Issues](https://github.com/levantedev/git-creeper/issues)
127
+
128
+ ---
129
+
130
+ <div align="center">
131
+
132
+ **Made with ❀️ by @levantedev**
133
+
134
+ </div>
package/bin/cli.js ADDED
@@ -0,0 +1,174 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { program } = require('commander');
4
+ const {
5
+ timeline,
6
+ hotspots,
7
+ changelog,
8
+ blameAnalysis,
9
+ showHelp,
10
+ stats,
11
+ contributors,
12
+ compare,
13
+ search,
14
+ insights,
15
+ exportData,
16
+ visualize,
17
+ setLang,
18
+ smartCommitMessage,
19
+ codeReviewAssistant,
20
+ bugPrediction,
21
+ refactorSuggestions
22
+ } = require('../src/index');
23
+ const { setLocale } = require('../src/i18n');
24
+
25
+ program
26
+ .name('git-creeper')
27
+ .description('Transform your git history into meaningful stories')
28
+ .version('1.0.1', '-v, --version', 'Display version number')
29
+ .addHelpCommand(false)
30
+ .action(() => {
31
+ // Default action when no command is provided
32
+ showHelp();
33
+ });
34
+
35
+ // Set language before executing commands
36
+ program.hook('preAction', (thisCommand) => {
37
+ const options = thisCommand.opts();
38
+ if (options.lang) {
39
+ setLocale(options.lang);
40
+ }
41
+ });
42
+
43
+ program
44
+ .command('timeline')
45
+ .description('Show project evolution timeline')
46
+ .option('-d, --days <number>', 'Number of days to analyze', '30')
47
+ .action(async (options) => {
48
+ await timeline(options);
49
+ });
50
+
51
+ program
52
+ .command('hotspots')
53
+ .description('Find most frequently changed files')
54
+ .option('-l, --limit <number>', 'Number of files to show', '10')
55
+ .action(async (options) => {
56
+ await hotspots(options);
57
+ });
58
+
59
+ program
60
+ .command('changelog')
61
+ .description('Generate smart changelog')
62
+ .option('-f, --from <tag>', 'Starting tag/commit')
63
+ .option('-t, --to <tag>', 'Ending tag/commit', 'HEAD')
64
+ .action(async (options) => {
65
+ await changelog(options);
66
+ });
67
+
68
+ program
69
+ .command('blame-smart <file>')
70
+ .description('Advanced blame analysis for a file')
71
+ .action(async (file) => {
72
+ await blameAnalysis(file);
73
+ });
74
+
75
+ program
76
+ .command('stats')
77
+ .description('Show repository statistics')
78
+ .action(async () => {
79
+ await stats();
80
+ });
81
+
82
+ program
83
+ .command('contributors')
84
+ .description('Analyze contributors and their activity')
85
+ .action(async () => {
86
+ await contributors();
87
+ });
88
+
89
+ program
90
+ .command('compare')
91
+ .description('Compare two branches or commits')
92
+ .option('-f, --from <ref>', 'Starting reference', 'HEAD~10')
93
+ .option('-t, --to <ref>', 'Ending reference', 'HEAD')
94
+ .action(async (options) => {
95
+ await compare(options);
96
+ });
97
+
98
+ program
99
+ .command('search <query>')
100
+ .description('Search commits by message')
101
+ .option('-a, --author <name>', 'Filter by author')
102
+ .option('-s, --since <date>', 'Filter by date (e.g., "2 weeks ago")')
103
+ .action(async (query, options) => {
104
+ await search(query, options);
105
+ });
106
+
107
+ program
108
+ .command('insights')
109
+ .description('Get smart insights about your repository')
110
+ .action(async () => {
111
+ await insights();
112
+ });
113
+
114
+ program
115
+ .command('export')
116
+ .description('Export data to file')
117
+ .option('-f, --format <type>', 'Export format (json, markdown, html)', 'json')
118
+ .option('-o, --output <file>', 'Output file name', 'git-creeper-report')
119
+ .action(async (options) => {
120
+ await exportData(options);
121
+ });
122
+
123
+ program
124
+ .command('visualize')
125
+ .description('Show ASCII visualizations')
126
+ .option('-t, --type <type>', 'Visualization type (frequency, heatmap, trends)', 'frequency')
127
+ .action(async (options) => {
128
+ await visualize(options);
129
+ });
130
+
131
+ // NEW AI-POWERED COMMANDS
132
+ program
133
+ .command('smart-commit')
134
+ .description('Get AI-powered commit message suggestions')
135
+ .action(async () => {
136
+ await smartCommitMessage();
137
+ });
138
+
139
+ program
140
+ .command('review')
141
+ .description('AI-powered code review for staged changes')
142
+ .action(async () => {
143
+ await codeReviewAssistant();
144
+ });
145
+
146
+ program
147
+ .command('bug-risk')
148
+ .description('Predict files with high bug risk')
149
+ .action(async () => {
150
+ await bugPrediction();
151
+ });
152
+
153
+ program
154
+ .command('refactor')
155
+ .description('Get code quality and refactoring suggestions')
156
+ .action(async () => {
157
+ await refactorSuggestions();
158
+ });
159
+
160
+ program
161
+ .command('help')
162
+ .description('Show detailed help and examples')
163
+ .action(() => {
164
+ showHelp();
165
+ });
166
+
167
+ program
168
+ .command('lang <locale>')
169
+ .description('Set default language (en, tr)')
170
+ .action((locale) => {
171
+ setLang(locale);
172
+ });
173
+
174
+ program.parse();
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "git-creeper",
3
+ "version": "1.0.1",
4
+ "description": "Creep on your git repositories with smart analytics and insights",
5
+ "main": "src/index.js",
6
+ "bin": {
7
+ "git-creeper": "bin/cli.js"
8
+ },
9
+ "scripts": {
10
+ "creeper": "node bin/cli.js",
11
+ "test": "echo \"Error: no test specified\" && exit 1"
12
+ },
13
+ "keywords": [
14
+ "git",
15
+ "history",
16
+ "changelog",
17
+ "analytics",
18
+ "visualization",
19
+ "cli",
20
+ "developer-tools",
21
+ "git-analysis",
22
+ "commit-history",
23
+ "repository-insights",
24
+ "code-metrics",
25
+ "team-analytics"
26
+ ],
27
+ "author": "GΓΆrkem",
28
+ "license": "MIT",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/levantedev/git-creeper.git"
32
+ },
33
+ "bugs": {
34
+ "url": "https://github.com/levantedev/git-creeper/issues"
35
+ },
36
+ "homepage": "https://github.com/levantedev/git-creeper#readme",
37
+ "dependencies": {
38
+ "simple-git": "^3.22.0",
39
+ "chalk": "^4.1.2",
40
+ "commander": "^11.1.0"
41
+ },
42
+ "engines": {
43
+ "node": ">=14.0.0"
44
+ },
45
+ "files": [
46
+ "bin/",
47
+ "src/",
48
+ "README.md",
49
+ "LICENSE"
50
+ ]
51
+ }
package/src/config.js ADDED
@@ -0,0 +1,54 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const os = require('os');
4
+
5
+ const CONFIG_DIR = path.join(os.homedir(), '.git-creeper');
6
+ const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
7
+
8
+ function ensureConfigDir() {
9
+ if (!fs.existsSync(CONFIG_DIR)) {
10
+ fs.mkdirSync(CONFIG_DIR, { recursive: true });
11
+ }
12
+ }
13
+
14
+ function loadConfig() {
15
+ try {
16
+ if (fs.existsSync(CONFIG_FILE)) {
17
+ const data = fs.readFileSync(CONFIG_FILE, 'utf8');
18
+ return JSON.parse(data);
19
+ }
20
+ } catch (error) {
21
+ // Ignore errors, return default config
22
+ }
23
+ return { language: 'auto' };
24
+ }
25
+
26
+ function saveConfig(config) {
27
+ try {
28
+ ensureConfigDir();
29
+ fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2), 'utf8');
30
+ return true;
31
+ } catch (error) {
32
+ console.error('Failed to save config:', error.message);
33
+ return false;
34
+ }
35
+ }
36
+
37
+ function getLanguage() {
38
+ const config = loadConfig();
39
+ return config.language || 'auto';
40
+ }
41
+
42
+ function setLanguage(lang) {
43
+ const config = loadConfig();
44
+ config.language = lang;
45
+ return saveConfig(config);
46
+ }
47
+
48
+ module.exports = {
49
+ loadConfig,
50
+ saveConfig,
51
+ getLanguage,
52
+ setLanguage,
53
+ CONFIG_FILE
54
+ };
package/src/i18n.js ADDED
@@ -0,0 +1,51 @@
1
+ const en = require('./locales/en');
2
+ const tr = require('./locales/tr');
3
+ const { getLanguage } = require('./config');
4
+
5
+ const locales = { en, tr };
6
+
7
+ let currentLocale = 'en';
8
+
9
+ // Detect system language
10
+ function detectLanguage() {
11
+ const lang = process.env.LANG || process.env.LANGUAGE || process.env.LC_ALL || '';
12
+ if (lang.toLowerCase().includes('tr')) return 'tr';
13
+ return 'en';
14
+ }
15
+
16
+ function setLocale(locale) {
17
+ if (locales[locale]) {
18
+ currentLocale = locale;
19
+ return true;
20
+ }
21
+ return false;
22
+ }
23
+
24
+ function t(path) {
25
+ const keys = path.split('.');
26
+ let value = locales[currentLocale];
27
+
28
+ for (const key of keys) {
29
+ if (value && typeof value === 'object') {
30
+ value = value[key];
31
+ } else {
32
+ return path; // Return path if translation not found
33
+ }
34
+ }
35
+
36
+ return value || path;
37
+ }
38
+
39
+ // Load saved language preference or auto-detect
40
+ function initLanguage() {
41
+ const savedLang = getLanguage();
42
+ if (savedLang === 'auto') {
43
+ currentLocale = detectLanguage();
44
+ } else {
45
+ currentLocale = savedLang;
46
+ }
47
+ }
48
+
49
+ initLanguage();
50
+
51
+ module.exports = { t, setLocale, getCurrentLocale: () => currentLocale };