From 50f226a50e8b06fdef676ae8235c1738b5cc00c7 Mon Sep 17 00:00:00 2001 From: Joe Danziger Date: Sun, 11 May 2025 17:46:04 -0400 Subject: [PATCH] add force flag for rules remove --- README.md | 19 +++++++++++++++---- scripts/modules/commands.js | 13 ++++++++++--- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ded3c939..0af50cf3 100644 --- a/README.md +++ b/README.md @@ -117,24 +117,35 @@ task-master rules remove windsurf # Removes the specified brand rule sets and their MCP config from your project. -``` +```` - Adding rules creates the brand rules directory (e.g., `.roo/rules`) and copies/initializes the brand's rules. - Removing rules deletes the brand rules directory and associated MCP config. - You can use multiple comma-separated brands in a single command. +- Use the `--force` flag to bypass the confirmation prompt when removing rules (dangerous, irreversible): + +```bash +task-master rules remove windsurf --force +```` + +:warning: **Warning:** The `--force` flag will immediately and permanently delete brand rules and configuration without asking for confirmation. task-master rules add windsurf,roo -task-master rules remove windsurf +task-master rules remove windsurf --force # List all tasks + task-master list # Show the next task to work on + task-master next # Generate task files + task-master generate -``` + +```` ## Documentation @@ -154,7 +165,7 @@ Try running it with Node directly: ```bash node node_modules/claude-task-master/scripts/init.js -``` +```` Or clone the repository and run: diff --git a/scripts/modules/commands.js b/scripts/modules/commands.js index 45389f58..bf95effa 100644 --- a/scripts/modules/commands.js +++ b/scripts/modules/commands.js @@ -504,7 +504,11 @@ function registerCommands(programInstance) { .description( 'Add or remove rules for one or more brands (e.g., task-master rules add windsurf roo)' ) - .action(async (action, brands) => { + .option( + '-f, --force', + 'Skip confirmation prompt when removing rules (dangerous)' + ) + .action(async (action, brands, options) => { const projectDir = process.cwd(); if (!brands || brands.length === 0) { @@ -520,8 +524,11 @@ function registerCommands(programInstance) { .filter(Boolean); if (action === 'remove') { - const ui = await import('./ui.js'); - const confirmed = await ui.confirmRulesRemove(expandedBrands); + let confirmed = true; + if (!options.force) { + const ui = await import('./ui.js'); + confirmed = await ui.confirmRulesRemove(expandedBrands); + } if (!confirmed) { console.log(chalk.yellow('Aborted: No rules were removed.')); return;