clavix 2.4.2 → 2.4.3

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
@@ -1,5 +1,24 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ // Disable debug mode (stack traces) unless explicitly requested via DEBUG env var
4
+ if (!process.env.DEBUG) {
5
+ require('@oclif/core').settings.debug = false;
6
+ }
7
+
8
+ // Custom error handler to suppress stack traces
9
+ async function handleError(error) {
10
+ // For CLIError, show only the formatted message
11
+ if (error.oclif && error.oclif.exit !== undefined) {
12
+ // Format error message (hints are now included in error.message)
13
+ console.error(' › Error: ' + error.message);
14
+ process.exit(error.oclif.exit);
15
+ }
16
+
17
+ // For other errors, use default handler
18
+ const { handle } = require('@oclif/core');
19
+ return handle(error);
20
+ }
21
+
3
22
  require('../dist/index.js')
4
23
  .run()
5
- .catch(require('@oclif/core/handle'));
24
+ .catch(handleError);
@@ -67,9 +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('No tasks.md found!') +
71
- '\n\n' +
72
- chalk_1.default.yellow('Hint: Run ') + chalk_1.default.cyan('clavix plan') + chalk_1.default.yellow(' first to generate task breakdown'));
70
+ this.error('No tasks.md found\n\nHint: Run "clavix plan" first to generate task breakdown');
73
71
  }
74
72
  console.log(chalk_1.default.dim(`Found: ${tasksPath}\n`));
75
73
  }
@@ -187,7 +185,7 @@ class Implement extends core_1.Command {
187
185
  }
188
186
  catch (error) {
189
187
  const errorMessage = error instanceof Error ? error.message : 'An unexpected error occurred';
190
- this.error(chalk_1.default.red(errorMessage));
188
+ this.error(errorMessage);
191
189
  }
192
190
  }
