Installation
The Divio CLI is a Python-based command-line interface to the Divio Cloud. It allows you to interact with the Divio Cloud to manage your applications, organisations, cloudspaces, services and templates. It can be installed via pip:
pip install divio-cli
The Divio CLI source code is available on GitHub.
See how to use the Divio command-line interface or the Divio command-line reference for further information about the possibilities.
Make sure you have added Python to PATH during installation, otherwise you must add it manually for the divio-cli commands to function properly.
Configuration
The behaviour of the Divio CLI is managed via a JSON configuration file. The file is created by the CLI and will be found at either in:
~/.config/divio/config.json
, or~/.aldryn
(the older location for the file - if this file exists it will take precedence)
The file contains a JSON dictionary, for example:
{
"update_check_timestamp": 1501185567,
"skip_doctor_checks": ["docker-server-dns"]
}
Using skip_doctor_checks
The skip_doctor_checks
are particularly useful, and can be used to disable certain automated checks run by the Divio app and the divio doctor
command (for example, if you are working offline, or with network restrictions).
The checks that divio doctor
runs are classes in check_system.py. If a check fails that you think can be ignored, add it to the skip_doctor_checks
list to disable it, as in the example above. The checks that can be disabled are:
login
- checks that the CLI can connect to the endpoint on the Divio Control Panel.git
- checks that Git is installed by runninggit --version
.docker-client
checks that the Docker client is available by runningdocker --version
.docker compose
- checks that Docker Compose is available by runningdocker compose --version
.docker-server
- checks that a command can be executed in a container by runningdocker run --rm busybox
.docker-server-ping
- checks that a Docker container has connectivity to the Internet by running:
docker run --rm busybox sh -c "ping -c 1 -w 5 8.8.8.8"
docker-server-dns
- checks that a Docker container can resolve DNS queries by running:
docker run --rm busybox sh -c "timeout 5 nslookup -type=a control.divio.com. || timeout -t 5 nslookup -type=a
control.divio.com."