task-o-matic 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +552 -0
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +8 -0
- package/dist/cli/display/common.d.ts +5 -0
- package/dist/cli/display/common.d.ts.map +1 -0
- package/dist/cli/display/common.js +44 -0
- package/dist/cli/display/plan.d.ts +11 -0
- package/dist/cli/display/plan.d.ts.map +1 -0
- package/dist/cli/display/plan.js +42 -0
- package/dist/cli/display/progress.d.ts +11 -0
- package/dist/cli/display/progress.d.ts.map +1 -0
- package/dist/cli/display/progress.js +47 -0
- package/dist/cli/display/task.d.ts +18 -0
- package/dist/cli/display/task.d.ts.map +1 -0
- package/dist/cli/display/task.js +250 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +61 -0
- package/dist/commands/init.d.ts +4 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +197 -0
- package/dist/commands/prd.d.ts +4 -0
- package/dist/commands/prd.d.ts.map +1 -0
- package/dist/commands/prd.js +131 -0
- package/dist/commands/prompt.d.ts +3 -0
- package/dist/commands/prompt.d.ts.map +1 -0
- package/dist/commands/prompt.js +192 -0
- package/dist/commands/tasks.d.ts +3 -0
- package/dist/commands/tasks.d.ts.map +1 -0
- package/dist/commands/tasks.js +599 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +67 -0
- package/dist/lib/ai-service/ai-operations.d.ts +31 -0
- package/dist/lib/ai-service/ai-operations.d.ts.map +1 -0
- package/dist/lib/ai-service/ai-operations.js +648 -0
- package/dist/lib/ai-service/json-parser.d.ts +9 -0
- package/dist/lib/ai-service/json-parser.d.ts.map +1 -0
- package/dist/lib/ai-service/json-parser.js +37 -0
- package/dist/lib/ai-service/mcp-client.d.ts +9 -0
- package/dist/lib/ai-service/mcp-client.d.ts.map +1 -0
- package/dist/lib/ai-service/mcp-client.js +48 -0
- package/dist/lib/ai-service/model-provider.d.ts +8 -0
- package/dist/lib/ai-service/model-provider.d.ts.map +1 -0
- package/dist/lib/ai-service/model-provider.js +71 -0
- package/dist/lib/ai-service/research-tools.d.ts +4 -0
- package/dist/lib/ai-service/research-tools.d.ts.map +1 -0
- package/dist/lib/ai-service/research-tools.js +8 -0
- package/dist/lib/ai-service/retry-handler.d.ts +8 -0
- package/dist/lib/ai-service/retry-handler.d.ts.map +1 -0
- package/dist/lib/ai-service/retry-handler.js +62 -0
- package/dist/lib/better-t-stack-cli.d.ts +35 -0
- package/dist/lib/better-t-stack-cli.d.ts.map +1 -0
- package/dist/lib/better-t-stack-cli.js +118 -0
- package/dist/lib/config.d.ts +24 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +160 -0
- package/dist/lib/context-builder.d.ts +53 -0
- package/dist/lib/context-builder.d.ts.map +1 -0
- package/dist/lib/context-builder.js +294 -0
- package/dist/lib/executors/executor-factory.d.ts +5 -0
- package/dist/lib/executors/executor-factory.d.ts.map +1 -0
- package/dist/lib/executors/executor-factory.js +21 -0
- package/dist/lib/executors/opencode-executor.d.ts +6 -0
- package/dist/lib/executors/opencode-executor.d.ts.map +1 -0
- package/dist/lib/executors/opencode-executor.js +46 -0
- package/dist/lib/index.d.ts +89 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +134 -0
- package/dist/lib/prompt-builder.d.ts +50 -0
- package/dist/lib/prompt-builder.d.ts.map +1 -0
- package/dist/lib/prompt-builder.js +171 -0
- package/dist/lib/prompt-registry.d.ts +22 -0
- package/dist/lib/prompt-registry.d.ts.map +1 -0
- package/dist/lib/prompt-registry.js +201 -0
- package/dist/lib/storage.d.ts +60 -0
- package/dist/lib/storage.d.ts.map +1 -0
- package/dist/lib/storage.js +768 -0
- package/dist/lib/task-execution.d.ts +3 -0
- package/dist/lib/task-execution.d.ts.map +1 -0
- package/dist/lib/task-execution.js +130 -0
- package/dist/lib/validation.d.ts +4 -0
- package/dist/lib/validation.d.ts.map +1 -0
- package/dist/lib/validation.js +52 -0
- package/dist/mcp/prompts.d.ts +3 -0
- package/dist/mcp/prompts.d.ts.map +1 -0
- package/dist/mcp/prompts.js +7 -0
- package/dist/mcp/resources.d.ts +3 -0
- package/dist/mcp/resources.d.ts.map +1 -0
- package/dist/mcp/resources.js +7 -0
- package/dist/mcp/server.d.ts +3 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +25 -0
- package/dist/mcp/tools.d.ts +3 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +99 -0
- package/dist/prompts/documentation-detection.d.ts +2 -0
- package/dist/prompts/documentation-detection.d.ts.map +1 -0
- package/dist/prompts/documentation-detection.js +24 -0
- package/dist/prompts/index.d.ts +7 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +22 -0
- package/dist/prompts/prd-parsing.d.ts +3 -0
- package/dist/prompts/prd-parsing.d.ts.map +1 -0
- package/dist/prompts/prd-parsing.js +172 -0
- package/dist/prompts/prd-rework.d.ts +3 -0
- package/dist/prompts/prd-rework.d.ts.map +1 -0
- package/dist/prompts/prd-rework.js +81 -0
- package/dist/prompts/task-breakdown.d.ts +3 -0
- package/dist/prompts/task-breakdown.d.ts.map +1 -0
- package/dist/prompts/task-breakdown.js +151 -0
- package/dist/prompts/task-enhancement.d.ts +3 -0
- package/dist/prompts/task-enhancement.d.ts.map +1 -0
- package/dist/prompts/task-enhancement.js +140 -0
- package/dist/prompts/task-planning.d.ts +3 -0
- package/dist/prompts/task-planning.d.ts.map +1 -0
- package/dist/prompts/task-planning.js +66 -0
- package/dist/services/prd.d.ts +32 -0
- package/dist/services/prd.d.ts.map +1 -0
- package/dist/services/prd.js +191 -0
- package/dist/services/tasks.d.ts +67 -0
- package/dist/services/tasks.d.ts.map +1 -0
- package/dist/services/tasks.js +596 -0
- package/dist/test/commands.test.d.ts +2 -0
- package/dist/test/commands.test.d.ts.map +1 -0
- package/dist/test/commands.test.js +74 -0
- package/dist/test/storage.test.d.ts +2 -0
- package/dist/test/storage.test.d.ts.map +1 -0
- package/dist/test/storage.test.js +207 -0
- package/dist/types/callbacks.d.ts +27 -0
- package/dist/types/callbacks.d.ts.map +1 -0
- package/dist/types/callbacks.js +2 -0
- package/dist/types/index.d.ts +252 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/mcp.d.ts +3 -0
- package/dist/types/mcp.d.ts.map +1 -0
- package/dist/types/mcp.js +3 -0
- package/dist/types/options.d.ts +94 -0
- package/dist/types/options.d.ts.map +1 -0
- package/dist/types/options.js +2 -0
- package/dist/types/results.d.ts +90 -0
- package/dist/types/results.d.ts.map +1 -0
- package/dist/types/results.js +2 -0
- package/dist/utils/ai-config-builder.d.ts +14 -0
- package/dist/utils/ai-config-builder.d.ts.map +1 -0
- package/dist/utils/ai-config-builder.js +22 -0
- package/dist/utils/ai-service-factory.d.ts +10 -0
- package/dist/utils/ai-service-factory.d.ts.map +1 -0
- package/dist/utils/ai-service-factory.js +52 -0
- package/dist/utils/stack-formatter.d.ts +11 -0
- package/dist/utils/stack-formatter.d.ts.map +1 -0
- package/dist/utils/stack-formatter.js +30 -0
- package/dist/utils/streaming-options.d.ts +10 -0
- package/dist/utils/streaming-options.d.ts.map +1 -0
- package/dist/utils/streaming-options.js +53 -0
- package/package.json +82 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ProgressEvent } from '../../types/callbacks';
|
|
2
|
+
/**
|
|
3
|
+
* Display progress events for the CLI
|
|
4
|
+
* This function is used as a callback for services to report progress
|
|
5
|
+
*/
|
|
6
|
+
export declare function displayProgress(event: ProgressEvent): void;
|
|
7
|
+
/**
|
|
8
|
+
* Display an error message
|
|
9
|
+
*/
|
|
10
|
+
export declare function displayError(error: Error | unknown): void;
|
|
11
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/cli/display/progress.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAmC1D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,GAAG,IAAI,CAGzD"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.displayProgress = displayProgress;
|
|
7
|
+
exports.displayError = displayError;
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
/**
|
|
10
|
+
* Display progress events for the CLI
|
|
11
|
+
* This function is used as a callback for services to report progress
|
|
12
|
+
*/
|
|
13
|
+
function displayProgress(event) {
|
|
14
|
+
switch (event.type) {
|
|
15
|
+
case 'started':
|
|
16
|
+
console.log(chalk_1.default.blue('š¤ ' + event.message));
|
|
17
|
+
break;
|
|
18
|
+
case 'progress':
|
|
19
|
+
if (event.current && event.total) {
|
|
20
|
+
const percent = Math.round((event.current / event.total) * 100);
|
|
21
|
+
console.log(chalk_1.default.cyan(` [${event.current}/${event.total}] ${percent}% - ${event.message}`));
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
console.log(chalk_1.default.cyan(' ā ' + event.message));
|
|
25
|
+
}
|
|
26
|
+
break;
|
|
27
|
+
case 'stream-chunk':
|
|
28
|
+
process.stdout.write(event.text);
|
|
29
|
+
break;
|
|
30
|
+
case 'completed':
|
|
31
|
+
console.log(chalk_1.default.green('ā ' + event.message));
|
|
32
|
+
break;
|
|
33
|
+
case 'warning':
|
|
34
|
+
console.log(chalk_1.default.yellow('ā ļø ' + event.message));
|
|
35
|
+
break;
|
|
36
|
+
case 'info':
|
|
37
|
+
console.log(chalk_1.default.gray(' ā¹ ' + event.message));
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Display an error message
|
|
43
|
+
*/
|
|
44
|
+
function displayError(error) {
|
|
45
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
46
|
+
console.error(chalk_1.default.red('ā Error:'), message);
|
|
47
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Task, TaskAIMetadata } from "../../types";
|
|
2
|
+
export interface TaskDisplayOptions {
|
|
3
|
+
indent?: string;
|
|
4
|
+
showSubtasks?: boolean;
|
|
5
|
+
showMetadata?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function displayTask(task: Task, options?: TaskDisplayOptions): Promise<void>;
|
|
8
|
+
export declare function displayTaskDetails(task: Task): Promise<void>;
|
|
9
|
+
export declare function displayTaskList(tasks: Task[]): void;
|
|
10
|
+
export declare function displayCreatedTask(task: Task, aiMetadata?: TaskAIMetadata): void;
|
|
11
|
+
export declare function displaySubtaskCreation(subtasks: Task[]): void;
|
|
12
|
+
export declare function displayTaskUpdate(task: Task, updates: any): void;
|
|
13
|
+
export declare function displayTaskDelete(deleted: Task[], orphanedSubtasks: Task[]): void;
|
|
14
|
+
export declare function displayTaskStatusChange(task: Task, oldStatus: string, newStatus: string): void;
|
|
15
|
+
export declare function displayTagsUpdate(task: Task, addedTags: string[], removedTags: string[]): void;
|
|
16
|
+
export declare function displayNextTask(task: Task, criteria: string): void;
|
|
17
|
+
export declare function displayTaskTree(tasks: Task[], rootId?: string): Promise<void>;
|
|
18
|
+
//# sourceMappingURL=task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../../src/cli/display/task.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGnD,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,wBAAsB,WAAW,CAC/B,IAAI,EAAE,IAAI,EACV,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAsBf;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA6FlE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,CAKnD;AAED,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,IAAI,EACV,UAAU,CAAC,EAAE,cAAc,GAC1B,IAAI,CAUN;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAI,CAS7D;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,GAAG,IAAI,CAyBhE;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,IAAI,EAAE,EACf,gBAAgB,EAAE,IAAI,EAAE,GACvB,IAAI,CAeN;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,IAAI,CAaN;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,MAAM,EAAE,EACnB,WAAW,EAAE,MAAM,EAAE,GACpB,IAAI,CAgBN;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAwBlE;AAED,wBAAsB,eAAe,CACnC,KAAK,EAAE,IAAI,EAAE,EACb,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CA6Df"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.displayTask = displayTask;
|
|
7
|
+
exports.displayTaskDetails = displayTaskDetails;
|
|
8
|
+
exports.displayTaskList = displayTaskList;
|
|
9
|
+
exports.displayCreatedTask = displayCreatedTask;
|
|
10
|
+
exports.displaySubtaskCreation = displaySubtaskCreation;
|
|
11
|
+
exports.displayTaskUpdate = displayTaskUpdate;
|
|
12
|
+
exports.displayTaskDelete = displayTaskDelete;
|
|
13
|
+
exports.displayTaskStatusChange = displayTaskStatusChange;
|
|
14
|
+
exports.displayTagsUpdate = displayTagsUpdate;
|
|
15
|
+
exports.displayNextTask = displayNextTask;
|
|
16
|
+
exports.displayTaskTree = displayTaskTree;
|
|
17
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
18
|
+
const tasks_1 = require("../../services/tasks");
|
|
19
|
+
async function displayTask(task, options = {}) {
|
|
20
|
+
const { indent = "", showSubtasks = true, showMetadata = false } = options;
|
|
21
|
+
const statusColor = task.status === "completed"
|
|
22
|
+
? chalk_1.default.green
|
|
23
|
+
: task.status === "in-progress"
|
|
24
|
+
? chalk_1.default.yellow
|
|
25
|
+
: chalk_1.default.gray;
|
|
26
|
+
console.log(`${indent}${statusColor(`[${task.status}]`)} ${chalk_1.default.bold(task.title)} ${chalk_1.default.gray(`(${task.id})`)}`);
|
|
27
|
+
if (showSubtasks && task.subtasks && task.subtasks.length > 0) {
|
|
28
|
+
for (const subtask of task.subtasks) {
|
|
29
|
+
await displayTask(subtask, {
|
|
30
|
+
indent: indent + "\t",
|
|
31
|
+
showSubtasks: false,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async function displayTaskDetails(task) {
|
|
37
|
+
console.log(chalk_1.default.blue("Task Details:"));
|
|
38
|
+
console.log(`${chalk_1.default.cyan("ID:")} ${task.id}`);
|
|
39
|
+
console.log(`${chalk_1.default.cyan("Title:")} ${chalk_1.default.bold(task.title)}`);
|
|
40
|
+
console.log(`${chalk_1.default.cyan("Status:")} ${task.status}`);
|
|
41
|
+
if (task.description) {
|
|
42
|
+
console.log(`${chalk_1.default.cyan("Description:")} ${task.description}`);
|
|
43
|
+
}
|
|
44
|
+
if (task.contentFile) {
|
|
45
|
+
const fullContent = await tasks_1.taskService.getTaskContent(task.id);
|
|
46
|
+
if (fullContent) {
|
|
47
|
+
console.log(`${chalk_1.default.cyan("Full Content:")}`);
|
|
48
|
+
console.log(fullContent);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (task.estimatedEffort) {
|
|
52
|
+
console.log(`${chalk_1.default.cyan("Estimated Effort:")} ${task.estimatedEffort}`);
|
|
53
|
+
}
|
|
54
|
+
if (task.tags && task.tags.length > 0) {
|
|
55
|
+
console.log(`${chalk_1.default.cyan("Tags:")} ${task.tags.join(", ")}`);
|
|
56
|
+
}
|
|
57
|
+
const aiMetadata = await tasks_1.taskService.getTaskAIMetadata(task.id);
|
|
58
|
+
if (aiMetadata?.aiGenerated) {
|
|
59
|
+
console.log(`${chalk_1.default.magenta("š¤ AI-generated")}`);
|
|
60
|
+
if (aiMetadata.aiProvider) {
|
|
61
|
+
console.log(`${chalk_1.default.magenta(" Provider:")} ${aiMetadata.aiProvider}`);
|
|
62
|
+
}
|
|
63
|
+
if (aiMetadata.aiModel) {
|
|
64
|
+
console.log(`${chalk_1.default.magenta(" Model:")} ${aiMetadata.aiModel}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
console.log(`${chalk_1.default.cyan("Created:")} ${new Date(task.createdAt).toLocaleString()}`);
|
|
68
|
+
console.log(`${chalk_1.default.cyan("Updated:")} ${new Date(task.updatedAt).toLocaleString()}`);
|
|
69
|
+
if (task.documentation?.research) {
|
|
70
|
+
console.log(chalk_1.default.blue(`\nš Documentation Research:`));
|
|
71
|
+
Object.entries(task.documentation.research).forEach(([lib, entries]) => {
|
|
72
|
+
console.log(chalk_1.default.cyan(` ${lib}:`));
|
|
73
|
+
entries.forEach((entry) => {
|
|
74
|
+
console.log(chalk_1.default.gray(` Query: "${entry.query}"`));
|
|
75
|
+
console.log(chalk_1.default.gray(` Cache: ${entry.cache}`));
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
const subtasks = await tasks_1.taskService.getSubtasks(task.id);
|
|
80
|
+
if (subtasks.length > 0) {
|
|
81
|
+
console.log(chalk_1.default.blue(`\nš Subtasks (${subtasks.length}):`));
|
|
82
|
+
for (let i = 0; i < subtasks.length; i++) {
|
|
83
|
+
const subtask = subtasks[i];
|
|
84
|
+
const statusColor = subtask.status === "completed"
|
|
85
|
+
? chalk_1.default.green
|
|
86
|
+
: subtask.status === "in-progress"
|
|
87
|
+
? chalk_1.default.yellow
|
|
88
|
+
: chalk_1.default.gray;
|
|
89
|
+
console.log(` ${i + 1}. ${statusColor(`[${subtask.status}]`)} ${chalk_1.default.bold(subtask.title)}`);
|
|
90
|
+
if (subtask.description) {
|
|
91
|
+
console.log(chalk_1.default.gray(` ${subtask.description.substring(0, 80)}${subtask.description.length > 80 ? "..." : ""}`));
|
|
92
|
+
}
|
|
93
|
+
if (subtask.estimatedEffort) {
|
|
94
|
+
console.log(chalk_1.default.cyan(` Effort: ${subtask.estimatedEffort}`));
|
|
95
|
+
}
|
|
96
|
+
const subtaskAiMetadata = await tasks_1.taskService.getTaskAIMetadata(subtask.id);
|
|
97
|
+
if (subtaskAiMetadata?.aiGenerated) {
|
|
98
|
+
console.log(chalk_1.default.magenta(` š¤ AI-generated`));
|
|
99
|
+
}
|
|
100
|
+
if (i < subtasks.length - 1)
|
|
101
|
+
console.log("");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function displayTaskList(tasks) {
|
|
106
|
+
if (tasks.length === 0) {
|
|
107
|
+
console.log(chalk_1.default.yellow("No tasks found."));
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function displayCreatedTask(task, aiMetadata) {
|
|
112
|
+
console.log(chalk_1.default.green(`\nā Created task: ${task.title} (${task.id})`));
|
|
113
|
+
if (task.contentFile) {
|
|
114
|
+
console.log(chalk_1.default.cyan(` Content saved to: ${task.contentFile}`));
|
|
115
|
+
}
|
|
116
|
+
if (aiMetadata?.aiGenerated) {
|
|
117
|
+
console.log(chalk_1.default.magenta(` š¤ Enhanced using Context7 documentation`));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function displaySubtaskCreation(subtasks) {
|
|
121
|
+
console.log(chalk_1.default.green(`ā Created ${subtasks.length} subtasks`));
|
|
122
|
+
for (let i = 0; i < subtasks.length; i++) {
|
|
123
|
+
const subtask = subtasks[i];
|
|
124
|
+
console.log(chalk_1.default.cyan(` ${i + 1}. ${subtask.title} (${subtask.id})`));
|
|
125
|
+
if (subtask.estimatedEffort) {
|
|
126
|
+
console.log(chalk_1.default.gray(` Effort: ${subtask.estimatedEffort}`));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function displayTaskUpdate(task, updates) {
|
|
131
|
+
console.log(chalk_1.default.green(`\nā Updated task: ${task.title} (${task.id})`));
|
|
132
|
+
const changedFields = Object.keys(updates);
|
|
133
|
+
if (changedFields.length > 0) {
|
|
134
|
+
console.log(chalk_1.default.cyan(` Changed fields: ${changedFields.join(", ")}`));
|
|
135
|
+
}
|
|
136
|
+
if (updates.status) {
|
|
137
|
+
const statusColor = updates.status === "completed"
|
|
138
|
+
? chalk_1.default.green
|
|
139
|
+
: updates.status === "in-progress"
|
|
140
|
+
? chalk_1.default.yellow
|
|
141
|
+
: chalk_1.default.gray;
|
|
142
|
+
console.log(statusColor(` Status: ${updates.status}`));
|
|
143
|
+
}
|
|
144
|
+
if (updates.title) {
|
|
145
|
+
console.log(chalk_1.default.cyan(` Title: ${updates.title}`));
|
|
146
|
+
}
|
|
147
|
+
if (updates.tags && updates.tags.length > 0) {
|
|
148
|
+
console.log(chalk_1.default.cyan(` Tags: ${updates.tags.join(", ")}`));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function displayTaskDelete(deleted, orphanedSubtasks) {
|
|
152
|
+
console.log(chalk_1.default.green(`\nā Deleted ${deleted.length} task(s):`));
|
|
153
|
+
for (const task of deleted) {
|
|
154
|
+
console.log(chalk_1.default.cyan(` ⢠${task.title} (${task.id})`));
|
|
155
|
+
}
|
|
156
|
+
if (orphanedSubtasks.length > 0) {
|
|
157
|
+
console.log(chalk_1.default.yellow(`\nā ļø Orphaned ${orphanedSubtasks.length} subtask(s):`));
|
|
158
|
+
for (const subtask of orphanedSubtasks) {
|
|
159
|
+
console.log(chalk_1.default.yellow(` ⢠${subtask.title} (${subtask.id})`));
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
function displayTaskStatusChange(task, oldStatus, newStatus) {
|
|
164
|
+
const newStatusColor = newStatus === "completed"
|
|
165
|
+
? chalk_1.default.green
|
|
166
|
+
: newStatus === "in-progress"
|
|
167
|
+
? chalk_1.default.yellow
|
|
168
|
+
: chalk_1.default.gray;
|
|
169
|
+
console.log(chalk_1.default.green(`\nā Status changed for task: ${task.title} (${task.id})`));
|
|
170
|
+
console.log(chalk_1.default.gray(` From: ${oldStatus}`));
|
|
171
|
+
console.log(newStatusColor(` To: ${newStatus}`));
|
|
172
|
+
}
|
|
173
|
+
function displayTagsUpdate(task, addedTags, removedTags) {
|
|
174
|
+
console.log(chalk_1.default.green(`\nā Updated tags for task: ${task.title} (${task.id})`));
|
|
175
|
+
if (addedTags.length > 0) {
|
|
176
|
+
console.log(chalk_1.default.green(` Added tags: ${addedTags.join(", ")}`));
|
|
177
|
+
}
|
|
178
|
+
if (removedTags.length > 0) {
|
|
179
|
+
console.log(chalk_1.default.red(` Removed tags: ${removedTags.join(", ")}`));
|
|
180
|
+
}
|
|
181
|
+
if (task.tags && task.tags.length > 0) {
|
|
182
|
+
console.log(chalk_1.default.cyan(` Current tags: ${task.tags.join(", ")}`));
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
function displayNextTask(task, criteria) {
|
|
186
|
+
console.log(chalk_1.default.blue(`\nšÆ Next task (${criteria}):`));
|
|
187
|
+
console.log(chalk_1.default.green(`ā ${task.title} (${task.id})`));
|
|
188
|
+
const statusColor = task.status === "completed" ? chalk_1.default.green :
|
|
189
|
+
task.status === "in-progress" ? chalk_1.default.yellow :
|
|
190
|
+
chalk_1.default.gray;
|
|
191
|
+
console.log(statusColor(` Status: ${task.status}`));
|
|
192
|
+
if (task.description) {
|
|
193
|
+
console.log(chalk_1.default.cyan(` Description: ${task.description.substring(0, 100)}${task.description.length > 100 ? "..." : ""}`));
|
|
194
|
+
}
|
|
195
|
+
if (task.estimatedEffort) {
|
|
196
|
+
console.log(chalk_1.default.cyan(` Effort: ${task.estimatedEffort}`));
|
|
197
|
+
}
|
|
198
|
+
if (task.tags && task.tags.length > 0) {
|
|
199
|
+
console.log(chalk_1.default.cyan(` Tags: ${task.tags.join(", ")}`));
|
|
200
|
+
}
|
|
201
|
+
console.log(chalk_1.default.gray(` Created: ${new Date(task.createdAt).toLocaleString()}`));
|
|
202
|
+
}
|
|
203
|
+
async function displayTaskTree(tasks, rootId) {
|
|
204
|
+
if (tasks.length === 0) {
|
|
205
|
+
console.log(chalk_1.default.yellow("No tasks found."));
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
if (rootId) {
|
|
209
|
+
console.log(chalk_1.default.blue(`\nš³ Task Tree for ${rootId}:`));
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
console.log(chalk_1.default.blue(`\nš³ Complete Task Tree:`));
|
|
213
|
+
}
|
|
214
|
+
const displayTaskWithIndent = async (task, indent = "", isLast = false) => {
|
|
215
|
+
const statusColor = task.status === "completed"
|
|
216
|
+
? chalk_1.default.green
|
|
217
|
+
: task.status === "in-progress"
|
|
218
|
+
? chalk_1.default.yellow
|
|
219
|
+
: chalk_1.default.gray;
|
|
220
|
+
const connector = isLast ? "āāā " : "āāā ";
|
|
221
|
+
const subtasks = await tasks_1.taskService.getSubtasks(task.id);
|
|
222
|
+
const hasSubtasks = subtasks.length > 0;
|
|
223
|
+
console.log(`${indent}${connector}${statusColor(`[${task.status}]`)} ${chalk_1.default.bold(task.title)} ${chalk_1.default.gray(`(${task.id})`)}`);
|
|
224
|
+
if (task.tags && task.tags.length > 0) {
|
|
225
|
+
console.log(`${indent}${isLast ? " " : "ā "}${chalk_1.default.cyan(`š·ļø ${task.tags.join(", ")}`)}`);
|
|
226
|
+
}
|
|
227
|
+
if (hasSubtasks) {
|
|
228
|
+
const subtaskIndent = indent + (isLast ? " " : "ā ");
|
|
229
|
+
for (let i = 0; i < subtasks.length; i++) {
|
|
230
|
+
const isLastSubtask = i === subtasks.length - 1;
|
|
231
|
+
await displayTaskWithIndent(subtasks[i], subtaskIndent, isLastSubtask);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
// If rootId is specified, find and display only that tree
|
|
236
|
+
if (rootId) {
|
|
237
|
+
const rootTask = tasks.find((t) => t.id === rootId);
|
|
238
|
+
if (rootTask) {
|
|
239
|
+
await displayTaskWithIndent(rootTask, "", true);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
// Display only top-level tasks (those without parentId)
|
|
244
|
+
const topLevelTasks = tasks.filter((task) => !task.parentId);
|
|
245
|
+
for (let i = 0; i < topLevelTasks.length; i++) {
|
|
246
|
+
const isLast = i === topLevelTasks.length - 1;
|
|
247
|
+
await displayTaskWithIndent(topLevelTasks[i], "", isLast);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,eAAO,MAAM,aAAa,SAEzB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.configCommand = void 0;
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const fs_1 = require("fs");
|
|
10
|
+
const config_1 = require("../lib/config");
|
|
11
|
+
exports.configCommand = new commander_1.Command("config").description("Manage task-o-matic configuration");
|
|
12
|
+
// Get AI config
|
|
13
|
+
exports.configCommand
|
|
14
|
+
.command("get-ai-config")
|
|
15
|
+
.description("Get the current AI configuration")
|
|
16
|
+
.action(() => {
|
|
17
|
+
const aiConfig = config_1.configManager.getAIConfig();
|
|
18
|
+
console.log(chalk_1.default.blue("Current AI Configuration:"));
|
|
19
|
+
console.log(aiConfig);
|
|
20
|
+
});
|
|
21
|
+
// Set AI provider
|
|
22
|
+
exports.configCommand
|
|
23
|
+
.command("set-ai-provider")
|
|
24
|
+
.description("Set the AI provider and model")
|
|
25
|
+
.argument("<provider>", "AI provider (e.g., openrouter, openai)")
|
|
26
|
+
.argument("[model]", "AI model (optional)")
|
|
27
|
+
.action((provider, model) => {
|
|
28
|
+
const currentConfig = config_1.configManager.getAIConfig();
|
|
29
|
+
const newConfig = {
|
|
30
|
+
provider: provider,
|
|
31
|
+
...(model && { model: model }),
|
|
32
|
+
};
|
|
33
|
+
config_1.configManager.setAIConfig(newConfig);
|
|
34
|
+
console.log(chalk_1.default.green("ā AI provider updated"));
|
|
35
|
+
console.log(config_1.configManager.getAIConfig());
|
|
36
|
+
});
|
|
37
|
+
// Get project info
|
|
38
|
+
exports.configCommand
|
|
39
|
+
.command("info")
|
|
40
|
+
.description("Get information about the current task-o-matic project")
|
|
41
|
+
.action(() => {
|
|
42
|
+
const config = config_1.configManager.getConfig();
|
|
43
|
+
const taskOMaticDir = config_1.configManager.getTaskOMaticDir();
|
|
44
|
+
console.log(chalk_1.default.blue("Task-o-matic Project Info:"));
|
|
45
|
+
console.log(chalk_1.default.cyan(` Project Directory: ${config_1.configManager.getWorkingDirectory()}`));
|
|
46
|
+
console.log(chalk_1.default.cyan(` .task-o-matic dir: ${taskOMaticDir}`));
|
|
47
|
+
if ((0, fs_1.existsSync)(taskOMaticDir)) {
|
|
48
|
+
const configFile = config_1.configManager.getConfigFilePath();
|
|
49
|
+
if ((0, fs_1.existsSync)(configFile)) {
|
|
50
|
+
console.log(chalk_1.default.green(` ā Config file found: ${configFile}`));
|
|
51
|
+
const configData = JSON.parse((0, fs_1.readFileSync)(configFile, "utf-8"));
|
|
52
|
+
console.log(chalk_1.default.gray(JSON.stringify(configData, null, 2)));
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
console.log(chalk_1.default.yellow(" ā Config file not found."));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
console.log(chalk_1.default.red(" ā Not a task-o-matic project."));
|
|
60
|
+
}
|
|
61
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,eAAO,MAAM,WAAW,SAEvB,CAAC"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.initCommand = void 0;
|
|
8
|
+
const commander_1 = require("commander");
|
|
9
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
10
|
+
const fs_1 = require("fs");
|
|
11
|
+
const path_1 = require("path");
|
|
12
|
+
const config_1 = require("../lib/config");
|
|
13
|
+
const better_t_stack_cli_1 = require("../lib/better-t-stack-cli");
|
|
14
|
+
exports.initCommand = new commander_1.Command("init").description("Initialize task-o-matic project and bootstrap Better-T-Stack");
|
|
15
|
+
// Initialize task-o-matic project
|
|
16
|
+
exports.initCommand
|
|
17
|
+
.command("init")
|
|
18
|
+
.description("Initialize a new task-o-matic project in the current directory")
|
|
19
|
+
.option("--ai-provider <provider>", "AI provider (openrouter/anthropic/openai/custom)", "openrouter")
|
|
20
|
+
.option("--ai-model <model>", "AI model", "z-ai/glm-4.6")
|
|
21
|
+
.option("--ai-key <key>", "AI API key")
|
|
22
|
+
.option("--ai-provider-url <url>", "AI provider URL")
|
|
23
|
+
.option("--max-tokens <tokens>", "Max tokens for AI (min 32768 for 2025)", "32768")
|
|
24
|
+
.option("--temperature <temp>", "AI temperature", "0.5")
|
|
25
|
+
.option("--no-bootstrap", "Skip bootstrap after initialization")
|
|
26
|
+
.option("--project-name <name>", "Project name for bootstrap")
|
|
27
|
+
.option("--frontend <frontend>", "Frontend framework for bootstrap", "next")
|
|
28
|
+
.option("--backend <backend>", "Backend framework for bootstrap", "convex")
|
|
29
|
+
.option("--database <database>", "Database for bootstrap")
|
|
30
|
+
.option("--auth <auth>", "Authentication for bootstrap", "better-auth")
|
|
31
|
+
.option("--context7-api-key <key>", "Context7 API key")
|
|
32
|
+
.option("--directory <dir>", "Working directory for the project")
|
|
33
|
+
.action(async (options) => {
|
|
34
|
+
// Handle directory creation/setup first
|
|
35
|
+
if (options.directory) {
|
|
36
|
+
const targetDir = (0, path_1.resolve)(options.directory);
|
|
37
|
+
// Create directory if it doesn't exist
|
|
38
|
+
if (!(0, fs_1.existsSync)(targetDir)) {
|
|
39
|
+
(0, fs_1.mkdirSync)(targetDir, { recursive: true });
|
|
40
|
+
console.log(chalk_1.default.green(` ā Created directory: ${targetDir}`));
|
|
41
|
+
}
|
|
42
|
+
// Set working directory in ConfigManager BEFORE any other operations
|
|
43
|
+
config_1.configManager.setWorkingDirectory(targetDir);
|
|
44
|
+
console.log(chalk_1.default.cyan(` š Working directory: ${targetDir}`));
|
|
45
|
+
}
|
|
46
|
+
const taskOMaticDir = config_1.configManager.getTaskOMaticDir();
|
|
47
|
+
console.log(chalk_1.default.blue(`š Checking for task-o-matic directory: ${taskOMaticDir}`));
|
|
48
|
+
if ((0, fs_1.existsSync)(taskOMaticDir)) {
|
|
49
|
+
console.log(chalk_1.default.yellow("ā ļø This directory is already initialized with task-o-matic."));
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
console.log(chalk_1.default.blue("š Initializing task-o-matic project..."));
|
|
53
|
+
// Create .task-o-matic directory structure
|
|
54
|
+
const dirs = ["tasks", "prd", "logs", "docs"];
|
|
55
|
+
dirs.forEach((dir) => {
|
|
56
|
+
const fullPath = `${taskOMaticDir}/${dir}`;
|
|
57
|
+
(0, fs_1.mkdirSync)(fullPath, { recursive: true });
|
|
58
|
+
console.log(chalk_1.default.green(` ā Created ${fullPath}`));
|
|
59
|
+
});
|
|
60
|
+
// Initialize config with provided options
|
|
61
|
+
const config = {
|
|
62
|
+
ai: {
|
|
63
|
+
provider: options.aiProvider,
|
|
64
|
+
model: options.aiModel,
|
|
65
|
+
maxTokens: parseInt(options.maxTokens) || 32768,
|
|
66
|
+
temperature: parseFloat(options.temperature) || 0.5,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
// Add API key if provided
|
|
70
|
+
if (options.aiKey) {
|
|
71
|
+
config.ai.apiKey = options.aiKey;
|
|
72
|
+
}
|
|
73
|
+
// Add provider URL if provided
|
|
74
|
+
if (options.aiProviderUrl) {
|
|
75
|
+
config.ai.baseURL = options.aiProviderUrl;
|
|
76
|
+
}
|
|
77
|
+
config_1.configManager.setConfig(config);
|
|
78
|
+
config_1.configManager.save();
|
|
79
|
+
console.log(chalk_1.default.green(` ā Created ${taskOMaticDir}/config.json`));
|
|
80
|
+
// Initialize mcp.json with context7 config
|
|
81
|
+
const mcpConfig = {
|
|
82
|
+
context7: {},
|
|
83
|
+
};
|
|
84
|
+
if (options.context7ApiKey) {
|
|
85
|
+
mcpConfig.context7.apiKey = options.context7ApiKey;
|
|
86
|
+
}
|
|
87
|
+
const mcpFilePath = `${taskOMaticDir}/mcp.json`;
|
|
88
|
+
(0, fs_1.writeFileSync)(mcpFilePath, JSON.stringify(mcpConfig, null, 2));
|
|
89
|
+
console.log(chalk_1.default.green(` ā Created ${mcpFilePath}`));
|
|
90
|
+
console.log(chalk_1.default.green("\nā
TaskOMatic project initialized successfully!"));
|
|
91
|
+
// Run bootstrap by default if project name is provided (unless --no-bootstrap)
|
|
92
|
+
if (options.projectName && !options.noBootstrap) {
|
|
93
|
+
console.log(chalk_1.default.blue("\nš Running bootstrap..."));
|
|
94
|
+
// Use working directory for Better-T-Stack execution
|
|
95
|
+
const workingDir = options.directory || process.cwd();
|
|
96
|
+
try {
|
|
97
|
+
const result = await (0, better_t_stack_cli_1.runBetterTStackCLI)(options, workingDir);
|
|
98
|
+
if (result.success) {
|
|
99
|
+
console.log(chalk_1.default.green(result.message));
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
throw new Error(result.message);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
// No chdir needed anymore
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
console.log(chalk_1.default.cyan("\nNext steps:"));
|
|
111
|
+
console.log(" 1. Configure AI provider: task-o-matic config set-ai-provider <provider> <model>");
|
|
112
|
+
console.log(" 2. Bootstrap your project: task-o-matic init bootstrap <project-name>");
|
|
113
|
+
console.log(' 3. Create your first task: task-o-matic tasks create --title "Your first task"');
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
// Bootstrap project with Better-T-Stack
|
|
117
|
+
exports.initCommand
|
|
118
|
+
.command("bootstrap")
|
|
119
|
+
.description("Bootstrap a new project using Better-T-Stack")
|
|
120
|
+
.argument("<name>", "Project name")
|
|
121
|
+
.option("--frontend <frontend>", "Frontend framework (next/tanstack-router/react-router/etc)", "next")
|
|
122
|
+
.option("--backend <backend>", "Backend framework (hono/express/elysia)", "hono")
|
|
123
|
+
.option("--database <database>", "Database (sqlite/postgres/mysql/mongodb)", "sqlite")
|
|
124
|
+
.option("--orm <orm>", "ORM (drizzle/prisma/none)", "drizzle")
|
|
125
|
+
.option("--no-auth", "Exclude authentication")
|
|
126
|
+
.option("--addons <addons... >", "Additional addons (pwa/tauri/starlight/biome/husky/turborepo)")
|
|
127
|
+
.option("--examples <examples... >", "Examples to include (todo/ai)")
|
|
128
|
+
.option("--no-git", "Skip git initialization")
|
|
129
|
+
.option("--package-manager <pm>", "Package manager (npm/pnpm/bun)", "npm")
|
|
130
|
+
.option("--no-install", "Skip installing dependencies")
|
|
131
|
+
.option("--db-setup <setup>", "Database setup (turso/neon/prisma-postgres/mongodb-atlas)")
|
|
132
|
+
.option("--runtime <runtime>", "Runtime (bun/node)", "node")
|
|
133
|
+
.option("--api <type>", "API type (trpc/orpc)")
|
|
134
|
+
.action(async (name, options) => {
|
|
135
|
+
const taskOMaticDir = config_1.configManager.getTaskOMaticDir();
|
|
136
|
+
if (!(0, fs_1.existsSync)(taskOMaticDir)) {
|
|
137
|
+
console.log(chalk_1.default.red("ā This directory is not initialized with task-o-matic."));
|
|
138
|
+
console.log(chalk_1.default.cyan("Run 'task-o-matic init init' first."));
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
console.log(chalk_1.default.blue(`š Bootstrapping project: ${name}`));
|
|
142
|
+
console.log(chalk_1.default.cyan(`Configuration:`));
|
|
143
|
+
console.log(` Frontend: ${options.frontend}`);
|
|
144
|
+
console.log(` Backend: ${options.backend}`);
|
|
145
|
+
console.log(` Database: ${options.database}`);
|
|
146
|
+
console.log(` ORM: ${options.orm}`);
|
|
147
|
+
console.log(` Auth: ${options.noAuth ? "disabled" : "enabled"}`);
|
|
148
|
+
console.log(` Package Manager: ${options.packageManager}`);
|
|
149
|
+
console.log(` Runtime: ${options.runtime}`);
|
|
150
|
+
// Use working directory for Better-T-Stack execution
|
|
151
|
+
const workingDir = config_1.configManager.getWorkingDirectory();
|
|
152
|
+
try {
|
|
153
|
+
const result = await (0, better_t_stack_cli_1.runBetterTStackCLI)({ ...options, name }, workingDir);
|
|
154
|
+
if (result.success) {
|
|
155
|
+
console.log(chalk_1.default.green(result.message));
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
throw new Error(result.message);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
// No chdir needed anymore
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
// Default action - show help
|
|
166
|
+
exports.initCommand.action(() => {
|
|
167
|
+
console.log(chalk_1.default.blue("TaskOMatic Initialization"));
|
|
168
|
+
console.log("");
|
|
169
|
+
console.log(chalk_1.default.cyan("Usage:"));
|
|
170
|
+
console.log(" task-o-matic init init Initialize task-o-matic project");
|
|
171
|
+
console.log(" task-o-matic init bootstrap <name> Bootstrap Better-T-Stack project");
|
|
172
|
+
console.log("");
|
|
173
|
+
console.log(chalk_1.default.cyan("Examples:"));
|
|
174
|
+
console.log(" task-o-matic init init");
|
|
175
|
+
console.log(" task-o-matic init init --project-name my-app");
|
|
176
|
+
console.log(" task-o-matic init init --project-name my-app --ai-provider openrouter --ai-key your-key --frontend next --backend hono");
|
|
177
|
+
console.log(" task-o-matic init init --project-name my-app --no-bootstrap");
|
|
178
|
+
console.log(" task-o-matic init init --directory my-workspace --project-name my-app");
|
|
179
|
+
console.log(" task-o-matic init bootstrap my-app --frontend next --backend hono --database postgres");
|
|
180
|
+
console.log("");
|
|
181
|
+
console.log(chalk_1.default.cyan("Init Options:"));
|
|
182
|
+
console.log(" --ai-provider <provider> AI provider (openrouter/anthropic/openai)");
|
|
183
|
+
console.log(" --ai-model <model> AI model");
|
|
184
|
+
console.log(" --ai-key <key> AI API key");
|
|
185
|
+
console.log(" --ai-provider-url <url> AI provider URL");
|
|
186
|
+
console.log(" --max-tokens <tokens> Max tokens for AI");
|
|
187
|
+
console.log(" --temperature <temp> AI temperature");
|
|
188
|
+
console.log(" --no-bootstrap Skip bootstrap after initialization");
|
|
189
|
+
console.log(" --project-name <name> Project name for bootstrap");
|
|
190
|
+
console.log(" --directory <dir> Working directory for the project");
|
|
191
|
+
console.log("");
|
|
192
|
+
console.log(chalk_1.default.cyan("Bootstrap Options:"));
|
|
193
|
+
console.log(" --frontend <frontend> Frontend framework (next/tanstack-router/react-router/etc)");
|
|
194
|
+
console.log(" --backend <backend> Backend framework (hono/express/elysia)");
|
|
195
|
+
console.log(" --database <database> Database (sqlite/postgres/mysql/mongodb)");
|
|
196
|
+
console.log(" --auth Include authentication");
|
|
197
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prd.d.ts","sourceRoot":"","sources":["../../src/commands/prd.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,eAAO,MAAM,UAAU,SAAmE,CAAC"}
|