@damper/cli 0.5.2 → 0.5.4

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/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { statusCommand } from './commands/status.js';
5
5
  import { cleanupCommand } from './commands/cleanup.js';
6
6
  import { setupCommand } from './commands/setup.js';
7
7
  import { releaseCommand } from './commands/release.js';
8
- const VERSION = '0.5.2';
8
+ const VERSION = '0.5.4';
9
9
  function showHelp() {
10
10
  console.log(`
11
11
  ${pc.bold('@damper/cli')} - Agent orchestration for Damper tasks
@@ -1,7 +1,6 @@
1
1
  import * as fs from 'node:fs';
2
2
  import * as path from 'node:path';
3
3
  import * as os from 'node:os';
4
- import { spawn } from 'node:child_process';
5
4
  import { execa } from 'execa';
6
5
  import pc from 'picocolors';
7
6
  const CLAUDE_SETTINGS_DIR = path.join(os.homedir(), '.claude');
@@ -127,40 +126,30 @@ export async function launchClaude(options) {
127
126
  '--mcp-config', mcpConfigPath,
128
127
  initialPrompt,
129
128
  ];
130
- // Debug: show what we're about to run
131
- if (process.env.DEBUG) {
132
- console.log(pc.dim(`Debug: claude ${claudeArgs.join(' ')}`));
133
- console.log(pc.dim(`Debug: MCP config at ${mcpConfigPath}`));
134
- }
135
- // Launch Claude Code in interactive mode
129
+ // Launch Claude Code - just use execa which handles this well
136
130
  try {
137
- await new Promise((resolve, reject) => {
138
- const child = spawn('claude', claudeArgs, {
139
- cwd,
140
- stdio: 'inherit',
141
- shell: true, // Use shell to ensure proper TTY handling
142
- env: {
143
- ...process.env,
144
- DAMPER_API_KEY: apiKey,
145
- },
146
- });
147
- child.on('close', (code) => {
148
- if (process.env.DEBUG) {
149
- console.log(pc.dim(`Debug: Claude exited with code ${code}`));
150
- }
151
- resolve();
152
- });
153
- child.on('error', (err) => {
154
- if (err.code === 'ENOENT') {
155
- console.log(pc.red('\nError: Claude Code CLI not found.'));
156
- console.log(pc.dim('Install it with: npm install -g @anthropic-ai/claude-code\n'));
157
- process.exit(1);
158
- }
159
- reject(err);
160
- });
131
+ console.log(pc.dim('Launching Claude...'));
132
+ // Simple approach: just launch claude in the directory
133
+ // MCP config is passed, prompt is simple
134
+ await execa('claude', [
135
+ '--mcp-config', mcpConfigPath,
136
+ initialPrompt
137
+ ], {
138
+ cwd,
139
+ stdio: 'inherit',
140
+ env: {
141
+ ...process.env,
142
+ DAMPER_API_KEY: apiKey,
143
+ },
161
144
  });
162
145
  }
163
- catch {
146
+ catch (err) {
147
+ const error = err;
148
+ if (error.code === 'ENOENT') {
149
+ console.log(pc.red('\nError: Claude Code CLI not found.'));
150
+ console.log(pc.dim('Install it with: npm install -g @anthropic-ai/claude-code\n'));
151
+ process.exit(1);
152
+ }
164
153
  // Claude exited with error - still continue to post-task flow
165
154
  }
166
155
  finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@damper/cli",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "description": "CLI tool for orchestrating Damper task workflows with Claude Code",
5
5
  "author": "Damper <hello@usedamper.com>",
6
6
  "repository": {