LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

lazyfwd

Forward SSH ports from a terminal UI

TLDR

Open the terminal UI
$ lazyfwd
copy
Hold forwards without the UI
$ lazyfwd serve
copy
Add forwards and start them
$ lazyfwd forward add [host] 4966-4968 --start
copy
List forwards as JSON
$ lazyfwd forward list --json
copy
List listening ports on a host
$ lazyfwd port list [host]
copy

SYNOPSIS

lazyfwd [options] [command]

DESCRIPTION

lazyfwd manages SSH local and remote port forwards. With no command it opens a keyboard-driven UI: hosts from your SSH config, saved forwards, listening ports, and live tunnels. It runs the system `ssh`, so `~/.ssh/config`, an agent, and ProxyJump apply.Hosts, pins, and forwards are stored in `workspace.json` under the XDG config directory (on Linux, `~/.config/lazyfwd`). Forwards stop when the UI or serve exits and come back stopped the next time.In the UI, `j` and `k` move, Enter opens a host, Tab or `h` and `l` change panels, Space toggles a forward, and `?` lists keys.

PARAMETERS

--json

Print JSON instead of text. This flag is accepted on every command.
-v, --version
Print the version and exit.

CONFIGURATION

workspace.json

Saved hosts, pins, and forwards. Linux path: `~/.config/lazyfwd/workspace.json`.
$ LAZYFWD_INSTALL_DIR
copy
Directory used by the release install script. The default is `~/.local/bin`.
LAZYFWD_VERSION
Release tag the install script downloads.

SUBCOMMANDS

serve

Own the SSH connections without the terminal UI. Forwards stop when this process exits. Other commands talk to the running UI or to serve.
host list
List hosts, including which ones are pinned and where they came from.
host add host
Add a host by hand and pin it.
host remove host
Remove a host that was added by hand.
host pin host
List this host first.
host unpin host
List this host with the others, by name.
host login host
Complete password or host-key login in this terminal for the running owner.
forward list [host]
List saved forwards and whether they are running.
forward add host target...
Add local or remote forwards. --direction local listens on this machine (`ssh -L`). --direction remote listens on the host (`ssh -R`). --listen sets the listening port or socket. --start brings the new forwards up. --no-wait returns while they are still starting.
forward edit id
Change a forward's target or listening end. --target and --listen select which side changes. --listen auto lets lazyfwd pick a port.
forward delete id...
Stop and delete forwards.
forward start id...
Start forwards. Needs a running UI or serve.
forward stop id...
Stop forwards.
forward toggle id...
Start or stop forwards.
forward open id
Open a forward's local end in the browser.
port list host
List TCP ports listening on a host, with process names when SSH can see them.

CAVEATS

Commands that start tunnels need a running UI or lazyfwd serve. On Windows, the built-in SSH client opens one connection per forward, and lazyfwd refuses hosts that prompt on every connect, hosts with forward lines already in SSH config, and Unix sockets as the local end.

SEE ALSO

ssh(1), lazygit(1)

RESOURCES

Copied to clipboard
Kai