@@ -16,7 +16,12 @@ import { getApiUrl } from "../../helpers/urls.ts";
1616import { getAuthToken } from "../../helpers/config.ts" ;
1717
1818const ssh = new Command ( "ssh" )
19- . description ( "SSH into a VM on a node" )
19+ . description ( `SSH into a VM on a node.
20+
21+ Runs \`ssh\` with host keys from the API, forgoing the need to manually accept keys on first connect.
22+ Keys are fetched asynchronously from the VM's SSH server and may take a moment to populate.
23+
24+ Standard \`ssh\` behavior applies (e.g. defaults to your current username).` )
2025 . showHelpAfterError ( )
2126 . option ( "-q, --quiet" , "Quiet mode" , false )
2227 . option (
@@ -27,25 +32,23 @@ const ssh = new Command("ssh")
2732 . addOption ( jsonOption )
2833 . argument (
2934 "<destination>" ,
30- "USERNAME@HOST The (optional) username, and node name/ID or VM ID to SSH into" ,
35+ "Node name, Node ID, or VM ID to SSH into.\nFollows \`ssh\` behavior (i.e. root@node or jenson@node). " ,
3136 )
37+ . usage ( "[options] [user@]<destination>" )
3238 . allowExcessArguments ( false )
3339 . addHelpText (
3440 "after" ,
3541 `
3642Examples:
3743
3844 \x1b[2m# SSH into a node's current VM\x1b[0m
39- $ sf nodes ssh my-node
45+ $ sf nodes ssh root@ my-node
4046
4147 \x1b[2m# SSH with a specific username\x1b[0m
4248 $ sf nodes ssh jenson@my-node
43-
49+
4450 \x1b[2m# SSH directly to a VM ID\x1b[0m
45- $ sf nodes ssh vm_xxxxxxxxxxxxxxxxxxxxx
46-
47- \x1b[2m# SSH with username to a VM ID\x1b[0m
48- $ sf nodes ssh huang@vm_xxxxxxxxxxxxxxxxxxxxx
51+ $ sf nodes ssh root@vm_xxxxxxxxxxxxxxxxxxxxx
4952` ,
5053 )
5154 . action ( async ( destination , options ) => {
0 commit comments