claude-issue-solver 1.19.3 → 1.20.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/README.md +2 -0
- package/dist/commands/list.d.ts +2 -0
- package/dist/commands/list.js +50 -42
- package/dist/index.js +2 -0
- package/dist/utils/github.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -159,6 +159,8 @@ claude-issue --help
|
|
|
159
159
|
|
|
160
160
|
**`list` command:**
|
|
161
161
|
- `--verbose` - Show issue descriptions
|
|
162
|
+
- `-n, --limit <number>` - Maximum issues to show (default: 50)
|
|
163
|
+
- `--all` - Show all issues (no limit)
|
|
162
164
|
|
|
163
165
|
**`new` command:**
|
|
164
166
|
- `-b, --body <text>` - Issue description
|
package/dist/commands/list.d.ts
CHANGED
package/dist/commands/list.js
CHANGED
|
@@ -7,58 +7,70 @@ exports.listCommand = listCommand;
|
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
8
|
const github_1 = require("../utils/github");
|
|
9
9
|
const git_1 = require("../utils/git");
|
|
10
|
-
function
|
|
10
|
+
function formatBody(body, indent, termWidth) {
|
|
11
11
|
if (!body)
|
|
12
|
-
return
|
|
12
|
+
return [];
|
|
13
13
|
const lines = body.split('\n');
|
|
14
|
-
const
|
|
15
|
-
|
|
14
|
+
const output = [];
|
|
15
|
+
const textWidth = termWidth - indent.length - 2;
|
|
16
16
|
for (const line of lines) {
|
|
17
17
|
const trimmed = line.trim();
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
if (!trimmed) {
|
|
19
|
+
// Preserve blank lines
|
|
20
|
+
output.push('');
|
|
20
21
|
continue;
|
|
21
22
|
}
|
|
22
|
-
//
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
started = true;
|
|
28
|
-
paragraphLines.push(trimmed);
|
|
23
|
+
// Handle markdown headers - make them stand out
|
|
24
|
+
if (trimmed.startsWith('#')) {
|
|
25
|
+
const headerText = trimmed.replace(/^#+\s*/, '');
|
|
26
|
+
output.push(indent + headerText);
|
|
27
|
+
continue;
|
|
29
28
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const words = text.split(/\s+/);
|
|
35
|
-
const lines = [];
|
|
36
|
-
let currentLine = '';
|
|
37
|
-
for (const word of words) {
|
|
38
|
-
if (!currentLine) {
|
|
39
|
-
currentLine = word;
|
|
29
|
+
// Handle list items
|
|
30
|
+
if (trimmed.match(/^[-*]\s/) || trimmed.match(/^\d+\.\s/)) {
|
|
31
|
+
output.push(indent + ' ' + trimmed);
|
|
32
|
+
continue;
|
|
40
33
|
}
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
// Word wrap regular text
|
|
35
|
+
if (trimmed.length <= textWidth) {
|
|
36
|
+
output.push(indent + trimmed);
|
|
43
37
|
}
|
|
44
38
|
else {
|
|
45
|
-
|
|
46
|
-
currentLine =
|
|
39
|
+
const words = trimmed.split(/\s+/);
|
|
40
|
+
let currentLine = '';
|
|
41
|
+
for (const word of words) {
|
|
42
|
+
if (!currentLine) {
|
|
43
|
+
currentLine = word;
|
|
44
|
+
}
|
|
45
|
+
else if (currentLine.length + 1 + word.length <= textWidth) {
|
|
46
|
+
currentLine += ' ' + word;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
output.push(indent + currentLine);
|
|
50
|
+
currentLine = word;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (currentLine) {
|
|
54
|
+
output.push(indent + currentLine);
|
|
55
|
+
}
|
|
47
56
|
}
|
|
48
57
|
}
|
|
49
|
-
|
|
50
|
-
lines.push(indent + currentLine);
|
|
51
|
-
}
|
|
52
|
-
return lines;
|
|
58
|
+
return output;
|
|
53
59
|
}
|
|
54
60
|
async function listCommand(options = {}) {
|
|
55
61
|
const projectName = (0, git_1.getProjectName)();
|
|
56
62
|
console.log(chalk_1.default.bold(`\nOpen issues for ${projectName}:\n`));
|
|
57
|
-
const
|
|
63
|
+
const limit = options.all ? 0 : (options.limit ?? 50);
|
|
64
|
+
const issues = (0, github_1.listIssues)(limit);
|
|
58
65
|
if (issues.length === 0) {
|
|
59
66
|
console.log(chalk_1.default.yellow('No open issues found.'));
|
|
60
67
|
return;
|
|
61
68
|
}
|
|
69
|
+
// Show hint if we hit the limit and user didn't explicitly set options
|
|
70
|
+
const hitLimit = !options.all && !options.limit && issues.length === limit;
|
|
71
|
+
if (hitLimit) {
|
|
72
|
+
console.log(chalk_1.default.dim(` Showing first ${limit} issues. Use --limit <n> or --all to see more.\n`));
|
|
73
|
+
}
|
|
62
74
|
const issuesWithPRs = (0, github_1.getIssuesWithOpenPRs)();
|
|
63
75
|
for (const issue of issues) {
|
|
64
76
|
const prTag = issuesWithPRs.has(issue.number) ? chalk_1.default.magenta(' [PR]') : '';
|
|
@@ -67,17 +79,13 @@ async function listCommand(options = {}) {
|
|
|
67
79
|
: '';
|
|
68
80
|
console.log(` ${chalk_1.default.cyan(`#${issue.number}`)}\t${issue.title}${prTag}${labels}`);
|
|
69
81
|
if (options.verbose && issue.body) {
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const wrappedLines = wrapText(paragraph, textWidth, indent);
|
|
76
|
-
for (const line of wrappedLines) {
|
|
77
|
-
console.log(chalk_1.default.dim(line));
|
|
78
|
-
}
|
|
79
|
-
console.log(); // blank line between issues
|
|
82
|
+
const termWidth = process.stdout.columns || 80;
|
|
83
|
+
const indent = ' ';
|
|
84
|
+
const formattedLines = formatBody(issue.body, indent, termWidth);
|
|
85
|
+
for (const line of formattedLines) {
|
|
86
|
+
console.log(chalk_1.default.dim(line));
|
|
80
87
|
}
|
|
88
|
+
console.log(); // blank line between issues
|
|
81
89
|
}
|
|
82
90
|
}
|
|
83
91
|
console.log();
|
package/dist/index.js
CHANGED
|
@@ -68,6 +68,8 @@ program
|
|
|
68
68
|
.alias('ls')
|
|
69
69
|
.description('List open issues')
|
|
70
70
|
.option('--verbose', 'Show issue descriptions')
|
|
71
|
+
.option('-n, --limit <number>', 'Maximum number of issues to show', (val) => parseInt(val, 10))
|
|
72
|
+
.option('--all', 'Show all issues (no limit)')
|
|
71
73
|
.action((options) => (0, list_1.listCommand)(options));
|
|
72
74
|
// Show command
|
|
73
75
|
program
|
package/dist/utils/github.js
CHANGED
|
@@ -50,9 +50,10 @@ function getIssue(issueNumber) {
|
|
|
50
50
|
return null;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
function listIssues(limit =
|
|
53
|
+
function listIssues(limit = 50) {
|
|
54
54
|
try {
|
|
55
|
-
const
|
|
55
|
+
const limitArg = limit > 0 ? `--limit ${limit}` : '';
|
|
56
|
+
const output = (0, child_process_1.execSync)(`gh issue list --state open ${limitArg} --json number,title,body,labels`, { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] });
|
|
56
57
|
return JSON.parse(output);
|
|
57
58
|
}
|
|
58
59
|
catch {
|