@fermindi/pwn-cli 0.9.11 → 0.9.12
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/cli/backlog.js +21 -2
- package/package.json +1 -1
package/cli/backlog.js
CHANGED
|
@@ -30,6 +30,20 @@ export default async function backlogCommand(args = []) {
|
|
|
30
30
|
stories = stories.filter(s => re.test(s.id) || re.test(s.title));
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
// Parse --status
|
|
34
|
+
const statusIdx = args.findIndex(a => a === '--status');
|
|
35
|
+
const status = statusIdx !== -1 ? args[statusIdx + 1]?.toLowerCase() : null;
|
|
36
|
+
if (status) {
|
|
37
|
+
if (status === 'done' || status === 'passed') {
|
|
38
|
+
stories = stories.filter(s => s.passes);
|
|
39
|
+
} else if (status === 'pending' || status === 'todo') {
|
|
40
|
+
stories = stories.filter(s => !s.passes);
|
|
41
|
+
} else if (status === 'failed') {
|
|
42
|
+
const failedIds = new Set(taskFiles.filter(t => t.status === 'failed').map(t => t.id));
|
|
43
|
+
stories = stories.filter(s => failedIds.has(s.id));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
33
47
|
// Read project name from prd.json
|
|
34
48
|
let project = 'project';
|
|
35
49
|
const prdPath = join(cwd, '.ai', 'tasks', 'prd.json');
|
|
@@ -41,7 +55,8 @@ export default async function backlogCommand(args = []) {
|
|
|
41
55
|
}
|
|
42
56
|
|
|
43
57
|
const noInteractive = args.includes('--no-interactive') || !process.stdout.isTTY;
|
|
44
|
-
const
|
|
58
|
+
const filters = [filter, status].filter(Boolean);
|
|
59
|
+
const label = filters.length > 0 ? `${project} (${filters.join(', ')})` : project;
|
|
45
60
|
|
|
46
61
|
if (noInteractive) {
|
|
47
62
|
printPlain({ project: label, stories, taskFiles });
|
|
@@ -55,11 +70,15 @@ function showHelp() {
|
|
|
55
70
|
console.log('Usage: pwn backlog [options]\n');
|
|
56
71
|
console.log('Options:');
|
|
57
72
|
console.log(' --filter <pattern> Filter stories by ID or title (regex, case-insensitive)');
|
|
73
|
+
console.log(' --status <status> Filter by status: done, pending, failed');
|
|
58
74
|
console.log(' --no-interactive Plain text output (for CI/piping)');
|
|
59
75
|
console.log(' --help, -h Show this help\n');
|
|
60
76
|
console.log('Examples:');
|
|
61
77
|
console.log(' pwn backlog --filter SEC # Only SEC-* stories');
|
|
62
|
-
console.log(' pwn backlog --filter "API|AUTH" # Stories matching API or AUTH
|
|
78
|
+
console.log(' pwn backlog --filter "API|AUTH" # Stories matching API or AUTH');
|
|
79
|
+
console.log(' pwn backlog --status pending # Only incomplete stories');
|
|
80
|
+
console.log(' pwn backlog --status failed # Only failed stories');
|
|
81
|
+
console.log(' pwn backlog --filter DIV --status pending # Pending DIV-* stories\n');
|
|
63
82
|
console.log('Keybindings (list view):');
|
|
64
83
|
console.log(' ↑/k Move up');
|
|
65
84
|
console.log(' ↓/j Move down');
|
package/package.json
CHANGED