Skip to main content

Divio CLI

The Divio CLI is a Python-based command line application, and can be installed via pip:

pip install divio-cli

The CLI will run in Python 3.6 to 3.9.

The divio-cli source code is available on GitHub.

Divio CLI configuration

The behaviour of the Divio CLI is managed via a JSON configuration file.

Location of the file

The file is created by the CLI and will be found at either:

  • ~/.config/divio/config.json, or
  • ~/.aldryn (the older location for the file - if this file exists it will take precedence)

File structure

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 running git --version.
  • docker-client checks that the Docker client is available by running docker --version.
  • docker-compose - checks that Docker Compose is available by running docker-compose --version.
  • docker-server - checks that a command can be executed in a container by running docker 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."