Homebrew
brew install nikitasova/dux/duxAPT
curl -fsSL https://nikitasova.github.io/dux/dux.gpg | sudo gpg --dearmor -o /usr/share/keyrings/dux.gpg
echo "deb [signed-by=/usr/share/keyrings/dux.gpg] https://nikitasova.github.io/dux/repo/apt stable main" | sudo tee /etc/apt/sources.list.d/dux.list
sudo apt update && sudo apt install duxGo
go install github.com/nikitasova/dux/cmd/dux@latestScript
curl -fsSL https://raw.githubusercontent.com/nikitasova/dux/main/install.sh | bashdux # List contexts
dux <name> # Switch to context
dux create <name> # Create context
dux create -r <name> <ssh> # Create SSH remote context
dux delete <name> # Delete context
dux current # Show current context
dux prompt # Install shell promptExamples
$ dux
NAME DESCRIPTION DOCKER ENDPOINT
default * unix:///var/run/docker.sock
production ssh://user@prod.example.com
$ dux production
Current context is now "production"
$ dux create -r staging root@192.168.1.100# Zsh - add to ~/.zshrc
eval "$(dux completion zsh)"
# Bash - add to ~/.bashrc
eval "$(dux completion bash)"
# Fish
dux completion fish > ~/.config/fish/completions/dux.fishInstall and configure dux-prompt to show context in your prompt:
dux promptAdd to ~/.zshrc:
source ~/.dux/dux-prompt.sh
PROMPT='$(docker_ps1) '$PROMPTResult: (🐳|production) ~/projects $
# Toggle ON/OFF pre-command / prompt
# ON
dockon
# OFF
dockoff