@damper/cli 0.5.11 → 0.5.13

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.
@@ -128,6 +128,7 @@ export async function startCommand(options) {
128
128
  taskId,
129
129
  taskTitle,
130
130
  projectRoot,
131
+ apiKey,
131
132
  });
132
133
  worktreePath = worktreeResult.path;
133
134
  if (worktreeResult.isNew) {
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.11';
8
+ const VERSION = '0.5.13';
9
9
  function showHelp() {
10
10
  console.log(`
11
11
  ${pc.bold('@damper/cli')} - Agent orchestration for Damper tasks
@@ -2,6 +2,7 @@ export interface WorktreeOptions {
2
2
  taskId: string;
3
3
  taskTitle: string;
4
4
  projectRoot: string;
5
+ apiKey: string;
5
6
  }
6
7
  export interface WorktreeResult {
7
8
  path: string;
@@ -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}`));
@@ -241,6 +254,24 @@ export async function createWorktree(options) {
241
254
  await fs.promises.copyFile(source, target);
242
255
  }
243
256
  }
257
+ // Create .claude/settings.json with Damper MCP configured
258
+ const claudeDir = path.join(worktreePath, '.claude');
259
+ if (!fs.existsSync(claudeDir)) {
260
+ fs.mkdirSync(claudeDir, { recursive: true });
261
+ }
262
+ const claudeSettings = {
263
+ mcpServers: {
264
+ damper: {
265
+ command: 'npx',
266
+ args: ['-y', '@damper/mcp'],
267
+ env: {
268
+ DAMPER_API_KEY: options.apiKey,
269
+ },
270
+ },
271
+ },
272
+ };
273
+ fs.writeFileSync(path.join(claudeDir, 'settings.json'), JSON.stringify(claudeSettings, null, 2));
274
+ console.log(pc.dim('Created .claude/settings.json with Damper MCP'));
244
275
  // Save to state
245
276
  const worktreeState = {
246
277
  taskId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@damper/cli",
3
- "version": "0.5.11",
3
+ "version": "0.5.13",
4
4
  "description": "CLI tool for orchestrating Damper task workflows with Claude Code",
5
5
  "author": "Damper <hello@usedamper.com>",
6
6
  "repository": {