193
191
  /**
@@ -234,9 +232,7 @@ class Implement extends core_1.Command {
234
232
  }
235
233
  // No PRD projects found
236
234
  if (prdProjects.length === 0) {
237
- this.error(chalk_1.default.yellow('Warning: No PRD projects found in .clavix/outputs/') +
238
- '\n\n' +
239
- chalk_1.default.gray('Hint: Create a PRD first using ') + chalk_1.default.cyan('clavix prd'));
235
+ this.error('No PRD projects found in .clavix/outputs/\n\nHint: Create a PRD first using: clavix prd');
240
236
  }
241
237
  // Only one PRD - auto-select
242
238
  if (prdProjects.length === 1) {
@@ -319,7 +315,7 @@ class Implement extends core_1.Command {
319
315
  }
320
316
  catch (error) {
321
317
  const errorMessage = error instanceof Error ? error.message : 'Unknown error';
322
- this.error(chalk_1.default.red(`Running clavix plan failed: ${errorMessage}`));
318
+ this.error(`Running clavix plan failed: ${errorMessage}`);
323
319
  }
324
320
  }
325
321
  else {
@@ -69,9 +69,11 @@ 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('No PRD projects found in .clavix/outputs/') +
73
- '\n\n' +
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>'"));
72
+ this.error('No PRD projects found in .clavix/outputs/\n\n' +
73
+ 'Hints:\n' +
74
+ ' • Run "clavix prd" to generate a PRD\n' +
75
+ ' • Run "clavix summarize" to create a mini-PRD\n' +
76
+ ' • Use "clavix plan --session <id>" to plan from a session');
75
77
  }
76
78
  prdPath = selectedProject.path;
77
79
  projectName = selectedProject.name;
@@ -91,14 +93,16 @@ class Plan extends core_1.Command {
91
93
  console.log(chalk_1.default.dim('Looking for PRD artifacts...'));
92
94
  const availableSources = await manager.detectAvailableSources(prdPath);
93
95
  if (availableSources.length === 0) {
94
- this.error(chalk_1.default.red('No PRD artifacts found in this directory') +
95
- '\n\n' +
96
- chalk_1.default.gray('Hint: Generate a PRD with clavix prd, run clavix summarize, or supply a session via --session'));
96
+ this.error('No PRD artifacts found in this directory\n\n' +
97
+ 'Hints:\n' +
98
+ ' Generate a PRD with: clavix prd\n' +
99
+ ' • Create a mini-PRD with: clavix summarize\n' +
100
+ ' • Plan from a session with: clavix plan --session <id>');
97
101
  }
98
102
  if (sourcePreference !== 'auto' && !availableSources.includes(sourcePreference)) {
99
- this.error(chalk_1.default.red(`Preferred source "${sourcePreference}" not found in ${prdPath}`) +
100
- '\n\n' +
101
- chalk_1.default.gray(`Hint: Available sources: ${availableSources.join(', ') || 'none'}. Override with --source`));
103
+ this.error(`Preferred source "${sourcePreference}" not found in ${prdPath}\n\n` +
104
+ `Available sources: ${availableSources.join(', ') || 'none'}\n` +
105
+ 'Hint: Override with --source flag');
102
106
  }
103
107
  if (availableSources.length > 1 && sourcePreference === 'auto') {
104
108
  console.log(chalk_1.default.dim(`Found multiple sources (${availableSources.join(', ')}). Selecting best match...`));
@@ -159,7 +163,7 @@ class Plan extends core_1.Command {
159
163
  }
160
164
  catch (error) {
161
165
  const errorMessage = error instanceof Error ? error.message : 'An unexpected error occurred';
162
- this.error(chalk_1.default.red(errorMessage));
166
+ this.error(errorMessage);
163
167
  }
164
168
  }
165
169
  validateSessionFlags(session, activeSession) {
@@ -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(errorMessage));
176
+ this.error(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(errorMessage));
75
+ this.error(errorMessage);
76
76
  }
77
77
  }
78
78
  /**
@@ -56,28 +56,25 @@ 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(`Session not found: ${args.sessionId}`));
59
+ this.error(`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('No active session found') +
67
- '\n\n' +
68
- chalk_1.default.gray('Hint: Use ') + chalk_1.default.cyan('clavix list') + chalk_1.default.gray(' to see all sessions'));
66
+ this.error('No active session found\n\nHint: Use "clavix list" to see all sessions');
69
67
  }
70
68
  }
71
69
  else {
72
70
  // Try to get active session by default
73
71
  session = await manager.getActiveSession();
74
72
  if (!session) {
75
- this.error(chalk_1.default.yellow('Warning: No active session found') +
76
- '\n\n' +
77
- chalk_1.default.gray('Usage:') +
78
- '\n' + chalk_1.default.gray('') + chalk_1.default.cyan('clavix summarize <session-id>') + chalk_1.default.gray(' - Summarize specific session') +
79
- '\n' + chalk_1.default.gray('') + chalk_1.default.cyan('clavix summarize --active') + chalk_1.default.gray(' - Summarize most recent active session') +
80
- '\n' + chalk_1.default.gray(' • ') + chalk_1.default.cyan('clavix list') + chalk_1.default.gray(' - View all sessions'));
73
+ this.error('No active session found\n\n' +
74
+ 'Usage:\n' +
75
+ ' • clavix summarize <session-id> - Summarize specific session\n' +
76
+ ' • clavix summarize --active - Summarize most recent active session\n' +
77
+ ' • clavix list - View all sessions');
81
78
  }
82
79
  }
83
80
  // Display session info
@@ -89,7 +86,7 @@ class Summarize extends core_1.Command {
89
86
  console.log();
90
87
  // Check if session has messages
91
88
  if (session.messages.length === 0) {
92
- this.error(chalk_1.default.yellow('Warning: Session has no messages to analyze'));
89
+ this.error('Session has no messages to analyze');
93
90
  }
94
91
  // Analyze conversation
95
92
  console.log(chalk_1.default.dim('Analyzing conversation...\n'));
@@ -138,7 +135,7 @@ class Summarize extends core_1.Command {
138
135
  }
139
136
  catch (error) {
140
137
  const errorMessage = error instanceof Error ? error.message : 'An unexpected error occurred';
141
- this.error(chalk_1.default.red(errorMessage));
138
+ this.error(errorMessage);
142
139
  }
143
140
  }
144
141
  /**
package/dist/index.js CHANGED
@@ -4,6 +4,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.run = run;
5
5
  const core_1 = require("@oclif/core");
6
6
  async function run(argv) {
7
+ // Disable debug mode (stack traces) unless explicitly requested via DEBUG env var
8
+ if (!process.env.DEBUG) {
9
+ core_1.settings.debug = false;
10
+ }
7
11
  return (0, core_1.run)(argv);
8
12
  }
9
13
  // Run if called directly
@@ -1,3 +1,3 @@
1
1
  import { AgentAdapter, CommandTemplate } from '../types/agent';
2
- export declare function loadCommandTemplates(adapter: AgentAdapter): Promise<CommandTemplate[]>;
2
+ export declare function loadCommandTemplates(_adapter: AgentAdapter): Promise<CommandTemplate[]>;
3
3
  //# sourceMappingURL=template-loader.d.ts.map
@@ -36,7 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.loadCommandTemplates = loadCommandTemplates;
37
37
  const path = __importStar(require("path"));
38
38
  const file_system_1 = require("./file-system");
39
- async function loadCommandTemplates(adapter) {
39
+ async function loadCommandTemplates(_adapter) {
40
40
  // Load from canonical template source (always .md files)
41
41
  const templatesDir = getCanonicalTemplatesDirectory();
42
42
  const files = await file_system_1.FileSystem.listFiles(templatesDir);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavix",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
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",