multiSSH3 6.26__tar.gz → 6.29__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {multissh3-6.26 → multissh3-6.29}/PKG-INFO +70 -17
- {multissh3-6.26 → multissh3-6.29}/README.md +69 -13
- multissh3-6.29/mssh_complete.py +4721 -0
- {multissh3-6.26 → multissh3-6.29}/multiSSH3.egg-info/PKG-INFO +70 -17
- {multissh3-6.26 → multissh3-6.29}/multiSSH3.egg-info/SOURCES.txt +20 -2
- {multissh3-6.26 → multissh3-6.29}/multiSSH3.egg-info/entry_points.txt +1 -0
- multissh3-6.29/multiSSH3.egg-info/top_level.txt +2 -0
- {multissh3-6.26 → multissh3-6.29}/multiSSH3.py +1092 -559
- {multissh3-6.26 → multissh3-6.29}/setup.py +2 -5
- {multissh3-6.26 → multissh3-6.29}/tests/test_cli_branches.py +8 -8
- {multissh3-6.26 → multissh3-6.29}/tests/test_cli_processing.py +22 -0
- multissh3-6.29/tests/test_complete_blesh.py +89 -0
- multissh3-6.29/tests/test_complete_context.py +157 -0
- multissh3-6.29/tests/test_complete_editor.py +274 -0
- multissh3-6.29/tests/test_complete_engine.py +259 -0
- multissh3-6.29/tests/test_complete_eval.py +66 -0
- multissh3-6.29/tests/test_complete_hosts.py +23 -0
- multissh3-6.29/tests/test_complete_index.py +199 -0
- multissh3-6.29/tests/test_complete_keys.py +485 -0
- multissh3-6.29/tests/test_complete_lex.py +43 -0
- multissh3-6.29/tests/test_complete_mssh_helpers.py +122 -0
- multissh3-6.29/tests/test_complete_picker.py +222 -0
- multissh3-6.29/tests/test_complete_shells.py +295 -0
- multissh3-6.29/tests/test_complete_store.py +89 -0
- multissh3-6.29/tests/test_complete_suggest.py +129 -0
- multissh3-6.29/tests/test_complete_terminal.py +129 -0
- multissh3-6.29/tests/test_complete_untrusted.py +63 -0
- multissh3-6.29/tests/test_config_cli.py +233 -0
- {multissh3-6.26 → multissh3-6.29}/tests/test_curses_branches.py +13 -0
- multissh3-6.29/tests/test_expand_hostnames.py +397 -0
- multissh3-6.29/tests/test_file_trust.py +258 -0
- {multissh3-6.26 → multissh3-6.29}/tests/test_helpers_extra.py +30 -0
- multissh3-6.29/tests/test_host.py +45 -0
- multissh3-6.29/tests/test_main_lifecycle.py +380 -0
- multissh3-6.29/tests/test_run_command.py +333 -0
- multissh3-6.29/tests/test_run_command_characterization.py +221 -0
- multissh3-6.29/tests/test_run_on_hosts.py +176 -0
- {multissh3-6.26 → multissh3-6.29}/tests/test_run_on_hosts_modes.py +23 -3
- multissh3-6.29/tests/test_stream_reader.py +133 -0
- {multissh3-6.26 → multissh3-6.29}/tests/test_unavailable_hosts.py +152 -3
- multissh3-6.26/multiSSH3.egg-info/requires.txt +0 -2
- multissh3-6.26/multiSSH3.egg-info/top_level.txt +0 -1
- multissh3-6.26/tests/test_config_cli.py +0 -58
- multissh3-6.26/tests/test_expand_hostnames.py +0 -100
- multissh3-6.26/tests/test_host.py +0 -36
- multissh3-6.26/tests/test_main_lifecycle.py +0 -187
- multissh3-6.26/tests/test_ordered_multiset.py +0 -45
- multissh3-6.26/tests/test_run_command.py +0 -178
- multissh3-6.26/tests/test_run_on_hosts.py +0 -49
- {multissh3-6.26 → multissh3-6.29}/multiSSH3.egg-info/dependency_links.txt +0 -0
- {multissh3-6.26 → multissh3-6.29}/setup.cfg +0 -0
- {multissh3-6.26 → multissh3-6.29}/tests/test_color_helpers.py +0 -0
- {multissh3-6.26 → multissh3-6.29}/tests/test_compact_hostnames.py +0 -0
- {multissh3-6.26 → multissh3-6.29}/tests/test_config_validate.py +0 -0
- {multissh3-6.26 → multissh3-6.29}/tests/test_curses_event_loop.py +0 -0
- {multissh3-6.26 → multissh3-6.29}/tests/test_curses_tui.py +0 -0
- {multissh3-6.26 → multissh3-6.29}/tests/test_harness_smoke.py +0 -0
- {multissh3-6.26 → multissh3-6.29}/tests/test_ipmi_lockout_wait.py +0 -0
- {multissh3-6.26 → multissh3-6.29}/tests/test_output_merge.py +0 -0
- {multissh3-6.26 → multissh3-6.29}/tests/test_run_command_branches.py +0 -0
- {multissh3-6.26 → multissh3-6.29}/tests/test_runtime_branch_matrix.py +0 -0
- {multissh3-6.26 → multissh3-6.29}/tests/test_smoke_optional.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: multiSSH3
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.29
|
|
4
4
|
Summary: Run commands on multiple hosts via SSH
|
|
5
5
|
Home-page: https://github.com/yufei-pan/multiSSH3
|
|
6
6
|
Author: Yufei Pan
|
|
@@ -13,8 +13,6 @@ Classifier: Operating System :: MacOS
|
|
|
13
13
|
Classifier: Operating System :: Microsoft :: Windows
|
|
14
14
|
Requires-Python: >=3.6
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
|
-
Requires-Dist: argparse
|
|
17
|
-
Requires-Dist: ipaddress
|
|
18
16
|
Dynamic: author
|
|
19
17
|
Dynamic: author-email
|
|
20
18
|
Dynamic: classifier
|
|
@@ -22,7 +20,6 @@ Dynamic: description
|
|
|
22
20
|
Dynamic: description-content-type
|
|
23
21
|
Dynamic: home-page
|
|
24
22
|
Dynamic: license
|
|
25
|
-
Dynamic: requires-dist
|
|
26
23
|
Dynamic: requires-python
|
|
27
24
|
Dynamic: summary
|
|
28
25
|
|
|
@@ -168,13 +165,18 @@ to print the help message with current default values.
|
|
|
168
165
|
Defaults are read from the following chain map stored as json files, top ones overwrite the bottom ones.:
|
|
169
166
|
| `CONFIG_FILE_CHAIN` |
|
|
170
167
|
| ------------------------------------------ |
|
|
171
|
-
| `./multiSSH3.config.json` |
|
|
172
168
|
| `~/multiSSH3.config.json` |
|
|
173
169
|
| `~/.multiSSH3.config.json` |
|
|
174
170
|
| `~/.config/multiSSH3/multiSSH3.config.json`|
|
|
175
171
|
| `/etc/multiSSH3.d/multiSSH3.config.json` |
|
|
176
172
|
| `/etc/multiSSH3.config.json` |
|
|
177
173
|
|
|
174
|
+
> The current directory is not searched: a cloned repo or an unpacked archive could otherwise change any setting, including which `ssh` runs. Use `--config_file` to load a config file from there; mssh prints a note when `./multiSSH3.config.json` exists (read automatically up to 6.26).
|
|
175
|
+
>
|
|
176
|
+
> Config and env files found on these default paths are only loaded when they are owned by you or root and nobody else can write to them (group write is fine when the group is your own private group). Others are skipped with a warning that shows the `chmod` fix. Files you name with `--config_file`, `--env_file` or `--env_files` are always loaded.
|
|
177
|
+
>
|
|
178
|
+
> `--store_config_file` writes the file readable by you only (`0600`), as it can hold passwords. The `/etc` locations above are written `0644` so every user can read them. An existing file's permissions are only ever tightened, and a file whose permissions cannot be restricted is left untouched (the config is printed instead).
|
|
179
|
+
|
|
178
180
|
### Generating / Storing Config File
|
|
179
181
|
To store / generate a config file with the current command line options, you can use
|
|
180
182
|
```bash
|
|
@@ -188,7 +190,7 @@ mssh --store_config_file [STORE_CONFIG_FILE_PATH]
|
|
|
188
190
|
>
|
|
189
191
|
>`--generate_config_file` will output to stdout if `--config_file` is not specified.
|
|
190
192
|
|
|
191
|
-
>
|
|
193
|
+
> Without a path, `--store_config_file` writes to the config file mssh loaded, or to `~/.multiSSH3.config.json` if none was loaded.
|
|
192
194
|
|
|
193
195
|
You can modify the json file or use command line arguments to update values and store them as defaults.
|
|
194
196
|
```bash
|
|
@@ -200,7 +202,7 @@ will store
|
|
|
200
202
|
"DEFAULT_CLI_TIMEOUT": "180"
|
|
201
203
|
...
|
|
202
204
|
```
|
|
203
|
-
into
|
|
205
|
+
into `~/.multiSSH3.config.json` (or the config file mssh loaded)
|
|
204
206
|
|
|
205
207
|
|
|
206
208
|
> If you want to store password, it will be a plain text password in this config file. This will be better to supply it everytime as a CLI argument but you should really consider setting up public-key authentication.
|
|
@@ -262,7 +264,8 @@ When hostname need to be resolved, mssh will check in the following order:
|
|
|
262
264
|
- Redo the whole range -> hostname resolution logic with the resolved env variable value.
|
|
263
265
|
- hostname is in map generated from env_file(s) specified by `--env_files ENV_FILES`
|
|
264
266
|
- Redo the whole range -> hostname resolution logic with the resolved env variable value.
|
|
265
|
-
- Lookup using `socket.
|
|
267
|
+
- Lookup using `socket.getaddrinfo()` to query dns server ( IPv4 preferred, IPv6 accepted ). Names are looked up in parallel.
|
|
268
|
+
- If the ssh config (`ssh -G`) maps the name to another `HostName` or through a `ProxyJump` / `ProxyCommand`, it is valid ( `#IP#` uses the `HostName`'s address when it resolves ). A catch-all block such as `Host *` only counts when it gives the name a `HostName` that resolves (e.g. `HostName %h.corp.example`), so typos are still rejected.
|
|
266
269
|
|
|
267
270
|
> TLDR:
|
|
268
271
|
>
|
|
@@ -285,12 +288,11 @@ When hostname need to be resolved, mssh will check in the following order:
|
|
|
285
288
|
| `~/.zshrc` |
|
|
286
289
|
| `~/host.env` |
|
|
287
290
|
| `~/hosts.env` |
|
|
288
|
-
| `.env` |
|
|
289
|
-
| `host.env` |
|
|
290
|
-
| `hosts.env` |
|
|
291
291
|
|
|
292
292
|
Later files take precedence over earlier files.
|
|
293
293
|
|
|
294
|
+
> The current directory is not searched, as files there could redirect host aliases. Use `--env_files hosts.env` to add one. mssh points this out when a host name it cannot find is defined in `./.env`, `./host.env` or `./hosts.env` (read automatically up to 6.26).
|
|
295
|
+
|
|
294
296
|
### Example Env Hostname File
|
|
295
297
|
|
|
296
298
|
An example hostname alias file will look like:
|
|
@@ -373,6 +375,60 @@ mssh will replace some magic strings in the command string with host specific va
|
|
|
373
375
|
|
|
374
376
|
> Note: Resolved name is the IP / Hostname with user appended and ip prefix applied. This is what got used to connect to the host.
|
|
375
377
|
|
|
378
|
+
## Autocomplete
|
|
379
|
+
|
|
380
|
+
mssh completes hosts, options, option values and remote commands when you press TAB, in bash, zsh and fish.
|
|
381
|
+
|
|
382
|
+
```bash
|
|
383
|
+
mssh --completion install # set it up for the shell you run this from
|
|
384
|
+
mssh --completion uninstall # remove it again
|
|
385
|
+
mssh --completion bash # or print the script (bash, zsh or fish)
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
- **Hosts:** host strings you typed before, env file aliases, `/etc/hosts`, ssh config `Host` entries, `known_hosts` and the ARP table. Large clusters are offered as ranges (`node[0001-2000]`) until what you typed narrows them down. Hosts mssh recently found unreachable come last.
|
|
389
|
+
- **Options and values:** option names, and values you used before (`-u`, `-t`, ...). Paths complete as files. Passwords are never completed.
|
|
390
|
+
- **Commands:** commands from your mssh history, the rest of a command from this machine's own completion (`mssh grp systemctl rest<TAB>`), and the magic strings (`#HOST#`, ...).
|
|
391
|
+
|
|
392
|
+
Ranking uses the rest of the line on both sides of the cursor: after `mssh gpu[01-16] "` the commands you run on those hosts come first, and in the hosts of `mssh ▮ "systemctl restart slurmd"` the hosts you restarted slurmd on come first.
|
|
393
|
+
|
|
394
|
+
Completion never removes what you typed, prints nothing, and falls back to the shell's normal completion when anything is slow or missing.
|
|
395
|
+
|
|
396
|
+
It learns from an index of your history and hosts, kept in mssh's private cache directory (`$XDG_RUNTIME_DIR/multiSSH3` or `/tmp/multiSSH3-<uid>`) and rebuilt in the background when its sources change. `mssh-complete rebuild` rebuilds it now; `mssh-complete eval` replays your history and shows how much typing completion saves.
|
|
397
|
+
|
|
398
|
+
### Grey suggestions
|
|
399
|
+
|
|
400
|
+
While you type an mssh line, the most likely rest of it shows in grey after the cursor: the rest of the line when one past invocation clearly fits, only the rest of the current word when only that is clear, or the start every known value shares when none is (what TAB would insert), nothing when mssh is not sure. → (or End, Ctrl-F) takes all of it, Alt-→ / Ctrl-→ / Alt-F one word. Enter runs only what you typed.
|
|
401
|
+
|
|
402
|
+
- **zsh:** built in; with [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions) loaded, mssh becomes its first strategy on mssh lines.
|
|
403
|
+
- **bash with [ble.sh](https://github.com/akinomyoga/ble.sh):** built in, as ble.sh's first suggestion source.
|
|
404
|
+
- **plain bash (4.4 or later):** turn on the mssh line editor, which takes over after you type an mssh name and a space, and hands the line back to readline on any key it does not handle (↑, Ctrl-K, ...) or when you delete into `mssh `:
|
|
405
|
+
|
|
406
|
+
```bash
|
|
407
|
+
mssh --completion install bash editor
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
Installing again keeps it on; `mssh --completion uninstall bash`, then `mssh --completion install bash`, turns it off.
|
|
411
|
+
|
|
412
|
+
- **fish:** fish's own suggestions already use mssh's completion.
|
|
413
|
+
|
|
414
|
+
### Ctrl-R
|
|
415
|
+
|
|
416
|
+
Ctrl-R on an mssh line opens a menu below the prompt with the candidates for the word under the cursor (hosts, commands for those hosts, option values), how often and how long ago you used them; Tab switches to whole past invocations. Type to filter, ↑/↓ to move, Enter to insert, Esc to leave the line as it was. On any other line Ctrl-R does what it did before (readline's search, fzf, atuin, ...).
|
|
417
|
+
|
|
418
|
+
| Environment variable | Effect |
|
|
419
|
+
| --- | --- |
|
|
420
|
+
| `MSSH_COMPLETE_TIMEOUT` | Seconds the shell waits for an answer (default 0.3) |
|
|
421
|
+
| `MSSH_COMPLETE_GHOST_TIMEOUT` | ble.sh only: milliseconds a grey suggestion may take (default 300) |
|
|
422
|
+
| `MSSH_COMPLETE_SHELL_HISTORY` | Lines of shell history sent along (default 1000) |
|
|
423
|
+
| `MSSH_COMPLETE_EDITOR` | `1` turns on the plain-bash mssh line editor (`install bash editor` sets it) |
|
|
424
|
+
| `MSSH_COMPLETE_DEBUG` | `1` logs errors to `complete.log` in the cache directory |
|
|
425
|
+
|
|
426
|
+
> Tested with bash 4.2 to 5.2, zsh 5.5 to 5.9 (with `compinit` loaded; zsh-autosuggestions 0.7.1), fish 3.3 to 4.0 and the 2026-09-08 ble.sh nightly. Since 6.28 mssh records hosts in its history as typed; older history lines hold them expanded.
|
|
427
|
+
|
|
428
|
+
> After upgrading mssh, run `mssh --completion install` again to get the new shell glue. Glue from an older mssh keeps working, without the newer features.
|
|
429
|
+
|
|
430
|
+
> The plain-bash editor binds the space key, so every space typed in bash runs a tiny shell function; Ctrl-R becomes a key macro (the binding it replaced is called for other lines). Uninstall restores both in new shells.
|
|
431
|
+
|
|
376
432
|
## Options
|
|
377
433
|
|
|
378
434
|
Here details the options for multiSSH3 6.02 @ 2025-11-10
|
|
@@ -565,7 +621,7 @@ mssh -f ./data/ allServers /tmp/data/
|
|
|
565
621
|
- Note: Timedout Hosts are considered unreachable.
|
|
566
622
|
- By default mssh set this to true to speed up operations on large host lists with some unreachable hosts.
|
|
567
623
|
- Unreachable hosts will be tried again when their timeout expires.
|
|
568
|
-
- mssh stores the current run unreachable hosts in memory and if `skip_unreachable` is true, it will store them in
|
|
624
|
+
- mssh stores the current run unreachable hosts in memory and if `skip_unreachable` is true, it will store them in `unavailable_hosts.csv` in `$XDG_RUNTIME_DIR/multiSSH3/`, or else in a private `multiSSH3-<uid>` folder in the system temp folder ( cleared at reboot ). If neither can be used, they are only kept for the current run.
|
|
569
625
|
- To force mssh to not use unreachable hosts from previous runs, you can use `-a, -nsu, --no_skip_unreachable` to set `skip_unreachable` to false.
|
|
570
626
|
|
|
571
627
|
### `-a, -nsu, --no_skip_unreachable` | not _`DEFAULT_SKIP_UNREACHABLE`_
|
|
@@ -597,7 +653,7 @@ mssh -f ./data/ allServers /tmp/data/
|
|
|
597
653
|
### `--store_config_file [STORE_CONFIG_FILE]` | None
|
|
598
654
|
- Store the current command line options to a config file.
|
|
599
655
|
- Equivalent to `--generate_config_file --config_file [STORE_CONFIG_FILE]`
|
|
600
|
-
-
|
|
656
|
+
- Without a path, writes to the config file mssh loaded, or to `~/.multiSSH3.config.json` if none was loaded.
|
|
601
657
|
|
|
602
658
|
### `--debug` | False
|
|
603
659
|
- Enable debug mode.
|
|
@@ -721,7 +777,7 @@ options:
|
|
|
721
777
|
-ef, --env_file ENV_FILE
|
|
722
778
|
Replace the env file look up chain with this env_file. ( Still work with --no_env ) (default: None)
|
|
723
779
|
-efs, --env_files ENV_FILES
|
|
724
|
-
The files to load the mssh file based environment variables from. Can specify multiple. Load first to last. ( Still work with --no_env ) (default: ['/etc/profile.d/hosts.sh', '~/.bashrc', '~/.zshrc', '~/host.env', '~/hosts.env'
|
|
780
|
+
The files to load the mssh file based environment variables from. Can specify multiple. Load first to last. ( Still work with --no_env ) (default: ['/etc/profile.d/hosts.sh', '~/.bashrc', '~/.zshrc', '~/host.env', '~/hosts.env'])
|
|
725
781
|
-m, --max_connections MAX_CONNECTIONS
|
|
726
782
|
Max number of connections to use (default: 4 * cpu_count)
|
|
727
783
|
-j, --json Output in json format. (default: False)
|
|
@@ -912,9 +968,6 @@ DEFAULT_ENV_FILES = ['/etc/profile.d/hosts.sh',
|
|
|
912
968
|
'~/.zshrc',
|
|
913
969
|
'~/host.env',
|
|
914
970
|
'~/hosts.env',
|
|
915
|
-
'.env',
|
|
916
|
-
'host.env',
|
|
917
|
-
'hosts.env',
|
|
918
971
|
]
|
|
919
972
|
DEFAULT_NO_HISTORY = False
|
|
920
973
|
DEFAULT_HISTORY_FILE = '~/.mssh_history'
|
|
@@ -140,13 +140,18 @@ to print the help message with current default values.
|
|
|
140
140
|
Defaults are read from the following chain map stored as json files, top ones overwrite the bottom ones.:
|
|
141
141
|
| `CONFIG_FILE_CHAIN` |
|
|
142
142
|
| ------------------------------------------ |
|
|
143
|
-
| `./multiSSH3.config.json` |
|
|
144
143
|
| `~/multiSSH3.config.json` |
|
|
145
144
|
| `~/.multiSSH3.config.json` |
|
|
146
145
|
| `~/.config/multiSSH3/multiSSH3.config.json`|
|
|
147
146
|
| `/etc/multiSSH3.d/multiSSH3.config.json` |
|
|
148
147
|
| `/etc/multiSSH3.config.json` |
|
|
149
148
|
|
|
149
|
+
> The current directory is not searched: a cloned repo or an unpacked archive could otherwise change any setting, including which `ssh` runs. Use `--config_file` to load a config file from there; mssh prints a note when `./multiSSH3.config.json` exists (read automatically up to 6.26).
|
|
150
|
+
>
|
|
151
|
+
> Config and env files found on these default paths are only loaded when they are owned by you or root and nobody else can write to them (group write is fine when the group is your own private group). Others are skipped with a warning that shows the `chmod` fix. Files you name with `--config_file`, `--env_file` or `--env_files` are always loaded.
|
|
152
|
+
>
|
|
153
|
+
> `--store_config_file` writes the file readable by you only (`0600`), as it can hold passwords. The `/etc` locations above are written `0644` so every user can read them. An existing file's permissions are only ever tightened, and a file whose permissions cannot be restricted is left untouched (the config is printed instead).
|
|
154
|
+
|
|
150
155
|
### Generating / Storing Config File
|
|
151
156
|
To store / generate a config file with the current command line options, you can use
|
|
152
157
|
```bash
|
|
@@ -160,7 +165,7 @@ mssh --store_config_file [STORE_CONFIG_FILE_PATH]
|
|
|
160
165
|
>
|
|
161
166
|
>`--generate_config_file` will output to stdout if `--config_file` is not specified.
|
|
162
167
|
|
|
163
|
-
>
|
|
168
|
+
> Without a path, `--store_config_file` writes to the config file mssh loaded, or to `~/.multiSSH3.config.json` if none was loaded.
|
|
164
169
|
|
|
165
170
|
You can modify the json file or use command line arguments to update values and store them as defaults.
|
|
166
171
|
```bash
|
|
@@ -172,7 +177,7 @@ will store
|
|
|
172
177
|
"DEFAULT_CLI_TIMEOUT": "180"
|
|
173
178
|
...
|
|
174
179
|
```
|
|
175
|
-
into
|
|
180
|
+
into `~/.multiSSH3.config.json` (or the config file mssh loaded)
|
|
176
181
|
|
|
177
182
|
|
|
178
183
|
> If you want to store password, it will be a plain text password in this config file. This will be better to supply it everytime as a CLI argument but you should really consider setting up public-key authentication.
|
|
@@ -234,7 +239,8 @@ When hostname need to be resolved, mssh will check in the following order:
|
|
|
234
239
|
- Redo the whole range -> hostname resolution logic with the resolved env variable value.
|
|
235
240
|
- hostname is in map generated from env_file(s) specified by `--env_files ENV_FILES`
|
|
236
241
|
- Redo the whole range -> hostname resolution logic with the resolved env variable value.
|
|
237
|
-
- Lookup using `socket.
|
|
242
|
+
- Lookup using `socket.getaddrinfo()` to query dns server ( IPv4 preferred, IPv6 accepted ). Names are looked up in parallel.
|
|
243
|
+
- If the ssh config (`ssh -G`) maps the name to another `HostName` or through a `ProxyJump` / `ProxyCommand`, it is valid ( `#IP#` uses the `HostName`'s address when it resolves ). A catch-all block such as `Host *` only counts when it gives the name a `HostName` that resolves (e.g. `HostName %h.corp.example`), so typos are still rejected.
|
|
238
244
|
|
|
239
245
|
> TLDR:
|
|
240
246
|
>
|
|
@@ -257,12 +263,11 @@ When hostname need to be resolved, mssh will check in the following order:
|
|
|
257
263
|
| `~/.zshrc` |
|
|
258
264
|
| `~/host.env` |
|
|
259
265
|
| `~/hosts.env` |
|
|
260
|
-
| `.env` |
|
|
261
|
-
| `host.env` |
|
|
262
|
-
| `hosts.env` |
|
|
263
266
|
|
|
264
267
|
Later files take precedence over earlier files.
|
|
265
268
|
|
|
269
|
+
> The current directory is not searched, as files there could redirect host aliases. Use `--env_files hosts.env` to add one. mssh points this out when a host name it cannot find is defined in `./.env`, `./host.env` or `./hosts.env` (read automatically up to 6.26).
|
|
270
|
+
|
|
266
271
|
### Example Env Hostname File
|
|
267
272
|
|
|
268
273
|
An example hostname alias file will look like:
|
|
@@ -345,6 +350,60 @@ mssh will replace some magic strings in the command string with host specific va
|
|
|
345
350
|
|
|
346
351
|
> Note: Resolved name is the IP / Hostname with user appended and ip prefix applied. This is what got used to connect to the host.
|
|
347
352
|
|
|
353
|
+
## Autocomplete
|
|
354
|
+
|
|
355
|
+
mssh completes hosts, options, option values and remote commands when you press TAB, in bash, zsh and fish.
|
|
356
|
+
|
|
357
|
+
```bash
|
|
358
|
+
mssh --completion install # set it up for the shell you run this from
|
|
359
|
+
mssh --completion uninstall # remove it again
|
|
360
|
+
mssh --completion bash # or print the script (bash, zsh or fish)
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
- **Hosts:** host strings you typed before, env file aliases, `/etc/hosts`, ssh config `Host` entries, `known_hosts` and the ARP table. Large clusters are offered as ranges (`node[0001-2000]`) until what you typed narrows them down. Hosts mssh recently found unreachable come last.
|
|
364
|
+
- **Options and values:** option names, and values you used before (`-u`, `-t`, ...). Paths complete as files. Passwords are never completed.
|
|
365
|
+
- **Commands:** commands from your mssh history, the rest of a command from this machine's own completion (`mssh grp systemctl rest<TAB>`), and the magic strings (`#HOST#`, ...).
|
|
366
|
+
|
|
367
|
+
Ranking uses the rest of the line on both sides of the cursor: after `mssh gpu[01-16] "` the commands you run on those hosts come first, and in the hosts of `mssh ▮ "systemctl restart slurmd"` the hosts you restarted slurmd on come first.
|
|
368
|
+
|
|
369
|
+
Completion never removes what you typed, prints nothing, and falls back to the shell's normal completion when anything is slow or missing.
|
|
370
|
+
|
|
371
|
+
It learns from an index of your history and hosts, kept in mssh's private cache directory (`$XDG_RUNTIME_DIR/multiSSH3` or `/tmp/multiSSH3-<uid>`) and rebuilt in the background when its sources change. `mssh-complete rebuild` rebuilds it now; `mssh-complete eval` replays your history and shows how much typing completion saves.
|
|
372
|
+
|
|
373
|
+
### Grey suggestions
|
|
374
|
+
|
|
375
|
+
While you type an mssh line, the most likely rest of it shows in grey after the cursor: the rest of the line when one past invocation clearly fits, only the rest of the current word when only that is clear, or the start every known value shares when none is (what TAB would insert), nothing when mssh is not sure. → (or End, Ctrl-F) takes all of it, Alt-→ / Ctrl-→ / Alt-F one word. Enter runs only what you typed.
|
|
376
|
+
|
|
377
|
+
- **zsh:** built in; with [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions) loaded, mssh becomes its first strategy on mssh lines.
|
|
378
|
+
- **bash with [ble.sh](https://github.com/akinomyoga/ble.sh):** built in, as ble.sh's first suggestion source.
|
|
379
|
+
- **plain bash (4.4 or later):** turn on the mssh line editor, which takes over after you type an mssh name and a space, and hands the line back to readline on any key it does not handle (↑, Ctrl-K, ...) or when you delete into `mssh `:
|
|
380
|
+
|
|
381
|
+
```bash
|
|
382
|
+
mssh --completion install bash editor
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
Installing again keeps it on; `mssh --completion uninstall bash`, then `mssh --completion install bash`, turns it off.
|
|
386
|
+
|
|
387
|
+
- **fish:** fish's own suggestions already use mssh's completion.
|
|
388
|
+
|
|
389
|
+
### Ctrl-R
|
|
390
|
+
|
|
391
|
+
Ctrl-R on an mssh line opens a menu below the prompt with the candidates for the word under the cursor (hosts, commands for those hosts, option values), how often and how long ago you used them; Tab switches to whole past invocations. Type to filter, ↑/↓ to move, Enter to insert, Esc to leave the line as it was. On any other line Ctrl-R does what it did before (readline's search, fzf, atuin, ...).
|
|
392
|
+
|
|
393
|
+
| Environment variable | Effect |
|
|
394
|
+
| --- | --- |
|
|
395
|
+
| `MSSH_COMPLETE_TIMEOUT` | Seconds the shell waits for an answer (default 0.3) |
|
|
396
|
+
| `MSSH_COMPLETE_GHOST_TIMEOUT` | ble.sh only: milliseconds a grey suggestion may take (default 300) |
|
|
397
|
+
| `MSSH_COMPLETE_SHELL_HISTORY` | Lines of shell history sent along (default 1000) |
|
|
398
|
+
| `MSSH_COMPLETE_EDITOR` | `1` turns on the plain-bash mssh line editor (`install bash editor` sets it) |
|
|
399
|
+
| `MSSH_COMPLETE_DEBUG` | `1` logs errors to `complete.log` in the cache directory |
|
|
400
|
+
|
|
401
|
+
> Tested with bash 4.2 to 5.2, zsh 5.5 to 5.9 (with `compinit` loaded; zsh-autosuggestions 0.7.1), fish 3.3 to 4.0 and the 2026-09-08 ble.sh nightly. Since 6.28 mssh records hosts in its history as typed; older history lines hold them expanded.
|
|
402
|
+
|
|
403
|
+
> After upgrading mssh, run `mssh --completion install` again to get the new shell glue. Glue from an older mssh keeps working, without the newer features.
|
|
404
|
+
|
|
405
|
+
> The plain-bash editor binds the space key, so every space typed in bash runs a tiny shell function; Ctrl-R becomes a key macro (the binding it replaced is called for other lines). Uninstall restores both in new shells.
|
|
406
|
+
|
|
348
407
|
## Options
|
|
349
408
|
|
|
350
409
|
Here details the options for multiSSH3 6.02 @ 2025-11-10
|
|
@@ -537,7 +596,7 @@ mssh -f ./data/ allServers /tmp/data/
|
|
|
537
596
|
- Note: Timedout Hosts are considered unreachable.
|
|
538
597
|
- By default mssh set this to true to speed up operations on large host lists with some unreachable hosts.
|
|
539
598
|
- Unreachable hosts will be tried again when their timeout expires.
|
|
540
|
-
- mssh stores the current run unreachable hosts in memory and if `skip_unreachable` is true, it will store them in
|
|
599
|
+
- mssh stores the current run unreachable hosts in memory and if `skip_unreachable` is true, it will store them in `unavailable_hosts.csv` in `$XDG_RUNTIME_DIR/multiSSH3/`, or else in a private `multiSSH3-<uid>` folder in the system temp folder ( cleared at reboot ). If neither can be used, they are only kept for the current run.
|
|
541
600
|
- To force mssh to not use unreachable hosts from previous runs, you can use `-a, -nsu, --no_skip_unreachable` to set `skip_unreachable` to false.
|
|
542
601
|
|
|
543
602
|
### `-a, -nsu, --no_skip_unreachable` | not _`DEFAULT_SKIP_UNREACHABLE`_
|
|
@@ -569,7 +628,7 @@ mssh -f ./data/ allServers /tmp/data/
|
|
|
569
628
|
### `--store_config_file [STORE_CONFIG_FILE]` | None
|
|
570
629
|
- Store the current command line options to a config file.
|
|
571
630
|
- Equivalent to `--generate_config_file --config_file [STORE_CONFIG_FILE]`
|
|
572
|
-
-
|
|
631
|
+
- Without a path, writes to the config file mssh loaded, or to `~/.multiSSH3.config.json` if none was loaded.
|
|
573
632
|
|
|
574
633
|
### `--debug` | False
|
|
575
634
|
- Enable debug mode.
|
|
@@ -693,7 +752,7 @@ options:
|
|
|
693
752
|
-ef, --env_file ENV_FILE
|
|
694
753
|
Replace the env file look up chain with this env_file. ( Still work with --no_env ) (default: None)
|
|
695
754
|
-efs, --env_files ENV_FILES
|
|
696
|
-
The files to load the mssh file based environment variables from. Can specify multiple. Load first to last. ( Still work with --no_env ) (default: ['/etc/profile.d/hosts.sh', '~/.bashrc', '~/.zshrc', '~/host.env', '~/hosts.env'
|
|
755
|
+
The files to load the mssh file based environment variables from. Can specify multiple. Load first to last. ( Still work with --no_env ) (default: ['/etc/profile.d/hosts.sh', '~/.bashrc', '~/.zshrc', '~/host.env', '~/hosts.env'])
|
|
697
756
|
-m, --max_connections MAX_CONNECTIONS
|
|
698
757
|
Max number of connections to use (default: 4 * cpu_count)
|
|
699
758
|
-j, --json Output in json format. (default: False)
|
|
@@ -884,9 +943,6 @@ DEFAULT_ENV_FILES = ['/etc/profile.d/hosts.sh',
|
|
|
884
943
|
'~/.zshrc',
|
|
885
944
|
'~/host.env',
|
|
886
945
|
'~/hosts.env',
|
|
887
|
-
'.env',
|
|
888
|
-
'host.env',
|
|
889
|
-
'hosts.env',
|
|
890
946
|
]
|
|
891
947
|
DEFAULT_NO_HISTORY = False
|
|
892
948
|
DEFAULT_HISTORY_FILE = '~/.mssh_history'
|