@damper/cli 0.5.12 → 0.5.14

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.12';
8
+ const VERSION = '0.5.14';
9
9
  function showHelp() {
10
10
  console.log(`
11
11
  ${pc.bold('@damper/cli')} - Agent orchestration for Damper tasks
@@ -108,35 +108,11 @@ export async function launchClaude(options) {
108
108
  console.log(pc.cyan('Mode: Plan (will ask for approval)'));
109
109
  }
110
110
  console.log();
111
- // Write MCP config to a temp file (more reliable than passing JSON on command line)
112
- const mcpConfigPath = path.join(os.tmpdir(), `damper-mcp-${taskId}.json`);
113
- const mcpConfig = {
114
- mcpServers: {
115
- damper: {
116
- command: 'npx',
117
- args: ['-y', '@damper/mcp'],
118
- env: { DAMPER_API_KEY: apiKey },
119
- },
120
- },
121
- };
122
- fs.writeFileSync(mcpConfigPath, JSON.stringify(mcpConfig, null, 2));
123
- // Build Claude args - keep it simple, context is in TASK_CONTEXT.md
111
+ // Build prompt - context is in TASK_CONTEXT.md, MCP is in .claude/settings.json
124
112
  const initialPrompt = `Read TASK_CONTEXT.md and work on task #${taskId}: ${taskTitle}`;
125
- const claudeArgs = [
126
- '--mcp-config', mcpConfigPath,
127
- initialPrompt,
128
- ];
129
113
  // Launch Claude Code
130
- // Note: MCP config is set globally via 'setup' command
131
- // We just pass the API key via environment variable
132
114
  const { spawnSync } = await import('node:child_process');
133
- // Clean up unused temp MCP config file
134
- try {
135
- fs.unlinkSync(mcpConfigPath);
136
- }
137
- catch {
138
- // Ignore cleanup errors
139
- }
115
+ console.log(pc.dim(`Launching Claude in ${cwd}...`));
140
116
  const result = spawnSync('claude', [initialPrompt], {
141
117
  cwd,
142
118
  stdio: 'inherit',
@@ -155,12 +155,25 @@ export async function createWorktree(options) {
155
155
  isNew: false,
156
156
  };
157
157
  }
158
- const projectName = getProjectName(projectRoot);
159
158
  const shortTaskId = taskId.slice(0, 8);
160
159
  const slug = slugify(taskTitle);
161
- // Use short task ID for directory (keeps paths short), full slug for branch (more descriptive)
162
- const worktreePath = path.resolve(projectRoot, '..', `${projectName}-${shortTaskId}`);
160
+ // Put worktrees in .worktrees folder inside the project
161
+ const worktreesDir = path.join(projectRoot, '.worktrees');
162
+ const worktreePath = path.join(worktreesDir, shortTaskId);
163
163
  const branchName = `feature/${slug}`;
164
+ // Ensure .worktrees is gitignored
165
+ const gitignorePath = path.join(projectRoot, '.gitignore');
166
+ if (fs.existsSync(gitignorePath)) {
167
+ const gitignore = fs.readFileSync(gitignorePath, 'utf-8');
168
+ if (!gitignore.includes('.worktrees')) {
169
+ fs.appendFileSync(gitignorePath, '\n# Damper CLI worktrees\n.worktrees/\n');
170
+ console.log(pc.dim('Added .worktrees/ to .gitignore'));
171
+ }
172
+ }
173
+ else {
174
+ fs.writeFileSync(gitignorePath, '# Damper CLI worktrees\n.worktrees/\n');
175
+ console.log(pc.dim('Created .gitignore with .worktrees/'));
176
+ }
164
177
  // Check if worktree directory already exists
165
178
  if (fs.existsSync(worktreePath)) {
166
179
  console.log(pc.dim(`Worktree directory already exists at ${worktreePath}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@damper/cli",
3
- "version": "0.5.12",
3
+ "version": "0.5.14",
4
4
  "description": "CLI tool for orchestrating Damper task workflows with Claude Code",
5
5
  "author": "Damper <hello@usedamper.com>",
6
6
  "repository": {