clavix 2.4.1 → 2.4.2

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/bin/clavix.js CHANGED
@@ -2,14 +2,4 @@
2
2
 
3
3
  require('../dist/index.js')
4
4
  .run()
5
- .catch((error) => {
6
- // ExitError from OCLIF is thrown when this.error() is called
7
- // It already displays the error message, so we just exit with the code
8
- if (error.oclif && error.oclif.exit !== undefined) {
9
- process.exit(error.oclif.exit);
10
- }
11
-
12
- // For other errors, display them
13
- console.error(error);
14
- process.exit(1);
15
- });
5
+ .catch(require('@oclif/core/handle'));
@@ -67,7 +67,7 @@ class Implement extends core_1.Command {
67
67
  const prdPath = await manager.findPrdDirectory(flags.project);
68
68
  tasksPath = path.join(prdPath, 'tasks.md');
69
69
  if (!(await fs.pathExists(tasksPath))) {
70
- this.error(chalk_1.default.red('Error: No tasks.md found!') +
70
+ this.error(chalk_1.default.red('No tasks.md found!') +
71
71
  '\n\n' +
72
72
  chalk_1.default.yellow('Hint: Run ') + chalk_1.default.cyan('clavix plan') + chalk_1.default.yellow(' first to generate task breakdown'));
73
73
  }
@@ -187,13 +187,7 @@ class Implement extends core_1.Command {
187
187
  }
188
188
  catch (error) {
189
189
  const errorMessage = error instanceof Error ? error.message : 'An unexpected error occurred';
190
- let fullMessage = chalk_1.default.red(`Error: ${errorMessage}`);
191
- // Provide helpful hints
192
- if (error instanceof Error && error.message.includes('tasks.md')) {
193
- fullMessage += '\n\n' + chalk_1.default.yellow('Hint: Make sure you have generated a task plan first') +
194
- '\n' + chalk_1.default.gray('Run ') + chalk_1.default.cyan('clavix plan') + chalk_1.default.gray(' to create tasks.md');
195
- }
196
- this.error(fullMessage);
190
+ this.error(chalk_1.default.red(errorMessage));
197
191
  }
198
192
  }
199
193
  /**
@@ -325,7 +319,7 @@ class Implement extends core_1.Command {
325
319
  }
326
320
  catch (error) {
327
321
  const errorMessage = error instanceof Error ? error.message : 'Unknown error';
328
- this.error(chalk_1.default.red(`Error running clavix plan: ${errorMessage}`));
322
+ this.error(chalk_1.default.red(`Running clavix plan failed: ${errorMessage}`));
329
323
  }
330
324
  }
331
325
  else {
@@ -69,7 +69,7 @@ class Plan extends core_1.Command {
69
69
  if (!prdPath) {
70
70
  selectedProject = await this.resolveProjectDirectory(manager, flags.project);
71
71
  if (!selectedProject) {
72
- this.error(chalk_1.default.red('Error: No PRD projects found in .clavix/outputs/') +
72
+ this.error(chalk_1.default.red('No PRD projects found in .clavix/outputs/') +
73
73
  '\n\n' +
74
74
  chalk_1.default.gray("Hint: Run 'clavix prd' to generate a PRD, 'clavix summarize' to create a mini-PRD, or use 'clavix plan --session <id>'"));
75
75
  }
@@ -91,12 +91,12 @@ class Plan extends core_1.Command {
91
91
  console.log(chalk_1.default.dim('Looking for PRD artifacts...'));
92
92
  const availableSources = await manager.detectAvailableSources(prdPath);
93
93
  if (availableSources.length === 0) {
94
- this.error(chalk_1.default.red('Error: No PRD artifacts found in this directory') +
94
+ this.error(chalk_1.default.red('No PRD artifacts found in this directory') +
95
95
  '\n\n' +
96
96
  chalk_1.default.gray('Hint: Generate a PRD with clavix prd, run clavix summarize, or supply a session via --session'));
97
97
  }
98
98
  if (sourcePreference !== 'auto' && !availableSources.includes(sourcePreference)) {
99
- this.error(chalk_1.default.red(`Error: Preferred source "${sourcePreference}" not found in ${prdPath}`) +
99
+ this.error(chalk_1.default.red(`Preferred source "${sourcePreference}" not found in ${prdPath}`) +
100
100
  '\n\n' +
101
101
  chalk_1.default.gray(`Hint: Available sources: ${availableSources.join(', ') || 'none'}. Override with --source`));
102
102
  }
@@ -159,26 +159,7 @@ class Plan extends core_1.Command {
159
159
  }
160
160
  catch (error) {
161
161
  const errorMessage = error instanceof Error ? error.message : 'An unexpected error occurred';
162
- let fullMessage = chalk_1.default.red(`Error: ${errorMessage}`);
163
- if (error instanceof Error) {
164
- if (error.message.includes('Session has no messages')) {
165
- fullMessage += '\n\n' + chalk_1.default.gray('Hint: Add conversation messages with clavix start before running plan --session');
166
- }
167
- else if (error.message.includes('Session not found')) {
168
- fullMessage += '\n\n' + chalk_1.default.gray('Hint: Check the session ID with clavix list');
169
- }
170
- else if (error.message.includes('No active session')) {
171
- fullMessage += '\n\n' + chalk_1.default.gray('Hint: Start a session with clavix start before using --active-session');
172
- }
173
- else if (error.message.includes('PRD project not found')) {
174
- fullMessage += '\n\n' + chalk_1.default.gray("Hint: Run 'clavix list' to see available outputs or specify a valid project name");
175
- }
176
- else if (error.message.includes('No PRD')) {
177
- fullMessage += '\n\n' + chalk_1.default.yellow('Hint: Create a PRD first') +
178
- '\n' + chalk_1.default.gray('Run ') + chalk_1.default.cyan('clavix prd') + chalk_1.default.gray(' to generate a new PRD');
179
- }
180
- }
181
- this.error(fullMessage);
162
+ this.error(chalk_1.default.red(errorMessage));
182
163
  }
183
164
  }
184
165
  validateSessionFlags(session, activeSession) {
@@ -138,7 +138,7 @@ class Prd extends core_1.Command {
138
138
  if (answer && answer.toString().trim() && question) {
139
139
  const submitResult = engine.submitAnswer(question.id, answer);
140
140
  if (submitResult !== true) {
141
- console.log(chalk_1.default.red(`\nError: ${submitResult}\n`));
141
+ console.log(chalk_1.default.red(`\n${submitResult}\n`));
142
142
  continue; // Ask again
143
143
  }
144
144
  answers[question.id] = answer;
@@ -173,7 +173,7 @@ class Prd extends core_1.Command {
173
173
  }
174
174
  catch (error) {
175
175
  const errorMessage = error instanceof Error ? error.message : 'An unexpected error occurred';
176
- this.error(chalk_1.default.red(`Error: ${errorMessage}`));
176
+ this.error(chalk_1.default.red(errorMessage));
177
177
  }
178
178
  }
179
179
  /**
@@ -72,7 +72,7 @@ class Start extends core_1.Command {
72
72
  }
73
73
  catch (error) {
74
74
  const errorMessage = error instanceof Error ? error.message : 'An unexpected error occurred';
75
- this.error(chalk_1.default.red(`Error: ${errorMessage}`));
75
+ this.error(chalk_1.default.red(errorMessage));
76
76
  }
77
77
  }
78
78
  /**
@@ -56,14 +56,14 @@ class Summarize extends core_1.Command {
56
56
  console.log(chalk_1.default.dim(`Loading session ${args.sessionId}...\n`));
57
57
  session = await manager.getSession(args.sessionId);
58
58
  if (!session) {
59
- this.error(chalk_1.default.red(`Error: Session not found: ${args.sessionId}`));
59
+ this.error(chalk_1.default.red(`Session not found: ${args.sessionId}`));
60
60
  }
61
61
  }
62
62
  else if (flags.active) {
63
63
  console.log(chalk_1.default.dim('Loading most recent active session...\n'));
64
64
  session = await manager.getActiveSession();
65
65
  if (!session) {
66
- this.error(chalk_1.default.red('Error: No active session found') +
66
+ this.error(chalk_1.default.red('No active session found') +
67
67
  '\n\n' +
68
68
  chalk_1.default.gray('Hint: Use ') + chalk_1.default.cyan('clavix list') + chalk_1.default.gray(' to see all sessions'));
69
69
  }
@@ -138,7 +138,7 @@ class Summarize extends core_1.Command {
138
138
  }
139
139
  catch (error) {
140
140
  const errorMessage = error instanceof Error ? error.message : 'An unexpected error occurred';
141
- this.error(chalk_1.default.red(`Error: ${errorMessage}`));
141
+ this.error(chalk_1.default.red(errorMessage));
142
142
  }
143
143
  }
144
144
  /**
package/dist/index.js CHANGED
@@ -8,15 +8,6 @@ async function run(argv) {
8
8
  }
9
9
  // Run if called directly
10
10
  if (require.main === module) {
11
- run().catch((error) => {
12
- // ExitError from OCLIF is thrown when this.error() is called
13
- // It already displays the error message, so we just exit with the code
14
- if (error.oclif && error.oclif.exit !== undefined) {
15
- process.exit(error.oclif.exit);
16
- }
17
- // For other errors, display them
18
- console.error(error);
19
- process.exit(1);
20
- });
11
+ run().catch(core_1.handle);
21
12
  }
22
13
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavix",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "Transform vague ideas into production-ready prompts. CLI tool using the CLEAR framework to analyze, improve, and generate PRDs for AI coding assistants (Claude Code, Cursor, Windsurf, and more)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",