This repository contains a collection of CLI scripts that enhance the developer experience when working with the Docker CLI. These scripts utilize enquirer to provide a user-friendly interface in the terminal.
This script looks for a docker-compose
file within the current directory and provides the user with a list of potential services to start. The user can then select the services to start.
The script provides the user with a list of running docker containers. The user can then select the containers to stop.
The script provides the user with a list of running docker containers. The user can then select one of the containers to get the logs.
- Clone this repository
- Install the dependencies:
npm install
- Build the scripts:
npm run build
It is recommended to add the scripts to your dotfiles so they are available globally. How you do it depends on your local setup. Here is an example of
how to add the scripts to your ~/.functions
file. Note that you have to replace <path-to-repository>
with the actual
path to the repository.
function dks() {
# docker kill selected
node <path-to-repository>/_dist/executables/stopDockerServices.js
return
}
function dss() {
# docker start selected
node <path-to-repository>/_dist/executables/startDockerServices.js
return
}
function dl() {
# docker log selected
node <path-to-repository>/_dist/executables/startDockerLogs.js
return
}
After adding the functions to your dotfiles, you must restart your terminal.
After adding the functions to your dotfiles, you can use the following commands in your terminal:
dks
: Stop selection of Docker containers
dss
: Start selection of Docker containers
dl
: Get logs of specific Docker container