opscli Installation Guide
1. Single Machine Installation
- For Domestic Users (China)
curl -sfL https://ghp.ci/https://raw.githubusercontent.com/shaowenchen/ops/main/getcli.sh | VERSION=latest sh -
- For International Users (Outside China)
curl -sfL https://raw.githubusercontent.com/shaowenchen/ops/main/getcli.sh | VERSION=latest sh -
2. Batch Installation
To install opscli
on multiple hosts, list the IP addresses of all hosts in a hosts.txt
file, and use the opscli shell
command to execute the installation. The default credential is the current user's ~/.ssh/id_rsa
.
- For Domestic Users (China)
/usr/local/bin/opscli shell --content "curl -sfL https://ghp.ci/https://raw.githubusercontent.com/shaowenchen/ops/main/getcli.sh | VERSION=latest sh -" -i hosts.txt
- For International Users (Outside China)
/usr/local/bin/opscli shell --content "curl -sfL https://raw.githubusercontent.com/shaowenchen/ops/main/getcli.sh | VERSION=latest sh -" -i hosts.txt
3. Version Upgrade
- For Single Machine
sudo /usr/local/bin/opscli upgrade
- For Batch Upgrade
/usr/local/bin/opscli shell --content "sudo /usr/local/bin/opscli upgrade" -i hosts.txt
4. Auto-completion Setup
- For bash
echo 'source <(opscli completion bash)' >>~/.bashrc
- For zsh
echo 'source <(opscli completion zsh)' >>~/.zshrc
5. More Information
To see additional usage options:
/usr/local/bin/opscli --help