runpodctl icon indicating copy to clipboard operation
runpodctl copied to clipboard

feat: add ssh-connect string subcommand

Open jojje opened this issue 1 year ago • 0 comments

E-XXXX: Add SSH connect string subcommand

Adds the ability for the ssh subcommand to show the connect string for a given pod, or all of them.

How I tested it

Interactively; verified the output from the program's main function.

  1. For a given pod:

    go run main.go ssh connect test
    ssh [email protected] -p 53006
    
  2. For a given pod with verbose output:

    go run main.go ssh connect test --verbose
    ssh [email protected] -p 53006  # pod { id: "l6ecafz8g9l2pu", name: "test" }
    
  3. For a non existing pod

    go run main.go ssh connect foo
    No pod with id or name "foo" found
    
  4. For all pods

    go run main.go ssh connect
    ssh [email protected] -p 4498   # pod { id: "evoszzij78cm4u", name: "test2" }
    ssh [email protected] -p 53006  # pod { id: "l6ecafz8g9l2pu", name: "test" }
    

note: verbose output makes sense to always show when listing more than one pod, so the user knows which connect string refers to what pod, so that's why >1 pods listed will always provide pod identifying information.

Closes #30

PS, no idea what the "E-XXXX" is supposed to be, so let me know and I'll add an appropriate number there.

jojje avatar Sep 28 '24 17:09 jojje