claude-issue-solver 1.37.0 → 1.39.0
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/review.js +4 -10
- package/dist/commands/select.d.ts +2 -1
- package/dist/commands/select.js +2 -2
- package/dist/commands/solve.d.ts +4 -1
- package/dist/commands/solve.js +37 -17
- package/dist/index.js +4 -3
- package/package.json +1 -1
package/dist/commands/review.js
CHANGED
|
@@ -217,9 +217,6 @@ Start by examining the diff and the changed files, then provide your review.`;
|
|
|
217
217
|
const runnerContent = `#!/bin/bash
|
|
218
218
|
cd "${projectRoot}"
|
|
219
219
|
|
|
220
|
-
# Disable Oh My Zsh auto-update prompt to prevent blocking
|
|
221
|
-
export DISABLE_AUTO_UPDATE="true"
|
|
222
|
-
|
|
223
220
|
# Set bot token if configured
|
|
224
221
|
${botTokenEnv}
|
|
225
222
|
|
|
@@ -271,8 +268,8 @@ fi
|
|
|
271
268
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
272
269
|
echo ""
|
|
273
270
|
|
|
274
|
-
# Keep terminal open
|
|
275
|
-
exec bash
|
|
271
|
+
# Keep terminal open with minimal shell (skip rc files to avoid prompts)
|
|
272
|
+
exec bash --norc --noprofile
|
|
276
273
|
`;
|
|
277
274
|
fs.writeFileSync(runnerScript, runnerContent, { mode: 0o755 });
|
|
278
275
|
console.log();
|
|
@@ -508,9 +505,6 @@ Start by examining the diff and the changed files, then provide your review.`;
|
|
|
508
505
|
const runnerContent = `#!/bin/bash
|
|
509
506
|
cd "${projectRoot}"
|
|
510
507
|
|
|
511
|
-
# Disable Oh My Zsh auto-update prompt to prevent blocking
|
|
512
|
-
export DISABLE_AUTO_UPDATE="true"
|
|
513
|
-
|
|
514
508
|
# Set bot token if configured
|
|
515
509
|
${botTokenEnv}
|
|
516
510
|
|
|
@@ -562,8 +556,8 @@ fi
|
|
|
562
556
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
563
557
|
echo ""
|
|
564
558
|
|
|
565
|
-
# Keep terminal open
|
|
566
|
-
exec bash
|
|
559
|
+
# Keep terminal open with minimal shell (skip rc files to avoid prompts)
|
|
560
|
+
exec bash --norc --noprofile
|
|
567
561
|
`;
|
|
568
562
|
fs.writeFileSync(runnerScript, runnerContent, { mode: 0o755 });
|
|
569
563
|
console.log(chalk_1.default.dim(` Starting review for PR #${pr.number}: ${pr.title.slice(0, 50)}...`));
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { SolveOptions } from './solve';
|
|
2
|
+
export declare function selectCommand(options?: SolveOptions): Promise<void>;
|
package/dist/commands/select.js
CHANGED
|
@@ -9,7 +9,7 @@ const inquirer_1 = __importDefault(require("inquirer"));
|
|
|
9
9
|
const github_1 = require("../utils/github");
|
|
10
10
|
const git_1 = require("../utils/git");
|
|
11
11
|
const solve_1 = require("./solve");
|
|
12
|
-
async function selectCommand() {
|
|
12
|
+
async function selectCommand(options = {}) {
|
|
13
13
|
const projectName = (0, git_1.getProjectName)();
|
|
14
14
|
console.log(chalk_1.default.bold(`\nOpen issues for ${projectName}:\n`));
|
|
15
15
|
const issues = (0, github_1.listIssues)();
|
|
@@ -44,7 +44,7 @@ async function selectCommand() {
|
|
|
44
44
|
}
|
|
45
45
|
console.log(chalk_1.default.cyan(`\nStarting ${issueNumbers.length} issue(s)...\n`));
|
|
46
46
|
for (const issueNumber of issueNumbers) {
|
|
47
|
-
await (0, solve_1.solveCommand)(issueNumber);
|
|
47
|
+
await (0, solve_1.solveCommand)(issueNumber, options);
|
|
48
48
|
console.log();
|
|
49
49
|
}
|
|
50
50
|
}
|
package/dist/commands/solve.d.ts
CHANGED
package/dist/commands/solve.js
CHANGED
|
@@ -45,7 +45,7 @@ const child_process_1 = require("child_process");
|
|
|
45
45
|
const github_1 = require("../utils/github");
|
|
46
46
|
const git_1 = require("../utils/git");
|
|
47
47
|
const helpers_1 = require("../utils/helpers");
|
|
48
|
-
async function solveCommand(issueNumber) {
|
|
48
|
+
async function solveCommand(issueNumber, options = {}) {
|
|
49
49
|
const spinner = (0, ora_1.default)(`Fetching issue #${issueNumber}...`).start();
|
|
50
50
|
const issue = (0, github_1.getIssue)(issueNumber);
|
|
51
51
|
if (!issue) {
|
|
@@ -125,12 +125,42 @@ Instructions:
|
|
|
125
125
|
fs.writeFileSync(promptFile, prompt);
|
|
126
126
|
// Create runner script
|
|
127
127
|
const runnerScript = path.join(worktreePath, '.claude-runner.sh');
|
|
128
|
+
const autoClose = options.autoClose || false;
|
|
129
|
+
const autoCloseEnding = `
|
|
130
|
+
echo ""
|
|
131
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
132
|
+
echo "Claude session ended. Cleaning up worktree..."
|
|
133
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
134
|
+
echo ""
|
|
135
|
+
|
|
136
|
+
# Remove worktree (need to cd out first)
|
|
137
|
+
cd "${projectRoot}"
|
|
138
|
+
git worktree remove "${worktreePath}" --force 2>/dev/null
|
|
139
|
+
|
|
140
|
+
echo "✅ Worktree removed. Branch '${branchName}' preserved on remote."
|
|
141
|
+
echo " Fetch it in main repo: git fetch origin ${branchName}"
|
|
142
|
+
echo ""
|
|
143
|
+
echo "Terminal will close in 3 seconds..."
|
|
144
|
+
sleep 3
|
|
145
|
+
exit 0
|
|
146
|
+
`;
|
|
147
|
+
const interactiveEnding = `
|
|
148
|
+
echo ""
|
|
149
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
150
|
+
echo "Claude session ended. Terminal staying open."
|
|
151
|
+
echo "To clean up after merge: claude-issue clean ${issueNumber}"
|
|
152
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
153
|
+
echo ""
|
|
154
|
+
|
|
155
|
+
# Keep terminal open with minimal shell (skip rc files to avoid prompts)
|
|
156
|
+
exec bash --norc --noprofile
|
|
157
|
+
`;
|
|
158
|
+
const modeMessage = autoClose
|
|
159
|
+
? 'Terminal will close after PR is created.'
|
|
160
|
+
: 'The terminal stays open for follow-up changes.';
|
|
128
161
|
const runnerContent = `#!/bin/bash
|
|
129
162
|
cd "${worktreePath}"
|
|
130
163
|
|
|
131
|
-
# Disable Oh My Zsh auto-update prompt to prevent blocking
|
|
132
|
-
export DISABLE_AUTO_UPDATE="true"
|
|
133
|
-
|
|
134
164
|
# Set terminal title
|
|
135
165
|
echo -ne "\\033]0;Issue #${issueNumber}: ${issue.title.replace(/"/g, '\\"').slice(0, 50)}\\007"
|
|
136
166
|
|
|
@@ -138,7 +168,7 @@ echo "🤖 Claude Code - Issue #${issueNumber}: ${issue.title}"
|
|
|
138
168
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
139
169
|
echo ""
|
|
140
170
|
echo "When Claude commits, a PR will be created automatically."
|
|
141
|
-
echo "
|
|
171
|
+
echo "${modeMessage}"
|
|
142
172
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
143
173
|
echo ""
|
|
144
174
|
|
|
@@ -221,18 +251,8 @@ rm -f '${promptFile}'
|
|
|
221
251
|
kill $WATCHER_PID 2>/dev/null
|
|
222
252
|
|
|
223
253
|
# Final PR check after Claude exits
|
|
224
|
-
create_pr
|
|
225
|
-
|
|
226
|
-
echo ""
|
|
227
|
-
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
228
|
-
echo "Claude session ended. Terminal staying open."
|
|
229
|
-
echo "To clean up after merge: claude-issue clean ${issueNumber}"
|
|
230
|
-
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
231
|
-
echo ""
|
|
232
|
-
|
|
233
|
-
# Keep terminal open
|
|
234
|
-
exec bash
|
|
235
|
-
`;
|
|
254
|
+
create_pr
|
|
255
|
+
${autoClose ? autoCloseEnding : interactiveEnding}`;
|
|
236
256
|
fs.writeFileSync(runnerScript, runnerContent, { mode: 0o755 });
|
|
237
257
|
console.log();
|
|
238
258
|
console.log(chalk_1.default.cyan('🤖 Opening new terminal to run Claude Code...'));
|
package/dist/index.js
CHANGED
|
@@ -52,17 +52,18 @@ program.hook('preAction', (thisCommand) => {
|
|
|
52
52
|
// Default command - interactive selection
|
|
53
53
|
program
|
|
54
54
|
.argument('[issue]', 'Issue number to solve')
|
|
55
|
-
.
|
|
55
|
+
.option('-c, --auto-close', 'Close terminal and clean up worktree after PR is created')
|
|
56
|
+
.action(async (issue, options) => {
|
|
56
57
|
if (issue) {
|
|
57
58
|
const issueNumber = parseInt(issue, 10);
|
|
58
59
|
if (isNaN(issueNumber)) {
|
|
59
60
|
console.log(chalk_1.default.red(`❌ Invalid issue number: ${issue}`));
|
|
60
61
|
process.exit(1);
|
|
61
62
|
}
|
|
62
|
-
await (0, solve_1.solveCommand)(issueNumber);
|
|
63
|
+
await (0, solve_1.solveCommand)(issueNumber, { autoClose: options.autoClose });
|
|
63
64
|
}
|
|
64
65
|
else {
|
|
65
|
-
await (0, select_1.selectCommand)();
|
|
66
|
+
await (0, select_1.selectCommand)(options);
|
|
66
67
|
}
|
|
67
68
|
});
|
|
68
69
|
// List command
|