You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -15,7 +15,6 @@ lssh is a pure Go, list-oriented SSH toolkit that lets you select hosts from a T
15
15
16
16
### Features
17
17
18
-
- Pure Go SSH toolkit with cross-platform support for Linux, macOS, and Windows
19
18
- Host inventory defined in TOML, with interactive filtering and selection
20
19
- SSH, SCP, and SFTP workflows from a single tool suite
21
20
- Parallel operations across multiple hosts, including command execution and interactive shells
@@ -25,7 +24,7 @@ lssh is a pure Go, list-oriented SSH toolkit that lets you select hosts from a T
25
24
- Authentication support for password, public key, certificate, PKCS#11, and `ssh-agent`
26
25
- OpenSSH config import, known_hosts support
27
26
- ControlMaster/ControlPersist session reuse
28
-
27
+
- Pure Go SSH toolkit with cross-platform support for Linux, macOS, and Windows
29
28
30
29
### Commands
31
30
@@ -36,7 +35,9 @@ The `lssh` suite provides multiple commands for different SSH-related workflows.
36
35
|[lssh](./cmd/lssh/README.md)| Interactive SSH access and port forwarding | TUI-based SSH client for host selection, interactive login, parallel command execution, and forwarding features. |
37
36
|[lsftp](./cmd/lsftp/README.md)| Interactive file operations over SFTP | Interactive SFTP shell for browsing directories, transferring files, and managing one or more hosts together. |
38
37
|[lscp](./cmd/lscp/README.md)| SCP-style file transfer | File transfer command for local-to-remote, remote-to-local, and remote-to-remote copy operations over SSH. |
38
+
|[lssync](./cmd/lssync/README.md)| One-way sync over SSH/SFTP | Sync command for mirroring local or remote trees to a destination, with optional delete behavior. |
39
39
|[lsshell](./cmd/lsshell/README.md)| Sending commands to multiple hosts | Parallel interactive shell that can broadcast commands to selected hosts from a single prompt. |
40
+
|[lsmux](./cmd/lsmux/README.md)| Managing multiple SSH sessions in panes | Tmux-like SSH multiplexer that opens selected hosts in a pane-based TUI, supports command panes and file transfer, and keeps multiple remote sessions visible at once. |
40
41
|[lsmon](./cmd/lsmon/README.md)| Monitoring multiple remote hosts | TUI monitor that displays CPU, memory, disk, network, and process information from multiple hosts side by side. |
41
42
42
43
@@ -50,6 +51,65 @@ If you want to try the main connection patterns locally, see [demo/README.md](./
50
51
51
52
You can install `lssh` with `go install`, Homebrew, or by building from source.
52
53
54
+
### Prebuilt binaries
55
+
56
+
Prebuilt binaries are available on GitHub Releases.
@@ -58,34 +118,34 @@ Install the latest version directly with Go.
58
118
go install github.com/blacknon/lssh/cmd/lssh@latest
59
119
go install github.com/blacknon/lssh/cmd/lscp@latest
60
120
go install github.com/blacknon/lssh/cmd/lsftp@latest
61
-
go install github.com/blacknon/lssh/cmd/lshell@latest
121
+
go install github.com/blacknon/lssh/cmd/lssync@latest
122
+
go install github.com/blacknon/lssh/cmd/lsshell@latest
62
123
go install github.com/blacknon/lssh/cmd/lsmon@latest
63
124
```
64
125
65
-
### build from source
126
+
### brew install
66
127
67
-
Build from the repository when you want to work from the local source tree.
128
+
Install with Homebrew on macOS.
68
129
69
130
```bash
70
-
GO111MODULE=auto go get -u github.com/blacknon/lssh/cmd/lssh
71
-
GO111MODULE=auto go get -u github.com/blacknon/lssh/cmd/lscp
72
-
GO111MODULE=auto go get -u github.com/blacknon/lssh/cmd/lsftp
73
-
GO111MODULE=auto go get -u github.com/blacknon/lssh/cmd/lsshell
74
-
GO111MODULE=auto go get -u github.com/blacknon/lssh/cmd/lsmon
131
+
brew install blacknon/lssh/lssh
75
132
```
76
133
77
-
### brew install
134
+
### build from source
78
135
79
-
Install with Homebrew on macOS.
136
+
Build from the repository when you want to work from the local source tree.
80
137
81
138
```bash
82
-
brew install blacknon/lssh/lssh
139
+
git clone https://github.com/blacknon/lssh.git
140
+
cd lssh
141
+
make build
142
+
sudo make install
83
143
```
84
144
85
145
## Usage
86
146
87
147
This section describes shared configuration features used across the `lssh` suite.
88
-
For command-specific features and CLI usage, see [cmd/README.md](/Users/blacknon/_go/src/github.com/blacknon/lssh/cmd/README.md) and the README in each command directory.
148
+
For command-specific features and CLI usage, see [cmd/README.md](cmd/README.md) and the README in each command directory.
89
149
90
150
### TUI navigation and key bindings
91
151
@@ -425,13 +485,76 @@ note = "reuse ssh session"
425
485
426
486
</details>
427
487
488
+
489
+
### conditional overrides with `match`
490
+
<details>
491
+
492
+
Use `[server.<name>.match.<branch>]` when you want to override only part of a host configuration under specific conditions.
493
+
Each match branch can change fields such as `proxy`, `user`, `port`, `note`, or `ignore`.
494
+
All matching branches are evaluated in ascending `priority` order, and later branches overwrite earlier ones.
495
+
This lets you split conditions such as `network`, `os`, and `terminal` into separate layers.
496
+
497
+
```toml
498
+
[server.app]
499
+
addr = "192.168.100.50"
500
+
user = "demo"
501
+
key = "~/.ssh/id_rsa"
502
+
note = "direct by default"
503
+
504
+
[server.app.match.office_network]
505
+
priority = 1
506
+
when.local_ip_in = ["192.168.100.0/24"]
507
+
proxy = "ssh-bastion"
508
+
note = "use bastion from office network"
509
+
510
+
[server.app.match.macos]
511
+
priority = 50
512
+
when.os_in = ["darwin"]
513
+
when.term_in = ["iterm2"]
514
+
when.env_in = ["SSH_AUTH_SOCK"]
515
+
when.env_value_in = ["TERM_PROGRAM=iTerm.app"]
516
+
user = "demo-mac"
517
+
note = "prefer macOS + iTerm2 settings"
518
+
519
+
[server.app.match.outside_office]
520
+
priority = 90
521
+
when.local_ip_not_in = ["192.168.100.0/24"]
522
+
ignore = true
523
+
```
524
+
525
+
In this example, `app` connects directly by default.
526
+
When the client is inside `192.168.100.0/24`, the `office_network` branch first overrides the host and routes the connection through `ssh-bastion`.
527
+
If the client is also running `lssh` on macOS inside iTerm2, `SSH_AUTH_SOCK` exists, and `TERM_PROGRAM=iTerm.app`, the later `macos` branch additionally overrides `user` and `note`.
528
+
When the client is outside that network, `outside_office` hides the host from selection.
529
+
530
+
Available `when.*` keys:
531
+
532
+
-`local_ip_in`, `local_ip_not_in`
533
+
-`gateway_in`, `gateway_not_in`
534
+
-`username_in`, `username_not_in`
535
+
-`hostname_in`, `hostname_not_in`
536
+
-`os_in`, `os_not_in`
537
+
-`term_in`, `term_not_in`
538
+
-`env_in`, `env_not_in`
539
+
-`env_value_in`, `env_value_not_in`
540
+
541
+
Notes:
542
+
543
+
- Lower `priority` values are applied first. Higher `priority` values win when the same field is set multiple times.
544
+
-`os_*` matches `runtime.GOOS` values such as `darwin`, `linux`, or `windows`.
545
+
-`term_*` mainly matches normalized values from `TERM_PROGRAM` and `TERM` such as `iterm2`, `apple_terminal`, `xterm`, or `tmux`.
546
+
-`env_*` checks whether the named environment variables exist.
547
+
-`env_value_*` matches exact `KEY=value` pairs.
548
+
549
+
</details>
550
+
428
551
## Related projects
429
552
430
553
-[go-sshlib](https://github.com/blacknon/go-sshlib) ... A Go library for SSH connections, command execution, and interactive shell handling.
431
554
432
555
## Licence
433
556
434
-
A short snippet describing the license [MIT](https://github.com/blacknon/lssh/blob/master/LICENSE.md).
557
+
A short snippet describing the license [MIT](LICENSE.md).
0 commit comments