feat: implement tm list with new refactored structure

This commit is contained in:
Ralph Khreish
2025-08-26 21:10:28 +02:00
parent 3eb88feff1
commit fb44c58a23
13 changed files with 228 additions and 211 deletions

View File

@@ -24,7 +24,7 @@ export interface ListCommandOptions {
status?: string;
tag?: string;
withSubtasks?: boolean;
format?: string;
format?: OutputFormat;
silent?: boolean;
project?: string;
}
@@ -73,6 +73,7 @@ export class ListTasksCommand extends Command {
* Execute the list command
*/
private async executeCommand(options: ListCommandOptions): Promise<void> {
console.log('executeCommand', options);
try {
// Validate options
if (!this.validateOptions(options)) {
@@ -138,8 +139,7 @@ export class ListTasksCommand extends Command {
*/
private async initializeCore(projectRoot: string): Promise<void> {
if (!this.tmCore) {
this.tmCore = createTaskMasterCore(projectRoot);
await this.tmCore.initialize();
this.tmCore = await createTaskMasterCore({ projectPath: projectRoot });
}
}

View File

@@ -266,7 +266,7 @@ export function createTaskTable(
if (showSubtasks && task.subtasks && task.subtasks.length > 0) {
task.subtasks.forEach((subtask) => {
const subRow: string[] = [
chalk.gray(` └─ ${task.id}.${subtask.id}`),
chalk.gray(` └─ ${subtask.id}`),
chalk.gray(truncate(subtask.title, 36)),
getStatusWithColor(subtask.status),
chalk.gray(subtask.priority || 'medium')