@damper/cli 0.5.1 → 0.5.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/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.1';
8
+ const VERSION = '0.5.2';
9
9
  function showHelp() {
10
10
  console.log(`
11
11
  ${pc.bold('@damper/cli')} - Agent orchestration for Damper tasks
@@ -109,28 +109,6 @@ export async function launchClaude(options) {
109
109
  console.log(pc.cyan('Mode: Plan (will ask for approval)'));
110
110
  }
111
111
  console.log();
112
- // Build initial prompt
113
- const planModeNote = yolo ? '' : `
114
- You're in PLAN MODE. First, read TASK_CONTEXT.md and create an implementation plan.
115
- Do NOT log anything to Damper (no add_commit, add_note) until your plan is approved.
116
- Once approved, switch to implementation and start logging your work.
117
- `;
118
- const initialPrompt = [
119
- `I'm working on task #${taskId}: ${taskTitle}`,
120
- planModeNote,
121
- 'Please read TASK_CONTEXT.md for full context, critical rules, and the implementation plan.',
122
- '',
123
- 'Task workflow (after plan approval):',
124
- '1. Use `add_commit` after each git commit',
125
- '2. Use `add_note` for important decisions',
126
- '3. Call `complete_task` when done or `abandon_task` if stopping early',
127
- '',
128
- 'About this session: You were launched by @damper/cli.',
129
- 'The CLI created this worktree, bootstrapped TASK_CONTEXT.md, and configured Damper MCP.',
130
- '',
131
- 'Self-improvement: If you encounter friction, bugs, or have ideas to improve the CLI/workflow,',
132
- 'use `report_issue` to log them. Your feedback improves tooling for all future tasks.',
133
- ].join('\n');
134
112
  // Write MCP config to a temp file (more reliable than passing JSON on command line)
135
113
  const mcpConfigPath = path.join(os.tmpdir(), `damper-mcp-${taskId}.json`);
136
114
  const mcpConfig = {
@@ -143,24 +121,35 @@ Once approved, switch to implementation and start logging your work.
143
121
  },
144
122
  };
145
123
  fs.writeFileSync(mcpConfigPath, JSON.stringify(mcpConfig, null, 2));
146
- // Build Claude args
124
+ // Build Claude args - keep it simple, context is in TASK_CONTEXT.md
125
+ const initialPrompt = `Read TASK_CONTEXT.md and work on task #${taskId}: ${taskTitle}`;
147
126
  const claudeArgs = [
148
- '--permission-mode', yolo ? 'acceptEdits' : 'plan',
149
127
  '--mcp-config', mcpConfigPath,
150
128
  initialPrompt,
151
129
  ];
152
- // Launch Claude Code in interactive mode using spawn for better TTY handling
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
153
136
  try {
154
137
  await new Promise((resolve, reject) => {
155
138
  const child = spawn('claude', claudeArgs, {
156
139
  cwd,
157
140
  stdio: 'inherit',
141
+ shell: true, // Use shell to ensure proper TTY handling
158
142
  env: {
159
143
  ...process.env,
160
144
  DAMPER_API_KEY: apiKey,
161
145
  },
162
146
  });
163
- child.on('close', () => resolve());
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
+ });
164
153
  child.on('error', (err) => {
165
154
  if (err.code === 'ENOENT') {
166
155
  console.log(pc.red('\nError: Claude Code CLI not found.'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@damper/cli",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "CLI tool for orchestrating Damper task workflows with Claude Code",
5
5
  "author": "Damper <hello@usedamper.com>",
6
6
  "repository": {