@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.
- package/dist/commands/start.js +1 -0
- package/dist/index.js +1 -1
- package/dist/services/worktree.d.ts +1 -0
- package/dist/services/worktree.js +34 -3
- package/package.json +1 -1
package/dist/commands/start.js
CHANGED
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.
|
|
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
|
|
@@ -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
|
-
//
|
|
162
|
-
const
|
|
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,
|