Divio Shell Required

About the client

The Divio CLI is written in Python. It’s an open-source tool, available from its GitHub repository.

Installation

The client is available via pip, so the easiest way to install it is simply:

pip install divio-cli

See the installation guidance for more help with installation if you run into trouble (or see the guidance for Windows users).

Usage

Environment-related commands

divio doctor

Checks your set-up to confirm that all is well with:

  • your Git client (required to communicate with the Git server on Divio)
  • the Docker client (required to communicate with the Docker server running locally)
  • the connection to the Docker server
  • docker-compose (required to manage the Docker containers)

Expected output:

Verifying your system setup
✓ git client
✓ docker client
✓ docker server connection
✓ docker-compose
divio login

Authenticates you to the Divio Cloud platform. The login command opens your browser at https://control.divio.com/account/desktop-app/access-token/,  where you can obtain an access token for identification purposes.

Project-related commands

All project-related commands take the form divio project <sub-command>.

Commands that can be run outside a project directory

divio project list

Lists your projects on the Divio Cloud platform.

Typical output:

Slug         Name         Organisation
------------ ------------ ---------------
acme-website ACME Website ACME

The output of divio project list is piped through less, so you can scroll up and down through it, and leave it with q for ‘quit’.

divio project setup <project>

Pulls down and builds one of your projects (for example, divio project setup acme-website).

The project will be created in a new directory with the same name as the project. setup only needs to be run once.

Commands that must be run within a project directory

These commands all act on a particular project, and must be executed from within that project’s directory locally.

status

Reports on the current state of a project. Each project will have two associated Docker containers, one for the web server and one for the database. For each container, it will list:

  • its name
  • the command it's running
  • its state
  • its ports
divio project up
  • starts the Docker containers, if not already started
  • starts the Django server, if not already started
  • opens your web-browser at the home page of your locally-served site
divio project stop

stop is roughly the opposite of up, and stops the Docker containers if they’re running.

divio project push db, divio project pull db

Push and pull database changes to and from Divio Cloud.

By default, these use the test server; to pull/push against live, add live .

Before pushing to Divio Cloud, you should make a backup of the database using Manage Project in the Divio Control Panel.

divio project push media, divio project pull media

Push and pull media file changes to and from Divio Cloud.
By default, these use the test server; to pull/push against live, add live .

Before pushing to Divio Cloud, you should make a backup of the files using Manage Project in the Divio Control Panel.

divio project update

Updates your local project directory with all code changes from Divio Cloud.

divio project cheatsheet

Opens the cheatsheet of useful commands for your project on the Divio Control Panel.

divio project dashboard

Opens the project’s dashboard on the Divio Control Panel.

divio project live, divio project test

Open the project’s live and test sites on Divio Cloud.

divio project open

Opens a browser window with the locally-running project.

divio project deploy

Deploys the test server of your project.

divio project develop <package>

Install a package package from the addons-dev directory to your local project, and rebuild the web container. develop is the local equivalent of installing an Addon on Divio Cloud, then redeploying the Test server.

Addon-related commands

divio project validate

Checks an Addon for validity. Note that it only checks that some basic configuration is in place; it cannot detect whether the Addon’s code works well, or even if the Addon will actually work at all.

Did this answer your question?