I built a CLI tool called `sshsync` to run shell commands and transfer files across multiple servers over SSH concurrently.
It was inspired by tools like `pssh`, but I wanted something more modern, intuitive, and Pythonic.
What it does:
- Run shell commands on multiple servers (in parallel)
- Push/pull files or directories with progress bars
- Uses `~/.ssh/config` and lets you group hosts with YAML
- Supports `--dry-run` mode to preview actions without executing
- Outputs results using `rich` (tables, colors)
- Built with `Typer`, `asyncssh`, and `rich`
There’s no daemon or extra setup, it reads your existing SSH config and just runs.
Would love feedback on general use and especially if there are ways to improve the `--dry-run` output.
I didn't really expect them to write code on the spot (hate that in interviews), but just to describe a possible solution; there were no wrong answers. Seeing how people came up with a quick hack for 10 and then being able to evolve their thinking for thousands was the point of the question and it could be enlightening to see.
I had a lot of people come up with things that I never even thought of, such as SSH'ing in to all 10 machines and then using a terminal feature to type into all of the windows at once.
reply