File tree Expand file tree Collapse file tree
packages/commands/src/commands/knowledge Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,8 +45,12 @@ export default defineCommand({
4545 } ) ;
4646
4747 const file = response . data ;
48- if ( settings . quiet || format !== "text" ) {
49- emitResult ( response , format === "text" ? "json" : format ) ;
48+ if ( settings . quiet ) {
49+ emitBare ( file ?. fileId ?? "" ) ;
50+ return ;
51+ }
52+ if ( format !== "text" ) {
53+ emitResult ( response , format ) ;
5054 return ;
5155 }
5256 emitBare ( `id: ${ file ?. fileId ?? "-" } ` ) ;
Original file line number Diff line number Diff line change @@ -92,8 +92,12 @@ export default defineCommand({
9292
9393 const row = await fetchIndexDetail ( ctx . client , workspaceId , flags . indexId ) ;
9494
95- if ( settings . quiet || format !== "text" ) {
96- emitResult ( row , format === "text" ? "json" : format ) ;
95+ if ( settings . quiet ) {
96+ emitBare ( row . id ?? "" ) ;
97+ return ;
98+ }
99+ if ( format !== "text" ) {
100+ emitResult ( row , format ) ;
97101 return ;
98102 }
99103
Original file line number Diff line number Diff line change @@ -102,8 +102,8 @@ export default defineCommand({
102102 body,
103103 } ) ;
104104
105- if ( settings . quiet || format !== "text" ) {
106- emitResult ( response , format === "text" ? "json" : format ) ;
105+ if ( format !== "text" ) {
106+ emitResult ( response , format ) ;
107107 return ;
108108 }
109109 if ( clampedEnd ) {
Original file line number Diff line number Diff line change @@ -77,8 +77,12 @@ export default defineCommand({
7777 } ) ;
7878
7979 const data = response . data ;
80- if ( settings . quiet || format !== "text" ) {
81- emitResult ( response , format === "text" ? "json" : format ) ;
80+ if ( settings . quiet ) {
81+ emitBare ( data ?. agent_id ?? "" ) ;
82+ return ;
83+ }
84+ if ( format !== "text" ) {
85+ emitResult ( response , format ) ;
8286 return ;
8387 }
8488 emitBare ( "Basic:" ) ;
You can’t perform that action at this time.
0 commit comments