@damper/cli 0.4.0 → 0.4.1

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
@@ -4,7 +4,7 @@ import { startCommand } from './commands/start.js';
4
4
  import { statusCommand } from './commands/status.js';
5
5
  import { cleanupCommand } from './commands/cleanup.js';
6
6
  import { setupCommand } from './commands/setup.js';
7
- const VERSION = '0.4.0';
7
+ const VERSION = '0.4.1';
8
8
  function showHelp() {
9
9
  console.log(`
10
10
  ${pc.bold('@damper/cli')} - Agent orchestration for Damper tasks
@@ -236,21 +236,46 @@ export async function postTaskFlow(options) {
236
236
  console.log(pc.dim('You have uncommitted changes. Commit them before pushing.\n'));
237
237
  }
238
238
  if (hasUnpushedCommits && !hasUncommittedChanges) {
239
- const shouldPush = await confirm({
240
- message: 'Push commits to remote?',
241
- default: true,
239
+ const { select } = await import('@inquirer/prompts');
240
+ const mergeAction = await select({
241
+ message: 'How do you want to merge your changes?',
242
+ choices: [
243
+ { name: 'Create a pull request', value: 'pr' },
244
+ { name: 'Merge directly to main', value: 'merge' },
245
+ { name: 'Just push (decide later)', value: 'push' },
246
+ { name: 'Skip (keep local)', value: 'skip' },
247
+ ],
242
248
  });
243
- if (shouldPush) {
249
+ if (mergeAction === 'skip') {
250
+ console.log(pc.dim('Keeping changes local.\n'));
251
+ }
252
+ else if (mergeAction === 'merge') {
253
+ // Merge directly to main
254
+ try {
255
+ const { execa } = await import('execa');
256
+ console.log(pc.dim('Switching to main and merging...'));
257
+ // Fetch latest main
258
+ await execa('git', ['fetch', 'origin', 'main'], { cwd, stdio: 'pipe' });
259
+ // Checkout main in the main project root (not worktree)
260
+ await execa('git', ['checkout', 'main'], { cwd: projectRoot, stdio: 'pipe' });
261
+ // Merge the feature branch
262
+ await execa('git', ['merge', currentBranch, '--no-edit'], { cwd: projectRoot, stdio: 'inherit' });
263
+ // Push main
264
+ await execa('git', ['push', 'origin', 'main'], { cwd: projectRoot, stdio: 'inherit' });
265
+ console.log(pc.green('✓ Merged to main and pushed\n'));
266
+ }
267
+ catch (err) {
268
+ console.log(pc.red('Failed to merge. You may need to resolve conflicts manually.\n'));
269
+ }
270
+ }
271
+ else {
272
+ // Push first (needed for both 'pr' and 'push')
244
273
  try {
245
274
  const { execa } = await import('execa');
246
275
  await execa('git', ['push', '-u', 'origin', currentBranch], { cwd, stdio: 'inherit' });
247
276
  console.log(pc.green('✓ Pushed to remote\n'));
248
- // Offer to create PR
249
- const shouldCreatePR = await confirm({
250
- message: 'Create a pull request?',
251
- default: true,
252
- });
253
- if (shouldCreatePR) {
277
+ // Create PR if requested
278
+ if (mergeAction === 'pr') {
254
279
  try {
255
280
  await execa('gh', ['pr', 'create', '--fill'], { cwd, stdio: 'inherit' });
256
281
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@damper/cli",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "CLI tool for orchestrating Damper task workflows with Claude Code",
5
5
  "author": "Damper <hello@usedamper.com>",
6
6
  "repository": {