The zsh-dce plugin is a Zsh utility that helps you quickly navigate to your docker containers without losing the current folder context.
You can install the plugin manually by cloning the repository into your ~/.oh-my-zsh/custom/plugins/ directory.
git clone https://github.com/Onnokh/zsh-dce ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/dceAfter cloning the repository, you need to enable the plugin in your Zsh configuration.
nano ~/.zshrcFind the plugins section and add dce to the list of plugins:
plugins=(<other plugins> dce)
Add the following to your .zshrc:
source ~/.oh-my-zsh/custom/plugins/dce/dce.plugin.zsh
After saving the changes to .zshrc, reload your Zsh configuration by running:
source ~/.zshrcThis will enable the dce plugin and any other plugins you added.
Usage
Once the plugin is installed, you can use it as follows:
- Navigate to a project:
Use the dce command followed by the project name:
dce <container_name> <command>The plugin assumes that your docker-compose.yml is located under ~/dev. If your config file is in a different directory, you can customize the the folder with the following command:
dce --folder ~/path/to/your/config