Compose comes with command completion for the bash and zsh shell.
Make sure bash completion is installed. If you use a current Linux in a non-minimal installation, bash completion should be available. On a Mac, install with
brew install bash-completion
Place the completion script in
/usr/local/etc/bash_completion.d/ on a Mac), using e.g.
curl -L https://raw.githubusercontent.com/docker/compose/$(docker-compose version --short)/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose
Completion will be available upon next login.
Place the completion script in your
/path/to/zsh/completion, using e.g.
mkdir -p ~/.zsh/completion curl -L https://raw.githubusercontent.com/docker/compose/$(docker-compose version --short)/contrib/completion/zsh/_docker-compose > ~/.zsh/completion/_docker-compose
Include the directory in your
$fpath, e.g. by adding in
compinit is loaded or do it by adding in
autoload -Uz compinit && compinit -i
Then reload your shell
exec $SHELL -l
Depending on what you typed on the command line so far, it will complete
docker-compose scale, completed service names will automatically have “=” appended.
docker-compose kill -swill complete some signals like SIGHUP and SIGUSR1.
Enjoy working with Compose faster and with less typos!
© 2013–2016 Docker, Inc.
Licensed under the Apache License, Version 2.0.
Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries.
Docker, Inc. and other parties may also have trademark rights in other terms used herein.