diff --git a/README.md b/README.md index c1dd674..55be1c2 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,50 @@ -# csc : Cluster SSH Command +# csc — Cluster SSH Command -Launch command over SSH on cluster hosts with "dialog" DEBIAN_FRONTEND. +Run a command over SSH on a group of hosts, with colored per-host output and progress tracking. -## Tree +## Install + +Copy `csc` somewhere in your `$PATH` and make it executable: ```bash -$ tree -. -├── csc -└── README.md +cp csc ~/.local/bin/csc +chmod +x ~/.local/bin/csc +``` -0 directories, 2 files +## Configuration + +Host groups are plain text files under `~/.config/csc/` (one hostname per line, `#` comments supported): + +``` +# ~/.config/csc/webservers +web01.example.com +web02.example.com +# web03.example.com (disabled) ``` ## Usage -```bash -$ csc -h +``` Usage: csc [OPTION]... [COMMAND] -h show help -v enable verbose mode - -c specify config dir, default is /home/flo/.config/csc + -c specify config dir, default is ~/.config/csc -g specify group -d enable dry run mode ``` -Host group file must exists under config dir, one host per line. +```bash +csc -g webservers uptime +csc -g webservers -d "apt-get upgrade -y" # dry run: shows commands, no ssh +csc -g webservers -v df -h # verbose +csc -g webservers -c /etc/csc uptime # custom config dir +``` + +## Output + +``` +[1/2] "uptime" on web01 → ssh -t web01 "TERM=xterm DEBIAN_FRONTEND=dialog uptime" +✓ ok +[2/2] "uptime" on web02 → ... +✗ failed (exit 255) +```