add force flag for rules remove

This commit is contained in:
Joe Danziger
2025-05-11 17:46:04 -04:00
parent 42a1484028
commit 50f226a50e
2 changed files with 25 additions and 7 deletions

View File

@@ -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:

View File

@@ -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;