DEV Community

Enes Usta
Enes Usta

Posted on

Introduction to dcli that is cli for Docker.

dcli is cli for Docker.

Main goal of dcli is to simplify routine. dcli do this with autocomplete.

Github Repository: https://github.com/enesusta/dcli

Installation

npm i @enesusta/dcli -g
Enter fullscreen mode Exit fullscreen mode

Note: Make sure that variables like grep, docker, sh are defined on your $PATH variable. Otherwise it may not work.

Commands

default

default command has three options.

-c

Lists only containers

dcli -c
Enter fullscreen mode Exit fullscreen mode
-i

Lists only images

dcli -i
Enter fullscreen mode Exit fullscreen mode
-v

Lists only volumes

dcli -v
Enter fullscreen mode Exit fullscreen mode

start

Starts a container that you already have.
start command has 1 option.

dcli start
Enter fullscreen mode Exit fullscreen mode

start all

Starts whole containers that you already have.

dcli start --all
Enter fullscreen mode Exit fullscreen mode

stop

Stops a container that you already have.

dcli stop
Enter fullscreen mode Exit fullscreen mode

stop all

Stops whole containers that you already have.

dcli stop --all
Enter fullscreen mode Exit fullscreen mode

rm

Removes a container that you already have.
rm command has 1 option

dcli rm
Enter fullscreen mode Exit fullscreen mode

rm force

Removes a contaniner that is running

dcli rm -f
Enter fullscreen mode Exit fullscreen mode

or

dcli rm --force
Enter fullscreen mode Exit fullscreen mode

rmi

Removes a image that you already have.

dcli rmi
Enter fullscreen mode Exit fullscreen mode

rmi -f

inspect

Inspects a container that you already have.

inspect command has 1 option.

dcli inspect
Enter fullscreen mode Exit fullscreen mode

inspect only IPAddress

This option uses grep via unix pipes.

dcli inspect -h
Enter fullscreen mode Exit fullscreen mode

-h means host.

dump

dcli can even dump your database containers.

  • For postgre containers;
dcli dump --postgre
Enter fullscreen mode Exit fullscreen mode

  • For mysql containers;
dcli dump --mysql
Enter fullscreen mode Exit fullscreen mode

Top comments (0)