default to all rules
This commit is contained in:
@@ -213,8 +213,8 @@ task-master init
|
|||||||
task-master init --rules cursor,windsurf
|
task-master init --rules cursor,windsurf
|
||||||
```
|
```
|
||||||
|
|
||||||
- The `--rules` flag allows you to specify one or more rule sets (e.g., `cursor`, `roo`, `windsurf`) to apply during initialization.
|
- The `--rules` flag allows you to specify one or more rule sets (e.g., `cursor`, `roo`, `windsurf`, `cline`) to apply during initialization.
|
||||||
- If omitted, the default is `cursor`.
|
- If omitted, all available rule sets are installed by default (cursor, windsurf, roo, cline).
|
||||||
- You can use multiple comma-separated rules in a single command.
|
- You can use multiple comma-separated rules in a single command.
|
||||||
|
|
||||||
**Example:**
|
**Example:**
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
// isSilentMode // Not used directly here
|
// isSilentMode // Not used directly here
|
||||||
} from '../../../../scripts/modules/utils.js';
|
} from '../../../../scripts/modules/utils.js';
|
||||||
import os from 'os'; // Import os module for home directory check
|
import os from 'os'; // Import os module for home directory check
|
||||||
|
import { BRAND_NAMES } from '../../../../src/utils/rule-transformer.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Direct function wrapper for initializing a project.
|
* Direct function wrapper for initializing a project.
|
||||||
@@ -74,8 +75,8 @@ export async function initializeProjectDirect(args, log, context = {}) {
|
|||||||
options.rules = args.rules;
|
options.rules = args.rules;
|
||||||
log.info(`Including rules: ${args.rules.join(', ')}`);
|
log.info(`Including rules: ${args.rules.join(', ')}`);
|
||||||
} else {
|
} else {
|
||||||
options.rules = ['cursor'];
|
options.rules = BRAND_NAMES;
|
||||||
log.info(`No rules specified, defaulting to: cursor`);
|
log.info(`No rules specified, defaulting to: ${BRAND_NAMES.join(', ')}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info(`Initializing project with options: ${JSON.stringify(options)}`);
|
log.info(`Initializing project with options: ${JSON.stringify(options)}`);
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ async function initializeProject(options = {}) {
|
|||||||
let selectedBrandRules =
|
let selectedBrandRules =
|
||||||
options.rules && Array.isArray(options.rules) && options.rules.length > 0
|
options.rules && Array.isArray(options.rules) && options.rules.length > 0
|
||||||
? options.rules
|
? options.rules
|
||||||
: ['cursor'];
|
: BRAND_NAMES; // Default to all rules
|
||||||
|
|
||||||
// if (!isSilentMode()) {
|
// if (!isSilentMode()) {
|
||||||
// console.log('Skip prompts determined:', skipPrompts);
|
// console.log('Skip prompts determined:', skipPrompts);
|
||||||
@@ -418,31 +418,6 @@ async function initializeProject(options = {}) {
|
|||||||
// Create structure using only necessary values
|
// Create structure using only necessary values
|
||||||
createProjectStructure(addAliasesPrompted, dryRun, selectedBrandRules);
|
createProjectStructure(addAliasesPrompted, dryRun, selectedBrandRules);
|
||||||
|
|
||||||
// If in MCP mode, call MCP server for rules (without 'yes' param)
|
|
||||||
if (options.mcpMode && options.mcpServer) {
|
|
||||||
const mcpArgs = {
|
|
||||||
action: 'add',
|
|
||||||
rules: selectedBrandRules,
|
|
||||||
projectRoot: targetDir
|
|
||||||
};
|
|
||||||
try {
|
|
||||||
const mcpResult = await options.mcpServer.call('rules', mcpArgs);
|
|
||||||
if (mcpResult && mcpResult.success) {
|
|
||||||
log(
|
|
||||||
'success',
|
|
||||||
`Brand rules added via MCP: ${selectedBrandRules.join(', ')}`
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
log(
|
|
||||||
'error',
|
|
||||||
`MCP rules add failed: ${mcpResult?.error?.message || 'Unknown error'}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
log('error', `MCP server error: ${err.message}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const rule of selectedBrandRules) {
|
for (const rule of selectedBrandRules) {
|
||||||
const profile = BRAND_PROFILES[rule];
|
const profile = BRAND_PROFILES[rule];
|
||||||
if (profile) {
|
if (profile) {
|
||||||
@@ -479,7 +454,7 @@ function promptQuestion(rl, question) {
|
|||||||
function createProjectStructure(
|
function createProjectStructure(
|
||||||
addAliases,
|
addAliases,
|
||||||
dryRun,
|
dryRun,
|
||||||
selectedBrandRules = ['cursor']
|
selectedBrandRules = BRAND_NAMES // Default to all rules
|
||||||
) {
|
) {
|
||||||
const targetDir = process.cwd();
|
const targetDir = process.cwd();
|
||||||
log('info', `Initializing project in ${targetDir}`);
|
log('info', `Initializing project in ${targetDir}`);
|
||||||
|
|||||||
@@ -2123,17 +2123,23 @@ function registerCommands(programInstance) {
|
|||||||
.option('--dry-run', 'Show what would be done without making changes')
|
.option('--dry-run', 'Show what would be done without making changes')
|
||||||
.option('--aliases', 'Add shell aliases (tm, taskmaster)')
|
.option('--aliases', 'Add shell aliases (tm, taskmaster)')
|
||||||
.action(async (cmdOptions) => {
|
.action(async (cmdOptions) => {
|
||||||
// Parse rules: accept space or comma separated, default to ['cursor']
|
// cmdOptions contains parsed arguments
|
||||||
let rules = ['cursor'];
|
// Parse rules: accept space or comma separated, default to all available rules
|
||||||
|
let selectedBrands = BRAND_NAMES;
|
||||||
|
|
||||||
if (cmdOptions.rules && Array.isArray(cmdOptions.rules)) {
|
if (cmdOptions.rules && Array.isArray(cmdOptions.rules)) {
|
||||||
rules = cmdOptions.rules
|
const userSpecifiedBrands = cmdOptions.rules
|
||||||
.flatMap((r) => r.split(','))
|
.flatMap((r) => r.split(','))
|
||||||
.map((r) => r.trim())
|
.map((r) => r.trim())
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
if (rules.length === 0) rules = ['cursor'];
|
// Only override defaults if user specified valid rules
|
||||||
|
if (userSpecifiedBrands.length > 0) {
|
||||||
|
selectedBrands = userSpecifiedBrands;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// cmdOptions contains parsed arguments
|
|
||||||
cmdOptions.rules = rules;
|
cmdOptions.rules = selectedBrands;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
console.log('DEBUG: Running init command action in commands.js');
|
console.log('DEBUG: Running init command action in commands.js');
|
||||||
console.log(
|
console.log(
|
||||||
|
|||||||
Reference in New Issue
Block a user