fix(commands): implement manual creation mode for add-task command

- Add support for --title/-t and --description/-d flags in add-task command
- Fix validation for manual creation mode (title + description)
- Implement proper testing for both prompt and manual creation modes
- Update testing documentation with Commander.js testing best practices
- Add guidance on handling variable hoisting and module initialization issues

Changeset: brave-doors-open.md
This commit is contained in:
Eyal Toledano
2025-04-09 18:18:13 -04:00
parent 709ea63350
commit 12519946b4
15 changed files with 1539 additions and 460 deletions

View File

@@ -7,6 +7,9 @@ import fs from 'fs';
import path from 'path';
import chalk from 'chalk';
// Global silent mode flag
let silentMode = false;
// Configuration and constants
const CONFIG = {
model: process.env.MODEL || 'claude-3-7-sonnet-20250219',
@@ -20,9 +23,6 @@ const CONFIG = {
projectVersion: '1.5.0' // Hardcoded version - ALWAYS use this value, ignore environment variable
};
// Global silent mode flag
let silentMode = false;
// Set up logging based on log level
const LOG_LEVELS = {
debug: 0,
@@ -32,6 +32,14 @@ const LOG_LEVELS = {
success: 1 // Treat success like info level
};
/**
* Returns the task manager module
* @returns {Promise<Object>} The task manager module object
*/
async function getTaskManager() {
return import('./task-manager.js');
}
/**
* Enable silent logging mode
*/
@@ -61,7 +69,7 @@ function isSilentMode() {
*/
function log(level, ...args) {
// Immediately return if silentMode is enabled
if (silentMode) {
if (isSilentMode()) {
return;
}
@@ -408,5 +416,6 @@ export {
detectCamelCaseFlags,
enableSilentMode,
disableSilentMode,
isSilentMode
isSilentMode,
getTaskManager
};