1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 06:37:46 +00:00
nu_scripts/custom-completions/ssh
Darren Schroeder 32cdc96414
replace filter with where (#1135)
This PR tries to clean up the use of `filter` by replacing it with
`where`. I did not test each script.

closes #1134
closes #1133
2025-06-12 06:42:16 -05:00
..
README.md Fix: SSH config may not contain hostname (#893) 2024-07-11 10:26:04 -05:00
ssh-completions.nu replace filter with where (#1135) 2025-06-12 06:42:16 -05:00

SSH completions

A Nushell extern definition and completers for the ssh command.

This module provides extern definitions for most of the ssh command options and flags.

Usage

Simply import the extern definitions with

source path/to/ssh-completions.nu

This script will parse /etc/ssh/ssh_config and ~/.ssh/config to fetch SSH config hosts.

Given the following config:

Host my-ip
    HostName 192.168.50.237
Host mydomain
    HostName mydomain.example.com
Host no.hostname
    ProxyCommand ssh -q -W %h:%p office
Host my-domain-2
    HostName mydomain-2.example.com
Host my_domain_3
    HostName mydomain_3.example.com

When you press the tab key, it will display:

 | ssh
my-ip             192.168.50.237
mydomain          mydomain.example.com
no.hostname
my-domain-2       mydomain-2.example.com
my_domain_3       mydomain_3.example.com