Skip to content

An AI-powered task-management system you can drop into Cursor, Lovable, Windsurf, Roo, and others.

feat: Improved the CLI user interface to suggest generating a complexity report if it is missing, instead of showing an error. (#1043)

Ralph Khreishdc44ed9de8a5
diff --git a/.changeset/thick-squids-attend.md b/.changeset/thick-squids-attend.md
new file mode 100644
index 00000000..34a432d2
--- /dev/null
+++ b/.changeset/thick-squids-attend.md
@@ -0,0 +1,5 @@
+---
+"task-master-ai": minor
+---
+
+Prompt to generate a complexity report when it is missing
diff --git a/package.json b/package.json
index d9b5899e..7f5c01a3 100644
--- a/package.json
+++ b/package.json
@@ -9,10 +9,7 @@
"task-master-mcp": "mcp-server/server.js",
"task-master-ai": "mcp-server/server.js"
},
- "workspaces": [
- "apps/*",
- "."
- ],
+ "workspaces": ["apps/*", "."],
"scripts": {
"test": "node --experimental-vm-modules node_modules/.bin/jest",
"test:fails": "node --experimental-vm-modules node_modules/.bin/jest --onlyFailures",
diff --git a/scripts/modules/ui.js b/scripts/modules/ui.js
index ad417ec1..a56d18f0 100644
--- a/scripts/modules/ui.js
+++ b/scripts/modules/ui.js
@@ -9,6 +9,7 @@ import boxen from 'boxen';
import ora from 'ora';
import Table from 'cli-table3';
import gradient from 'gradient-string';
+import readline from 'readline';
import {
log,
findTaskById,
@@ -1682,18 +1683,15 @@ async function displayComplexityReport(reportPath) {
)
);
- const readline = require('readline').createInterface({
+ const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
const answer = await new Promise((resolve) => {
- readline.question(
- chalk.cyan('Generate complexity report? (y/n): '),
- resolve
- );
+ rl.question(chalk.cyan('Generate complexity report? (y/n): '), resolve);
});
- readline.close();
+ rl.close();
if (answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes') {
// Call the analyze-complexity command
@@ -1974,8 +1972,6 @@ async function confirmTaskOverwrite(tasksPath) {
)
);
- // Use dynamic import to get the readline module
- const readline = await import('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
@@ -2463,8 +2459,6 @@ async function displayMultipleTasksSummary(
)
);
- // Use dynamic import for readline
- const readline = await import('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout