Introduction to dcli that is cli for Docker.
Tags: docker, javascript
Published: 2020-04-11 13:32:51


**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

- [dcli](#dcli)
  - [Installation](#installation)
  - [Commands](#commands)
    - [default](#default)
      - [-c](#c)
      - [-i](#i)
      - [-v](#v)
    - [start](#start)
      - [start all](#start-all)
    - [stop](#stop)
      - [stop all](#stop-all)
    - [rm](#rm)
      - [rm force](#rm-force)
    - [rmi](#rmi)
      - [rmi -f](#rmi--f)
    - [inspect](#inspect)
      - [inspect only IPAddress](#inspect-only-ipaddress)
    - [dump](#dump)


### Installation

```npm
npm i @enesusta/dcli -g
```
**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**

```bash
dcli -c
```
##### -i

Lists only **images**

```bash
dcli -i
```

##### -v

Lists only **volumes**

```bash
dcli -v
```

![](https://raw.githubusercontent.com/enesusta/assets-host-for-github-pages/assets/dcli/dcli.gif)

#### start

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

```bash
dcli start
```

![](https://raw.githubusercontent.com/enesusta/assets-host-for-github-pages/assets/dcli/dcli-start-1.gif)

##### start all

Starts **whole** containers that you already have.

```bash
dcli start --all
```
![](https://raw.githubusercontent.com/enesusta/assets-host-for-github-pages/assets/dcli/dcli-start-2.gif)

#### stop

**Stops** a container that you already have.

```bash
dcli stop
```
![]( https://raw.githubusercontent.com/enesusta/assets-host-for-github-pages/assets/dcli/dcli-stop-1.gif)

##### stop all

Stops **whole** containers that you already have.

```bash
dcli stop --all
```

![](https://raw.githubusercontent.com/enesusta/assets-host-for-github-pages/assets/dcli/dcli-stop-2.gif)

#### rm

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

```bash
dcli rm
```


![](https://raw.githubusercontent.com/enesusta/assets-host-for-github-pages/assets/dcli/dcli-rm-1.gif)

##### rm force

Removes a contaniner that is **running**

```bash
dcli rm -f
```
or 

```bash
dcli rm --force
```

#### rmi

Removes a image that you already have.

```bash
dcli rmi
```

![](https://raw.githubusercontent.com/enesusta/assets-host-for-github-pages/assets/dcli/dcli-rmi-1.gif)

##### rmi -f



#### inspect

Inspects a container that you already have.  

**inspect** command has **1 option**.

```bash
dcli inspect
```

![](https://raw.githubusercontent.com/enesusta/assets-host-for-github-pages/assets/dcli/dcli-inspect.gif)


##### inspect only IPAddress

This option uses `grep` via `unix pipes`.

```bash
dcli inspect -h
```

`-h` means host.

![](https://raw.githubusercontent.com/enesusta/assets-host-for-github-pages/assets/dcli/dcli-inspect-3.gif)

#### dump

**dcli** can even dump your database containers.

- For **postgre** containers;

```bash
dcli dump --postgre
```

![](https://raw.githubusercontent.com/enesusta/assets-host-for-github-pages/assets/dcli/dcli-dump-postgre-2.gif)

- For **mysql** containers;

```bash
dcli dump --mysql
```

![](https://raw.githubusercontent.com/enesusta/assets-host-for-github-pages/assets/dcli/dcli-dump-mysql-2.gif)