nu: Add tailscale scp command

This commit is contained in:
2025-06-08 14:11:03 +02:00
parent 87b77cd412
commit 3fd0b5a647

View File

@ -33,8 +33,26 @@ def "tailscale peer" [
# SSH to a tailscale peer # SSH to a tailscale peer
def "tailscale ssh" [ def "tailscale ssh" [
hostname?: string hostname: string
...ssh_flags: string ...ssh_flags: string
]: nothing -> any { ]: nothing -> any {
ssh -o $"HostName (tailscale peer $hostname | get ipv6)" $hostname ...$ssh_flags ssh -o $"HostName (tailscale peer $hostname | get ipv6)" $hostname ...$ssh_flags
} }
# SCP to a tailscale peer
def "tailscale scp" [
from: string
to: string
...ssh_flags: string
]: nothing -> any {
let options = (
[$from, $to] |
parse "{hostname}:{path}" |
each { |it| $"HostName (tailscale peer $it.hostname | get ipv6)" } |
each { |option| ["-o", $option] } |
flatten
)
scp ...$options $from $to ...$ssh_flags
}