From 7dfe1c85e8e65b379ef5ba8cb1bd9dc402c30b29 Mon Sep 17 00:00:00 2001 From: TheGeneralist <180094941+thegeneralist01@users.noreply.github.com> Date: Fri, 9 Oct 2026 21:47:11 +0200 Subject: [PATCH] feat(shell): add SSH tunnel helper --- modules/common/shell/0_nushell.nu | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/common/shell/0_nushell.nu b/modules/common/shell/0_nushell.nu index 8862c69..7e54091 100644 --- a/modules/common/shell/0_nushell.nu +++ b/modules/common/shell/0_nushell.nu @@ -344,6 +344,17 @@ def --env mcg [path: path]: nothing -> nothing { jj git init --colocate } +# Forward a local port to a port on an SSH host. +def ssh-tunnel [ + local_port: int + remote_port: int + user: string + remote_host: string + --server_alive_interval: int = 60 +]: nothing -> nothing { + ^ssh -N -o ExitOnForwardFailure=yes -o $"ServerAliveInterval=($server_alive_interval)" -L $"127.0.0.1:($local_port):127.0.0.1:($remote_port)" $"($user)@($remote_host)" +} + # ls files sorted by latest DESC def latest [ path: path = .