@@ -13,7 +13,7 @@ import * as readline from "readline";
1313import * as http from "https" ;
1414import { URL } from "url" ;
1515import { startMcpServer } from "../lib/mcp-server" ;
16- import { fetchIssues , fetchIssueComments , createIssueComment } from "../lib/issues" ;
16+ import { fetchIssues , fetchIssueComments , createIssueComment , fetchIssue } from "../lib/issues" ;
1717import { resolveBaseUrls } from "../lib/util" ;
1818
1919const execPromise = promisify ( exec ) ;
@@ -1225,7 +1225,15 @@ issues
12251225const { apiBaseUrl} = resolveBaseUrls ( rootOpts , cfg ) ;
12261226
12271227const result = await fetchIssues ( { apiKey, apiBaseUrl, debug :! ! opts . debug } ) ;
1228- printResult ( result , opts . json ) ;
1228+ const trimmed = Array . isArray ( result )
1229+ ?( result as any [ ] ) . map ( ( r ) => ( {
1230+ id :( r as any ) . id ,
1231+ title :( r as any ) . title ,
1232+ status :( r as any ) . status ,
1233+ created_at :( r as any ) . created_at ,
1234+ } ) )
1235+ :result ;
1236+ printResult ( trimmed , opts . json ) ;
12291237} catch ( err ) {
12301238const message = err instanceof Error ?err . message :String ( err ) ;
12311239console . error ( message ) ;
@@ -1234,8 +1242,8 @@ issues
12341242} ) ;
12351243
12361244issues
1237- . command ( "comments <issueId>" )
1238- . description ( "list comments for an issue " )
1245+ . command ( "view <issueId>" )
1246+ . description ( "view issue details and comments " )
12391247. option ( "--debug" , "enable debug output" )
12401248. option ( "--json" , "output raw JSON" )
12411249. action ( async ( issueId :string , opts :{ debug ?:boolean ; json ?:boolean } ) => {
@@ -1251,8 +1259,16 @@ issues
12511259
12521260const { apiBaseUrl} = resolveBaseUrls ( rootOpts , cfg ) ;
12531261
1254- const result = await fetchIssueComments ( { apiKey, apiBaseUrl, issueId, debug :! ! opts . debug } ) ;
1255- printResult ( result , opts . json ) ;
1262+ const issue = await fetchIssue ( { apiKey, apiBaseUrl, issueId, debug :! ! opts . debug } ) ;
1263+ if ( ! issue ) {
1264+ console . error ( "Issue not found" ) ;
1265+ process . exitCode = 1 ;
1266+ return ;
1267+ }
1268+
1269+ const comments = await fetchIssueComments ( { apiKey, apiBaseUrl, issueId, debug :! ! opts . debug } ) ;
1270+ const combined = { issue, comments} ;
1271+ printResult ( combined , opts . json ) ;
12561272} catch ( err ) {
12571273const message = err instanceof Error ?err . message :String ( err ) ;
12581274console . error ( message ) ;