@braingrid/cli 0.1.3 → 0.2.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/CHANGELOG.md +24 -0
- package/README.md +0 -1
- package/dist/cli.js +265 -317
- package/dist/cli.js.map +1 -1
- package/dist/handlers/auth.handlers.d.ts +1 -7
- package/dist/handlers/auth.handlers.d.ts.map +1 -1
- package/dist/handlers/auth.handlers.js +25 -91
- package/dist/handlers/auth.handlers.js.map +1 -1
- package/dist/handlers/index.d.ts +0 -1
- package/dist/handlers/index.d.ts.map +1 -1
- package/dist/handlers/index.js +0 -1
- package/dist/handlers/index.js.map +1 -1
- package/package.json +24 -5
- package/dist/handlers/agent.handlers.d.ts +0 -12
- package/dist/handlers/agent.handlers.d.ts.map +0 -1
- package/dist/handlers/agent.handlers.js +0 -130
- package/dist/handlers/agent.handlers.js.map +0 -1
- package/dist/rpc/registry.d.ts +0 -97
- package/dist/rpc/registry.d.ts.map +0 -1
- package/dist/rpc/registry.js +0 -119
- package/dist/rpc/registry.js.map +0 -1
- package/dist/rpc/server.d.ts +0 -78
- package/dist/rpc/server.d.ts.map +0 -1
- package/dist/rpc/server.js +0 -437
- package/dist/rpc/server.js.map +0 -1
- package/dist/rpc/transport.d.ts +0 -84
- package/dist/rpc/transport.d.ts.map +0 -1
- package/dist/rpc/transport.js +0 -296
- package/dist/rpc/transport.js.map +0 -1
- package/dist/services/__mocks__/utils.d.ts +0 -16
- package/dist/services/__mocks__/utils.d.ts.map +0 -1
- package/dist/services/__mocks__/utils.js +0 -21
- package/dist/services/__mocks__/utils.js.map +0 -1
- package/dist/services/agent-service.d.ts +0 -29
- package/dist/services/agent-service.d.ts.map +0 -1
- package/dist/services/agent-service.js +0 -273
- package/dist/services/agent-service.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,30 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.2.0] - 2025-11-04
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **BREAKING**: Converted from monorepo to single CLI package architecture
|
|
13
|
+
- Removed `@braingrid/protocol` package (JSON-RPC protocol schemas)
|
|
14
|
+
- Removed `@braingrid/vscode-extension` package
|
|
15
|
+
- Removed JSON-RPC server mode (`--rpc` flag)
|
|
16
|
+
- Removed agent conversation commands (`braingrid agent chat`)
|
|
17
|
+
- Removed conformance testing tools
|
|
18
|
+
- Eliminated monorepo infrastructure (Turbo, Changesets, pnpm workspaces)
|
|
19
|
+
- Restructured to standalone package at repository root
|
|
20
|
+
- All CLI functionality preserved (auth, project, requirement, task commands)
|
|
21
|
+
- Retained Zod dependency for future CLI input validation
|
|
22
|
+
|
|
23
|
+
### Removed
|
|
24
|
+
|
|
25
|
+
- JSON-RPC 2.0 server implementation and transport layer
|
|
26
|
+
- Agent service and streaming conversation support
|
|
27
|
+
- VSCode extension integration
|
|
28
|
+
- Protocol package and auto-generated documentation
|
|
29
|
+
- Monorepo build orchestration (Turborepo)
|
|
30
|
+
- Automated versioning system (Changesets)
|
|
31
|
+
|
|
8
32
|
## [0.1.3] - 2025-11-04
|
|
9
33
|
|
|
10
34
|
### Added
|
package/README.md
CHANGED
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
- 📊 **Track Progress** - Manage and update task statuses
|
|
29
29
|
- 💾 **Multiple Output Formats** - View data as formatted tables or JSON for scripting
|
|
30
30
|
- 🔍 **Environment Detection** - Automatically detect git repository info and installed AI coding tools
|
|
31
|
-
- 🔌 **JSON-RPC Mode** - Programmatic access via JSON-RPC 2.0 protocol for IDE integration
|
|
32
31
|
|
|
33
32
|
---
|
|
34
33
|
|
package/dist/cli.js
CHANGED
|
@@ -2,324 +2,272 @@
|
|
|
2
2
|
import { Command } from 'commander';
|
|
3
3
|
import { createRequire } from 'module';
|
|
4
4
|
import * as handlers from './handlers/index.js';
|
|
5
|
-
import { JsonRpcServer } from './rpc/server.js';
|
|
6
5
|
const require = createRequire(import.meta.url);
|
|
7
6
|
const packageJson = require('../package.json');
|
|
8
7
|
const program = new Command();
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
.
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
.
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
.
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
.
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
.
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
.
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
.action(async (id, opts) => {
|
|
275
|
-
const result = await handlers.handleTaskUpdate(id, opts);
|
|
276
|
-
console.log(result.message);
|
|
277
|
-
if (!result.success) {
|
|
278
|
-
process.exit(1);
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
task
|
|
282
|
-
.command('delete <id>')
|
|
283
|
-
.description('Delete a task')
|
|
284
|
-
.option('--force', 'force deletion without confirmation')
|
|
285
|
-
.action(async (id, opts) => {
|
|
286
|
-
const result = await handlers.handleTaskDelete(id, opts);
|
|
287
|
-
console.log(result.message);
|
|
288
|
-
if (!result.success) {
|
|
289
|
-
process.exit(1);
|
|
290
|
-
}
|
|
291
|
-
});
|
|
292
|
-
// ============================================
|
|
293
|
-
// AGENT COMMANDS
|
|
294
|
-
// ============================================
|
|
295
|
-
const agent = program.command('agent').description('Interact with AI agent');
|
|
296
|
-
agent
|
|
297
|
-
.command('chat <message>')
|
|
298
|
-
.description('Start or continue a conversation with the AI agent')
|
|
299
|
-
.option('-p, --project <id>', 'project ID (auto-detects from .braingrid/project.json if not provided)')
|
|
300
|
-
.option('--conversation-id <id>', 'conversation ID to continue existing conversation')
|
|
301
|
-
.option('--requirement <id>', 'requirement ID for context (overrides active context)')
|
|
302
|
-
.option('--repositories <repos>', 'comma-separated list of repositories (owner/repo)')
|
|
303
|
-
.action(async (message, opts) => {
|
|
304
|
-
const result = await handlers.handleAgentConversationStream({
|
|
305
|
-
project: opts.project || '',
|
|
306
|
-
message,
|
|
307
|
-
conversationId: opts.conversationId,
|
|
308
|
-
context: {
|
|
309
|
-
requirementId: opts.requirement,
|
|
310
|
-
repositories: opts.repositories
|
|
311
|
-
? opts.repositories
|
|
312
|
-
.split(',')
|
|
313
|
-
.map((r) => r.trim())
|
|
314
|
-
.filter(Boolean)
|
|
315
|
-
: undefined,
|
|
316
|
-
},
|
|
317
|
-
});
|
|
318
|
-
console.log(result.message);
|
|
319
|
-
if (!result.success) {
|
|
320
|
-
process.exit(1);
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
|
-
program.parse();
|
|
324
|
-
}
|
|
8
|
+
program
|
|
9
|
+
.name('braingrid')
|
|
10
|
+
.description('BrainGrid CLI - Manage projects, requirements, and tasks')
|
|
11
|
+
.version(packageJson.version, '-v, --version', 'output the current version')
|
|
12
|
+
.showHelpAfterError('(use --help for usage)');
|
|
13
|
+
// ============================================
|
|
14
|
+
// AUTH COMMANDS
|
|
15
|
+
// ============================================
|
|
16
|
+
program
|
|
17
|
+
.command('login')
|
|
18
|
+
.description('Authenticate with BrainGrid')
|
|
19
|
+
.action(async () => {
|
|
20
|
+
const result = await handlers.handleLogin();
|
|
21
|
+
console.log(result.message);
|
|
22
|
+
if (!result.success) {
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
program
|
|
27
|
+
.command('logout')
|
|
28
|
+
.description('Sign out from BrainGrid')
|
|
29
|
+
.action(async () => {
|
|
30
|
+
const result = await handlers.handleLogout();
|
|
31
|
+
console.log(result.message);
|
|
32
|
+
if (!result.success) {
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
program
|
|
37
|
+
.command('whoami')
|
|
38
|
+
.description('Show current user information')
|
|
39
|
+
.action(async () => {
|
|
40
|
+
const result = await handlers.handleWhoami();
|
|
41
|
+
console.log(result.message);
|
|
42
|
+
if (!result.success) {
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
program
|
|
47
|
+
.command('status')
|
|
48
|
+
.description('Show CLI status (authentication, git, config)')
|
|
49
|
+
.action(async () => {
|
|
50
|
+
const result = await handlers.handleStatus();
|
|
51
|
+
console.log(result.message);
|
|
52
|
+
if (!result.success) {
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
program
|
|
57
|
+
.command('init')
|
|
58
|
+
.description('Initialize BrainGrid project in current repository')
|
|
59
|
+
.option('--project <id>', 'project ID to initialize with (auto-detects if not provided)')
|
|
60
|
+
.option('--force', 'skip confirmation and force reinitialization if already initialized')
|
|
61
|
+
.action(async (opts) => {
|
|
62
|
+
const result = await handlers.handleInit(opts);
|
|
63
|
+
console.log(result.message);
|
|
64
|
+
if (!result.success) {
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
program
|
|
69
|
+
.command('update')
|
|
70
|
+
.description('Update BrainGrid CLI to the latest version')
|
|
71
|
+
.option('--check', 'check for updates without installing')
|
|
72
|
+
.action(async (opts) => {
|
|
73
|
+
const result = await handlers.handleUpdate(opts);
|
|
74
|
+
console.log(result.message);
|
|
75
|
+
if (!result.success) {
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
// ============================================
|
|
80
|
+
// PROJECT RESOURCE COMMANDS
|
|
81
|
+
// ============================================
|
|
82
|
+
const project = program.command('project').description('Manage projects');
|
|
83
|
+
project
|
|
84
|
+
.command('list')
|
|
85
|
+
.description('List all projects')
|
|
86
|
+
.option('--format <format>', 'output format (table or json)', 'table')
|
|
87
|
+
.option('--page <page>', 'page number for pagination', '1')
|
|
88
|
+
.option('--limit <limit>', 'number of projects per page', '20')
|
|
89
|
+
.action(async (opts) => {
|
|
90
|
+
const result = await handlers.handleProjectList(opts);
|
|
91
|
+
console.log(result.message);
|
|
92
|
+
if (!result.success) {
|
|
93
|
+
process.exit(1);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
project
|
|
97
|
+
.command('show [id]')
|
|
98
|
+
.description('Show current or specified project (or use --repository to list by repo)')
|
|
99
|
+
.option('--repository, --repo <owner/name>', 'list projects for repository (e.g., microsoft/vscode)')
|
|
100
|
+
.option('--format <format>', 'output format (table or json)', 'table')
|
|
101
|
+
.option('--page <page>', 'page number for pagination', '1')
|
|
102
|
+
.option('--limit <limit>', 'number of projects per page', '20')
|
|
103
|
+
.action(async (id, opts) => {
|
|
104
|
+
const result = await handlers.handleProjectShow({ id, ...opts });
|
|
105
|
+
console.log(result.message);
|
|
106
|
+
if (!result.success) {
|
|
107
|
+
process.exit(1);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
project
|
|
111
|
+
.command('create')
|
|
112
|
+
.description('Create a new project')
|
|
113
|
+
.requiredOption('--name <name>', 'project name')
|
|
114
|
+
.option('--description <description>', 'project description')
|
|
115
|
+
.action(async (opts) => {
|
|
116
|
+
const result = await handlers.handleProjectCreate(opts);
|
|
117
|
+
console.log(result.message);
|
|
118
|
+
if (!result.success) {
|
|
119
|
+
process.exit(1);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
project
|
|
123
|
+
.command('update <id>')
|
|
124
|
+
.description('Update project information')
|
|
125
|
+
.option('--name <name>', 'new project name')
|
|
126
|
+
.option('--description <description>', 'new project description')
|
|
127
|
+
.action(async (id, opts) => {
|
|
128
|
+
const result = await handlers.handleProjectUpdate(id, opts);
|
|
129
|
+
console.log(result.message);
|
|
130
|
+
if (!result.success) {
|
|
131
|
+
process.exit(1);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
project
|
|
135
|
+
.command('delete <id>')
|
|
136
|
+
.description('Delete a project')
|
|
137
|
+
.option('--force', 'force deletion without confirmation')
|
|
138
|
+
.action(async (id, opts) => {
|
|
139
|
+
const result = await handlers.handleProjectDelete(id, opts);
|
|
140
|
+
console.log(result.message);
|
|
141
|
+
if (!result.success) {
|
|
142
|
+
process.exit(1);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
// ============================================
|
|
146
|
+
// REQUIREMENT RESOURCE COMMANDS
|
|
147
|
+
// ============================================
|
|
148
|
+
const requirement = program.command('requirement').description('Manage requirements');
|
|
149
|
+
requirement
|
|
150
|
+
.command('list')
|
|
151
|
+
.description('List requirements for a project')
|
|
152
|
+
.option('-p, --project <id>', 'project ID (auto-detects from .braingrid/project.json if not provided)')
|
|
153
|
+
.option('--status <status>', 'filter by status (IDEA, PLANNED, IN_PROGRESS, REVIEW, COMPLETED, CANCELLED)')
|
|
154
|
+
.option('--format <format>', 'output format (table or json)', 'table')
|
|
155
|
+
.option('--page <page>', 'page number for pagination', '1')
|
|
156
|
+
.option('--limit <limit>', 'number of requirements per page', '20')
|
|
157
|
+
.action(async (opts) => {
|
|
158
|
+
const result = await handlers.handleRequirementList(opts);
|
|
159
|
+
console.log(result.message);
|
|
160
|
+
if (!result.success) {
|
|
161
|
+
process.exit(1);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
requirement
|
|
165
|
+
.command('show <id>')
|
|
166
|
+
.description('Show requirement details')
|
|
167
|
+
.action(async (id) => {
|
|
168
|
+
const result = await handlers.handleRequirementShow(id);
|
|
169
|
+
console.log(result.message);
|
|
170
|
+
if (!result.success) {
|
|
171
|
+
process.exit(1);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
requirement
|
|
175
|
+
.command('create')
|
|
176
|
+
.description('Create a new requirement')
|
|
177
|
+
.option('-p, --project <id>', 'project ID (auto-detects from .braingrid/project.json if not provided)')
|
|
178
|
+
.requiredOption('--prompt <prompt>', 'requirement prompt/description')
|
|
179
|
+
.option('--repositories <repos>', 'comma-separated list of repositories (owner/repo)')
|
|
180
|
+
.action(async (opts) => {
|
|
181
|
+
const result = await handlers.handleRequirementCreate(opts);
|
|
182
|
+
console.log(result.message);
|
|
183
|
+
if (!result.success) {
|
|
184
|
+
process.exit(1);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
requirement
|
|
188
|
+
.command('update <id>')
|
|
189
|
+
.description('Update requirement information')
|
|
190
|
+
.option('--status <status>', 'new status (IDEA, PLANNED, IN_PROGRESS, REVIEW, COMPLETED, CANCELLED)')
|
|
191
|
+
.option('--name <name>', 'new requirement name')
|
|
192
|
+
.action(async (id, opts) => {
|
|
193
|
+
const result = await handlers.handleRequirementUpdate(id, opts);
|
|
194
|
+
console.log(result.message);
|
|
195
|
+
if (!result.success) {
|
|
196
|
+
process.exit(1);
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
requirement
|
|
200
|
+
.command('delete <id>')
|
|
201
|
+
.description('Delete a requirement')
|
|
202
|
+
.option('--force', 'force deletion without confirmation')
|
|
203
|
+
.action(async (id, opts) => {
|
|
204
|
+
const result = await handlers.handleRequirementDelete(id, opts);
|
|
205
|
+
console.log(result.message);
|
|
206
|
+
if (!result.success) {
|
|
207
|
+
process.exit(1);
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
// ============================================
|
|
211
|
+
// TASK RESOURCE COMMANDS
|
|
212
|
+
// ============================================
|
|
213
|
+
const task = program.command('task').description('Manage tasks');
|
|
214
|
+
task
|
|
215
|
+
.command('list')
|
|
216
|
+
.description('List tasks for a requirement')
|
|
217
|
+
.option('-r, --requirement <id>', 'requirement ID (REQ-456 or PROJ-123/REQ-456, auto-detects project if initialized)')
|
|
218
|
+
.option('--format <format>', 'output format (table or json)', 'table')
|
|
219
|
+
.action(async (opts) => {
|
|
220
|
+
const result = await handlers.handleTaskList(opts);
|
|
221
|
+
console.log(result.message);
|
|
222
|
+
if (!result.success) {
|
|
223
|
+
process.exit(1);
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
task
|
|
227
|
+
.command('show <id>')
|
|
228
|
+
.description('Show task details')
|
|
229
|
+
.action(async (id) => {
|
|
230
|
+
const result = await handlers.handleTaskShow(id);
|
|
231
|
+
console.log(result.message);
|
|
232
|
+
if (!result.success) {
|
|
233
|
+
process.exit(1);
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
task
|
|
237
|
+
.command('create')
|
|
238
|
+
.description('Create a new task')
|
|
239
|
+
.option('-r, --requirement <id>', 'requirement ID (REQ-456 or PROJ-123/REQ-456, auto-detects project if initialized)')
|
|
240
|
+
.requiredOption('--title <title>', 'task title')
|
|
241
|
+
.option('--content <content>', 'task content/description')
|
|
242
|
+
.action(async (opts) => {
|
|
243
|
+
const result = await handlers.handleTaskCreate(opts);
|
|
244
|
+
console.log(result.message);
|
|
245
|
+
if (!result.success) {
|
|
246
|
+
process.exit(1);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
task
|
|
250
|
+
.command('update <id>')
|
|
251
|
+
.description('Update task information')
|
|
252
|
+
.option('--status <status>', 'new status (PLANNED, IN_PROGRESS, COMPLETED, CANCELLED)')
|
|
253
|
+
.option('--title <title>', 'new task title')
|
|
254
|
+
.action(async (id, opts) => {
|
|
255
|
+
const result = await handlers.handleTaskUpdate(id, opts);
|
|
256
|
+
console.log(result.message);
|
|
257
|
+
if (!result.success) {
|
|
258
|
+
process.exit(1);
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
task
|
|
262
|
+
.command('delete <id>')
|
|
263
|
+
.description('Delete a task')
|
|
264
|
+
.option('--force', 'force deletion without confirmation')
|
|
265
|
+
.action(async (id, opts) => {
|
|
266
|
+
const result = await handlers.handleTaskDelete(id, opts);
|
|
267
|
+
console.log(result.message);
|
|
268
|
+
if (!result.success) {
|
|
269
|
+
process.exit(1);
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
program.parse();
|
|
325
273
|
//# sourceMappingURL=cli.js.map
|