sshwarm

command module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2026 License: GPL-3.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

sshwarm

k9s for ssh. Your Linux machines, their services, containers and logs, in one terminal.

Tired of ssh-ing into box after box to find out what's deployed where, which service died overnight and which container is crash-looping? sshwarm shows the whole swarm at a glance, with the logs of whatever is red a keypress away.

  • Every machine, one table: uptime, pending reboot, systemd units, compose stacks.
  • Agentless: a small bash probe over your own ssh, with your keys, agent and ~/.ssh/config. Nothing to install on the machines.
  • Scriptable: sshwarm status prints the table and exits 1 when anything is wrong.

Get it

go install github.com/cmdoret/sshwarm@latest

Or run directly from the flake using nix:

nix run github:cmdoret/sshwarm -- --hosts hosts.toml

Or download a binary from the releases.

Requirements

Linux machines with systemd and bash, reachable over ssh without a password prompt (keys or agent), where the ssh user:

  • is in the systemd-journal group.
  • can run docker without password (either rootless or with passwordless sudo).

Use

sshwarm --hosts hosts.toml

Hosts file

Only name is required. ssh looks up host, or else name, in ~/.ssh/config for anything not set in the file, like ports or jump hosts. Set SSHWARM_HOSTS or SSHWARM_FLAKE to skip the flag. See sshwarm help for more.

# hosts.toml: one [[host]] per machine
[[host]]
name = "db"                  # ssh db: user, key, port... from "Host db" in ~/.ssh/config

[[host]]
name = "web-1"
host = "web-1.example.org"   # ssh -i ~/.ssh/web deploy@web-1.example.org
user = "deploy"
key  = "~/.ssh/web"

Nix flake

Instead of a hosts file, you may provide a Nix flake exposing deploy.nodes in its outputs. See deploy-rs for more information.

sshwarm --flake ./nix

How it works

flowchart LR
    src["hosts.toml or flake.nix"] --> sw[sshwarm]
    sw -- "ssh, in parallel,<br>with ~/.ssh/config" --> m["each machine<br>runs probe.sh"]
    m -- "OS, reboot,<br>units, stacks" --> sw
    sw --> ui["browser:<br>machines, services,<br>stacks, containers"]
    ui -. "logs, describe, shell,<br>on demand" .-> m

Docker images

Container images are also available, but they suffer from a few usability limitations:

  • nix is not included in the image, so you can only use hosts.toml
  • hosts.toml must fully define the hosts, as ssh refuses a mounted ~/..ssh/config.
docker run --rm -it -v ./hosts.toml:/hosts.toml:ro \
  -v ~/.ssh/id_ed25519:/root/.ssh/id_ed25519:ro -v ~/.ssh/known_hosts:/root/.ssh/known_hosts:ro \
  ghcr.io/cmdoret/sshwarm --hosts /hosts.toml

Documentation

Overview

sshwarm shows the state of Linux machines over ssh: uptime, pending reboots, failed units, compose stacks, and their logs.

Directories

Path Synopsis
internal
swarm
Package swarm talks to the machines over ssh: it lists them, probes them, streams their logs and descriptions, and opens shells.
Package swarm talks to the machines over ssh: it lists them, probes them, streams their logs and descriptions, and opens shells.
ui
Package ui shows the machines: as a table on stdout (PrintStatus), or as a TUI (Run) with their services, stacks, containers and logs.
Package ui shows the machines: as a table on stdout (PrintStatus), or as a TUI (Run) with their services, stacks, containers and logs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL