Lightweight SSH-Client. Build to manage IoT devices (like Raspberry Pis) VMs, Systems. It is agentless and relies on SSH Infrastructure. Fully capable of remotely executing commands on inventories and fetching you the consolidated outputs.
- Works with Unix-based systems (Linux, macOS)
- Python 3.7 or higher
- SSH passwordless login
The system running Butter
should be able to login into each device through SSH without a password. So, generate SSH key pair and copy the public key to all other devices.
ssh-keygen
ssh-copy-id [email protected]
- Clone the
butter
repository
git clone https://github.com/cloud-and-smart-labs/butter.git
- Install the package
pip install butter
- Linux Systems (Bash Shell)
_BUTTER_COMPLETE=bash_source butter > ~/.butter-complete.bash && echo '. ~/.butter-complete.bash' >> ~/.bashrc && source ~/.bashrc
- MacOS (zsh Shell)
The completion system needs to be activated. Add the following to your~/.zshrc
or~/.zprofile
autoload -Uz compinit
compinit
Then enabling Auto-completion
echo 'eval "$(_BUTTER_COMPLETE=zsh_source butter)"' >> ~/.zprofile && source ~/.zprofile && echo 'eval "$(_BUTTER_COMPLETE=zsh_source butter)"' >> ~/.zprofile && source ~/.zprofile
Butter has two types of commands:
inventory:
Creates inventory that contains the SSH details of hostsExe
cute: Executes the commands on inventories
butter --help
- Create inventory
demo
butter inventory create demo
butter inventory create demo_1 demo_2 demo_3
- Add hosts into the inventory
demo
butter inventory add demo [email protected] [email protected]
- Get list of inventories
butter inventory ls
butter inventory ls -a
- Get list of Hosts inside inventory
butter inventory ls demo
butter inventory ls demo_1 demo_2
- Remove host from inventory
butter inventory rm demo 172.17.0.3 172.17.0.4
OR
butter inventory rm demo [email protected] [email protected]
- Remove inventory
demo
butter inventory clear demo
Clear all
butter inventory clear -a
Execute commands
butter exe sh demo 'docker image ls'
-s
: Serially Stream
butter exe sh demo 'docker image ls' -s
OR use shorter one
bx
: b
utter ex
ecute
bx demo 'docker image ls'
bx demo 'docker image ls' -s
This tool is licensed under the Apache License 2.0.