@lazykedar/lazydocs 1.3.0 → 2.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.
@@ -76,7 +76,7 @@ jobs:
76
76
  ## Installation
77
77
 
78
78
  ```bash
79
- npm install -g @tfkedar/lazydocs@${{ steps.get_version.outputs.VERSION }}
79
+ npm install -g @lazykedar/lazydocs@${{ steps.get_version.outputs.VERSION }}
80
80
  ```
81
81
 
82
82
  ## Quick Start
@@ -91,7 +91,7 @@ jobs:
91
91
 
92
92
  ## Links
93
93
 
94
- - [NPM Package](https://www.npmjs.com/package/@tfkedar/lazydocs)
94
+ - [NPM Package](https://www.npmjs.com/package/@lazykedar/lazydocs)
95
95
  - [Documentation](https://github.com/${{ github.repository }}#readme)
96
96
  - [Changelog](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md)
97
97
  draft: false
package/README.md CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  AI-powered documentation generator using Groq. Generate READMEs, PR descriptions, and changelogs in seconds.
4
4
 
5
- [![npm](https://img.shields.io/npm/v/@tfkedar/lazydocs)](https://www.npmjs.com/package/@tfkedar/lazydocs)
5
+ [![npm](https://img.shields.io/npm/v/@lazykedar/lazydocs)](https://www.npmjs.com/package/@lazykedar/lazydocs)
6
6
  [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
 
8
8
  ## Install
9
9
 
10
10
  ```bash
11
- npm install -g @tfkedar/lazydocs
11
+ npm install -g @lazykedar/lazydocs
12
12
  ```
13
13
 
14
14
  ## Setup
@@ -46,6 +46,12 @@ lazydocs generate --type changelog
46
46
 
47
47
  ## Configuration
48
48
 
49
+ Interactive setup (recommended):
50
+ ```bash
51
+ lazydocs config setup
52
+ ```
53
+
54
+ Or configure parameters individually:
49
55
  ```bash
50
56
  lazydocs config set GROQ_API_KEY=your_key
51
57
  lazydocs config list
@@ -144,7 +150,7 @@ Popular models:
144
150
 
145
151
  ## Links
146
152
 
147
- - [NPM Package](https://www.npmjs.com/package/@tfkedar/lazydocs)
153
+ - [NPM Package](https://www.npmjs.com/package/@lazykedar/lazydocs)
148
154
  - [GitHub](https://github.com/kedar49/lazydocs)
149
155
  - [Issues](https://github.com/kedar49/lazydocs/issues)
150
156
  - [Groq Console](https://console.groq.com)
package/dist/cli.js CHANGED
@@ -43,6 +43,7 @@ const p_1 = require("./o/p");
43
43
  const c_1 = require("./o/c");
44
44
  const ai_1 = require("./ai");
45
45
  const config_manager_1 = require("./utils/config-manager");
46
+ // Helper to log errors locally
46
47
  const logError = (message) => {
47
48
  const logDir = path.join(process.cwd(), 'logs');
48
49
  if (!fs.existsSync(logDir))
@@ -51,10 +52,27 @@ const logError = (message) => {
51
52
  fs.appendFileSync(logFile, `${new Date().toISOString()} - ${message}\n`);
52
53
  };
53
54
  const program = new commander.Command();
55
+ // Dynamically resolve version from package.json
56
+ let version = '2.0.1';
57
+ try {
58
+ const pkgPath = path.join(__dirname, '../package.json');
59
+ if (fs.existsSync(pkgPath)) {
60
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
61
+ version = pkg.version || version;
62
+ }
63
+ else {
64
+ const devPkgPath = path.join(__dirname, 'package.json');
65
+ if (fs.existsSync(devPkgPath)) {
66
+ const pkg = JSON.parse(fs.readFileSync(devPkgPath, 'utf-8'));
67
+ version = pkg.version || version;
68
+ }
69
+ }
70
+ }
71
+ catch { }
54
72
  program
55
73
  .name('lazydocs')
56
74
  .description('AI-powered documentation generator using Groq')
57
- .version('1.1.0');
75
+ .version(version);
58
76
  // Config commands
59
77
  const configCmd = program.command('config');
60
78
  configCmd
@@ -138,6 +156,67 @@ configCmd
138
156
  process.exit(1);
139
157
  }
140
158
  });
159
+ configCmd
160
+ .command('setup')
161
+ .description('Interactively setup configuration parameters')
162
+ .action(async () => {
163
+ try {
164
+ console.log('--- LazyDocs Configuration Setup ---\n');
165
+ const answers = await inquirer.default.prompt([
166
+ {
167
+ type: 'password',
168
+ name: 'GROQ_API_KEY',
169
+ message: 'Enter your Groq API key (starts with gsk_):',
170
+ validate: (input) => {
171
+ if (!input)
172
+ return 'API key is required!';
173
+ if (!input.startsWith('gsk_'))
174
+ return 'API key must start with "gsk_"';
175
+ if (input.length <= 20)
176
+ return 'API key format is invalid';
177
+ return true;
178
+ },
179
+ },
180
+ {
181
+ type: 'list',
182
+ name: 'DEFAULT_MODEL',
183
+ message: 'Select default AI model:',
184
+ choices: (0, ai_1.getFallbackModels)(),
185
+ default: 'llama-3.3-70b-versatile',
186
+ },
187
+ {
188
+ type: 'input',
189
+ name: 'TEMPERATURE',
190
+ message: 'Default temperature (0.0 to 2.0):',
191
+ default: '0.7',
192
+ validate: (input) => {
193
+ const val = parseFloat(input);
194
+ return (!isNaN(val) && val >= 0 && val <= 2) ? true : 'Must be a number between 0 and 2';
195
+ }
196
+ },
197
+ {
198
+ type: 'input',
199
+ name: 'MAX_TOKENS',
200
+ message: 'Default maximum tokens (100 to 131072):',
201
+ default: '2048',
202
+ validate: (input) => {
203
+ const val = parseInt(input, 10);
204
+ return (!isNaN(val) && val >= 100 && val <= 131072) ? true : 'Must be an integer between 100 and 131072';
205
+ }
206
+ }
207
+ ]);
208
+ (0, config_manager_1.setConfig)('GROQ_API_KEY', answers.GROQ_API_KEY);
209
+ (0, config_manager_1.setConfig)('DEFAULT_MODEL', answers.DEFAULT_MODEL);
210
+ (0, config_manager_1.setConfig)('TEMPERATURE', answers.TEMPERATURE);
211
+ (0, config_manager_1.setConfig)('MAX_TOKENS', answers.MAX_TOKENS);
212
+ console.log('\n✔ LazyDocs configuration successfully updated and saved in ~/.lazydocs!');
213
+ }
214
+ catch (error) {
215
+ logError(`Config setup error: ${error.message}`);
216
+ console.error(`Error: ${error.message}`);
217
+ process.exit(1);
218
+ }
219
+ });
141
220
  // Generate command
142
221
  program
143
222
  .command('generate')
@@ -340,7 +419,7 @@ program
340
419
  .action(async (options) => {
341
420
  try {
342
421
  if (options.refresh) {
343
- let apiKey;
422
+ let apiKey = '';
344
423
  try {
345
424
  const config = (0, config_manager_1.getConfig)({}, true);
346
425
  apiKey = config.GROQ_API_KEY;
package/dist/o/p.js CHANGED
@@ -40,6 +40,7 @@ exports.generatePrDesc = generatePrDesc;
40
40
  const fs = __importStar(require("fs"));
41
41
  const simple_git_1 = __importDefault(require("simple-git"));
42
42
  const ai_1 = require("../ai");
43
+ // Generate professional pull request description from git diff
43
44
  async function generatePrDesc(inputDir, outputFile, apiKey, aiOptions, gitOptions) {
44
45
  console.log('Analyzing git changes...');
45
46
  const git = (0, simple_git_1.default)(inputDir);
package/dist/o/r.js CHANGED
@@ -40,6 +40,7 @@ const path = __importStar(require("path"));
40
40
  const ai_1 = require("../ai");
41
41
  const a_1 = require("../a");
42
42
  const merger_1 = require("../utils/merger");
43
+ // Generate README markdown file by analyzing the codebase
43
44
  async function generateReadme(inputDir, outputFile, apiKey, aiOptions, customTemplatePath) {
44
45
  console.log('Analyzing codebase...');
45
46
  const analysis = (0, a_1.analyzeCode)(inputDir);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazykedar/lazydocs",
3
- "version": "1.3.0",
3
+ "version": "2.0.1",
4
4
  "description": "AI-powered documentation generator using Groq. Generate READMEs, PR descriptions, and changelogs in seconds.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {