An AI-powered task-management system you can drop into Cursor, Lovable, Windsurf, Roo, and others.
JavaScript aicursorcursor-aicursorailovablelovable-devroocodetask-managertaskstasks-listwindsurfwindsurf-ai
refactor: streamline task path resolution in commands.js (#948)
Parthy4bc80290808f
diff --git a/scripts/modules/commands.js b/scripts/modules/commands.jsindex 63bc86a5..a2fa6f06 100644--- a/scripts/modules/commands.js+++ b/scripts/modules/commands.js@@ -970,6 +970,8 @@ function registerCommands(programInstance) {const prompt = options.prompt;const useResearch = options.research || false;+ const tasksPath = taskMaster.getTasksPath();+// Resolve tag using standard patternconst tag =options.tag || getCurrentTag(taskMaster.getProjectRoot()) || 'master';@@ -1063,6 +1065,7 @@ function registerCommands(programInstance) {const taskMaster = initTaskMaster({tasksPath: options.file || true});+ const tasksPath = taskMaster.getTasksPath();// Resolve tag using standard patternconst tag =@@ -1160,7 +1163,7 @@ function registerCommands(programInstance) {}const result = await updateTaskById(- tasksPath,+ taskMaster.getTasksPath(),taskId,prompt,useResearch,@@ -1234,6 +1237,7 @@ function registerCommands(programInstance) {const taskMaster = initTaskMaster({tasksPath: options.file || true});+ const tasksPath = taskMaster.getTasksPath();// Resolve tag using standard patternconst tag =@@ -1333,7 +1337,7 @@ function registerCommands(programInstance) {}const result = await updateSubtaskById(- tasksPath,+ taskMaster.getTasksPath(),subtaskId,prompt,useResearch,@@ -1571,7 +1575,7 @@ function registerCommands(programInstance) {// Updated call to the refactored expandAllTaskstry {const result = await expandAllTasks(- tasksPath,+ taskMaster.getTasksPath(),options.num, // Pass numoptions.research, // Pass research flagoptions.prompt, // Pass additional context@@ -1598,7 +1602,7 @@ function registerCommands(programInstance) {try {// Call the refactored expandTask functionawait expandTask(- tasksPath,+ taskMaster.getTasksPath(),options.id,options.num,options.research,@@ -2091,7 +2095,6 @@ ${result.result}.option('--all', 'Clear subtasks from all tasks').option('--tag <tag>', 'Specify tag context for task operations').action(async (options) => {- const tasksPath = options.file || TASKMASTER_TASKS_FILE;const taskIds = options.id;const all = options.all;const tag = options.tag;@@ -2249,7 +2252,7 @@ ${result.result}try {const { newTaskId, telemetryData } = await addTask(- tasksPath,+ taskMaster.getTasksPath(),options.prompt,dependenciesArray,options.priority,@@ -2288,8 +2291,6 @@ ${result.result}).option('--tag <tag>', 'Specify tag context for task operations').action(async (options) => {- const tasksPath = options.file || TASKMASTER_TASKS_FILE;- const reportPath = options.report;const tag = options.tag;// Initialize TaskMaster@@ -4236,6 +4237,7 @@ Examples:const taskMaster = initTaskMaster({tasksPath: options.file || true});+ const tasksPath = taskMaster.getTasksPath();// Validate tasks file existsif (!fs.existsSync(tasksPath)) {@@ -4305,7 +4307,7 @@ Examples:};await createTagFromBranch(- tasksPath,+ taskMaster.getTasksPath(),currentBranch,branchOptions,context,@@ -4375,6 +4377,7 @@ Examples:const taskMaster = initTaskMaster({tasksPath: options.file || true});+ const tasksPath = taskMaster.getTasksPath();// Validate tasks file existsif (!fs.existsSync(tasksPath)) {@@ -4429,6 +4432,7 @@ Examples:const taskMaster = initTaskMaster({tasksPath: options.file || true});+ const tasksPath = taskMaster.getTasksPath();// Validate tasks file existsif (!fs.existsSync(tasksPath)) {@@ -4478,6 +4482,7 @@ Examples:const taskMaster = initTaskMaster({tasksPath: options.file || true});+ const tasksPath = taskMaster.getTasksPath();// Validate tasks file existsif (!fs.existsSync(tasksPath)) {@@ -4523,6 +4528,7 @@ Examples:const taskMaster = initTaskMaster({tasksPath: options.file || true});+ const tasksPath = taskMaster.getTasksPath();// Validate tasks file existsif (!fs.existsSync(tasksPath)) {@@ -4574,6 +4580,7 @@ Examples:const taskMaster = initTaskMaster({tasksPath: options.file || true});+ const tasksPath = taskMaster.getTasksPath();// Validate tasks file existsif (!fs.existsSync(tasksPath)) {@@ -4594,7 +4601,7 @@ Examples:};await copyTag(- taskMaster.getTasksPath(),+ tasksPath,sourceName,targetName,copyOptions,