nitor 1.4.2 → 1.5.0

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/CHANGELOG.md CHANGED
@@ -38,3 +38,11 @@ For a complete list of changes and discussion, see [Issue #1](https://github.com
38
38
  - Added support for task stats and get task commands.
39
39
 
40
40
  - [Issue #7](https://github.com/codebynithin/nitor/issues/7)
41
+
42
+ ## [1.5.0] - 2026-04-10
43
+
44
+ ### New Features
45
+
46
+ - Add table display for get-task command.
47
+
48
+ - [Issue #9](https://github.com/codebynithin/nitor/issues/9)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitor",
3
- "version": "1.4.2",
3
+ "version": "1.5.0",
4
4
  "description": "A comprehensive CLI toolkit for automating GitLab operations, AI-powered code review, build/deploy automation, MongoDB backup/restore, and developer productivity tools",
5
5
  "main": "index.js",
6
6
  "author": "Nithin V <mails2nithin@gmail.com>",
@@ -374,25 +374,47 @@ Options:
374
374
  process.exit(1);
375
375
  }
376
376
 
377
- const tasks = {};
377
+ const taskNumbers = values.task.split(' ').filter(Boolean);
378
378
 
379
- for (const task of values.task.split(' ')) {
380
- const taskDetails = await getGitMergeRequestDetails(task);
379
+ const spinner = createSpinner('Fetching merge requests');
380
+ spinner.start();
381
381
 
382
- if (taskDetails.error) {
383
- console.log(`No merge requests found for task ${task}`);
382
+ try {
383
+ spinner.update(`Fetching ${taskNumbers.length} task(s)`);
384
384
 
385
- continue;
386
- }
385
+ const taskDetailsList = await Promise.all(
386
+ taskNumbers.map((task) =>
387
+ getGitMergeRequestDetails(task).then((details) => ({ task, details })),
388
+ ),
389
+ );
390
+
391
+ spinner.stop('Loaded merge request data', true);
392
+
393
+ const rows = [];
394
+
395
+ for (const { task, details: taskDetails } of taskDetailsList) {
396
+ if (taskDetails.error) {
397
+ rows.push({ GitLab: task, Zoho: 'No merge requests' });
398
+
399
+ continue;
400
+ }
401
+
402
+ let zoho = 'Not found';
387
403
 
388
- for (const taskDetail of taskDetails) {
389
- const zohoTaskMatch = taskDetail.description?.match(/itemdetails\/(I\d+)\)/);
404
+ for (const taskDetail of taskDetails) {
405
+ const zohoTaskMatch = taskDetail.description?.match(/itemdetails\/(I\d+)\)/);
406
+
407
+ zoho = zohoTaskMatch ? zohoTaskMatch[1] : 'Not found';
408
+ }
390
409
 
391
- tasks[task] = zohoTaskMatch ? zohoTaskMatch[1] : 'Not found';
410
+ rows.push({ GitLab: task, Zoho: zoho });
392
411
  }
393
- }
394
412
 
395
- console.log(tasks);
413
+ printTable(rows, { columns: ['GitLab', 'Zoho'] });
414
+ } catch (error) {
415
+ spinner.stop('Failed to fetch merge requests', false);
416
+ throw error;
417
+ }
396
418
 
397
419
  break;
398
420
  }
package/services/utils.js CHANGED
@@ -560,8 +560,11 @@ const printTable = (data, options = {}) => {
560
560
  } else if (col === 'MRStatus') {
561
561
  cellColor =
562
562
  value === 'merged' ? colors.green : value === 'opened' ? colors.yellow : colors.dim;
563
- } else if (col === 'Task' || col === 'MRID' || col === 'GitID') {
563
+ } else if (col === 'Task' || col === 'MRID' || col === 'GitID' || col === 'GitLab') {
564
564
  cellColor = colors.cyan;
565
+ } else if (col === 'Zoho') {
566
+ cellColor =
567
+ value === 'Not found' || value === 'No merge requests' ? colors.dim : colors.green;
565
568
  } else if (col === 'Owner' || col === 'MRAssignedTo') {
566
569
  cellColor = colors.magenta;
567
570
  } else if (col === 'Repo') {