Skip to content

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

Fix CLI --force flag on parse-prd command

Joe Danziger4117f71c18ee
diff --git a/.changeset/floppy-plants-marry.md b/.changeset/floppy-plants-marry.md
new file mode 100644
index 00000000..401fed18
--- /dev/null
+++ b/.changeset/floppy-plants-marry.md
@@ -0,0 +1,9 @@
+---
+'task-master-ai': patch
+---
+
+Fix CLI --force flag for parse-prd command
+
+Previously, the --force flag was not respected when running `parse-prd`, causing the command to prompt for confirmation or fail even when --force was provided. This patch ensures that the flag is correctly passed and handled, allowing users to overwrite existing tasks.json files as intended.
+
+- Fixes #477
\ No newline at end of file
diff --git a/scripts/modules/commands.js b/scripts/modules/commands.js
index 21870f74..0e60642b 100644
--- a/scripts/modules/commands.js
+++ b/scripts/modules/commands.js
@@ -515,7 +515,7 @@ function registerCommands(programInstance) {
const outputPath = options.output;
const force = options.force || false;
const append = options.append || false;
- let useForce = false;
+ let useForce = force;
let useAppend = false;
// Helper function to check if tasks.json exists and confirm overwrite
@@ -609,7 +609,7 @@ function registerCommands(programInstance) {
spinner = ora('Parsing PRD and generating tasks...').start();
await parsePRD(inputFile, outputPath, numTasks, {
append: useAppend,
- force: useForce
+ useForce
});
spinner.succeed('Tasks generated successfully!');
} catch (error) {