@@ -108,7 +108,7 @@ function getActionsForNode(node: SFCNodes.Node) {
108108 if ( lastVm ?. image_id ) {
109109 nodeActions . push ( {
110110 label : "Image" ,
111- command : `sf vms image show ${ brightBlack ( lastVm . image_id ) } ` ,
111+ command : `sf nodes image show ${ brightBlack ( lastVm . image_id ) } ` ,
112112 } ) ;
113113 }
114114
@@ -118,12 +118,12 @@ function getActionsForNode(node: SFCNodes.Node) {
118118 if ( lastVm ?. id ) {
119119 nodeActions . push ( {
120120 label : "SSH" ,
121- command : `sf vms ssh root@${ brightBlack ( String ( lastVm . id ) ) } ` ,
121+ command : `sf nodes ssh root@${ brightBlack ( node . name ) } ` ,
122122 } ) ;
123123 nodeActions . push (
124124 {
125125 label : "Logs" ,
126- command : `sf vms logs -i ${ brightBlack ( String ( lastVm . id ) ) } ` ,
126+ command : `sf nodes logs ${ brightBlack ( node . name ) } ` ,
127127 } ,
128128 ) ;
129129 }
@@ -145,11 +145,11 @@ function getActionsForNode(node: SFCNodes.Node) {
145145 nodeActions . push (
146146 {
147147 label : "SSH" ,
148- command : `sf vms ssh root@${ brightBlack ( lastVm . id ) } ` ,
148+ command : `sf nodes ssh root@${ brightBlack ( node . name ) } ` ,
149149 } ,
150150 {
151151 label : "Logs" ,
152- command : `sf vms logs -i ${ brightBlack ( lastVm . id ) } ` ,
152+ command : `sf nodes logs ${ brightBlack ( node . name ) } ` ,
153153 } ,
154154 ) ;
155155 }
@@ -204,7 +204,7 @@ function getActionsForNode(node: SFCNodes.Node) {
204204 nodeActions . push (
205205 {
206206 label : "Logs" ,
207- command : `sf vms logs -i ${ brightBlack ( lastVm . id ) } ` ,
207+ command : `sf nodes logs ${ brightBlack ( node . name ) } ` ,
208208 } ,
209209 ) ;
210210 }
@@ -244,11 +244,11 @@ function getActionsForNode(node: SFCNodes.Node) {
244244 nodeActions . push (
245245 {
246246 label : "SSH" ,
247- command : `sf vms ssh root@${ brightBlack ( lastVm . id ) } ` ,
247+ command : `sf nodes ssh root@${ brightBlack ( node . name ) } ` ,
248248 } ,
249249 {
250250 label : "Logs" ,
251- command : `sf vms logs -i ${ brightBlack ( lastVm . id ) } ` ,
251+ command : `sf nodes logs ${ brightBlack ( node . name ) } ` ,
252252 } ,
253253 ) ;
254254 }
@@ -480,9 +480,8 @@ async function listNodesAction(options: ReturnType<typeof list.opts>) {
480480 ) ;
481481
482482 // Get actions from all nodes, deduplicated with newest nodes taking precedence
483- const nodesCommands : string [ ] = [ ] ;
484- const vmsCommands : string [ ] = [ ] ;
485- const seenNodesLabels = new Set < string > ( ) ;
483+ const allCommands : string [ ] = [ ] ;
484+ const seenLabels = new Set < string > ( ) ;
486485
487486 // Sort nodes by created_at (newest first), fallback to index for consistent ordering
488487 const sortedNodes = [ ...nodes ] . sort ( ( a , b ) => {
@@ -492,38 +491,22 @@ async function listNodesAction(options: ReturnType<typeof list.opts>) {
492491 } ) ;
493492
494493 // Collect actions from each node, with newer nodes taking precedence
495- // Limit to 3 nodes commands and 1 vms command
494+ // Limit to 5 commands total, deduplicated by label
496495 for ( const node of sortedNodes ) {
497496 const nodeActions = getActionsForNode ( node ) ;
498497 for ( const action of nodeActions ) {
499- const isVmsCommand = action . command . includes ( "sf vms" ) ;
500-
501- if ( isVmsCommand ) {
502- // Only add the first vms command we encounter (from newest node)
503- if ( vmsCommands . length === 0 ) {
504- vmsCommands . push ( action . command ) ;
505- }
506- } else {
507- // For nodes commands, limit to 3 and deduplicate by label
508- if (
509- nodesCommands . length < 3 && ! seenNodesLabels . has ( action . label )
510- ) {
511- nodesCommands . push ( action . command ) ;
512- seenNodesLabels . add ( action . label ) ;
513- }
498+ // Add command if we haven't seen this label and haven't reached the limit
499+ if ( allCommands . length < 5 && ! seenLabels . has ( action . label ) ) {
500+ allCommands . push ( action . command ) ;
501+ seenLabels . add ( action . label ) ;
514502 }
515503 }
516504 }
517505
518506 // Print Next Steps section
519- if ( nodesCommands . length > 0 || vmsCommands . length > 0 ) {
507+ if ( allCommands . length > 0 ) {
520508 console . log ( gray ( "\nNext steps:" ) ) ;
521- // Print nodes commands first
522- for ( const command of nodesCommands ) {
523- console . log ( ` ${ command } ` ) ;
524- }
525- // Then print vms commands
526- for ( const command of vmsCommands ) {
509+ for ( const command of allCommands ) {
527510 console . log ( ` ${ command } ` ) ;
528511 }
529512 }
0 commit comments