Divio CLI¶
The divio-cli source code is availableon GitHub.
It’s also available:
- in the
- at the bash prompt in Divio Cloud web containers
Important
When using the divio-cli other than in a Divio Shell or web container, you will need toinstall the aldryn-client as well to allow the divio-cli to perform certain operationsrelated to addons. To install:
- pip install aldryn-client
The divio-cli is invoked with the command .
Its syntax is:
|-d, —debug|Drop into the debugger if the command execution raises an exception.
|—help|Show a help message (most commands also include help messages of their own)
Commands¶
addon¶
The addon
command is used when in the directory of a local addon.
It take one of three commands as an argument:
register
- Registers an addon with the Divio Cloud addons system
upload
- Uploads an addon to the Divio Cloud
validate
- Validates basic aspects of an addon’s configuration
backup¶
The backup
command manages project backups.
It take one command as an argument:
decrypt
Decrypts an encrypted backup file.decrypt
takes three arguments:KEY
BACKUP
DESTINATION
.
Example:- divio backup decrypt key backup destination
- divio backup decrypt key backup destination
boilerplate¶
The boilerplate
command is used when in the directory of a localboilerplate.
upload
- Uploads a boilerplate to the Divio Cloud
validate
- Validates basic aspects of an boilerplates’s configuration
doctor¶
The doctor
command checks that your environment is correctly configured.
login¶
Authorise your machine with the Divio Cloud. divio login
opens your browserat https://control.divio.com/account/desktop-app/access-token/, where you cancopy an access token to paste into the prompt.
project¶
The project
command helps manage projects locally and on the Cloud.
Its general syntax is divio project [OPTIONS] COMMAND [ARGS]…
Except where specifically indicated below, the project
command is specificto a particular project and must be executed within an existing projectdirectory.
cheatsheet
- Opens the project’s cheatsheet page in the Control Panel.
dashboard
- Opens the project’s Dashboard in the Control Panel.
deploy
Deploys the project’s Test or Live servers.deploy
takes orlive
as an argument, for example:
Options:
|—backup|Take a backup before deployingdeploy-log
Returns the latest deployment log for the project’s Test or Live servers.deploy-log
takestest
orlive
as an argument, for example:
develop
Adds a package in development to the project.
Usage:divio project develop [OPTIONS] PACKAGE
, wherePACKAGE
isthe name of the addon package.
Options:
|—no-rebuild|Don’t rebuild the Docker container
Note
Whatdivio project develop <addon>
actually does is:
- checks addons-dev for the named addon
- puts the addon on the Python path
- adds the addon to requirements.in, as -e
/app/addons-dev/tutorial-django-debug-toolbar
- adds any dependencies
- runs docker-compose build web.
env-vars
Get and set environment variables. Bydefault, these operations work on the Test server (e.g.divio project
will be applied to the Test server,and will appear there).
env-vars —set SOMEKEY somevalue
Note that this command applies only to the Live and Test servers, not the local server. See .
Usage:divio project env-vars [OPTIONS]
Options:
|-s, —stage TEXT
| |Get data from sever (test
orlive
)
|—all, —custom
| |Show all or only custom (the default) variables
|—json|Use JSON output
|—get|Get a specific environment variable (get VARIABLE
)
|—set|Set a specific custom environment variable (set VARIABLE VALUE
)
|—unset|Unset an environment variable (unset VARIABLE
)
|—help|Show a help messageexport
Exports the local database tolocaldb.sql
.
Usage:divio project export db
import
Imports a database dump file into the local database.
Usage:divio project import db [path]
If the argument is not supplied, it will expect a filelocal_db.sql
.list
Lists your Divio Cloud projects.
_Not specific to a particular project.live
- Opens the project’s Live site in the browser.
open
- Open the local project’s site in the browser.
pull
Pulls the database or media files from the Divio Cloud.
Takes a required argument,db
ormedia
, followed optionally bytest
orlive
(if not specified, defaults totest
), and by—remote-id <project id>
to pull from another project.
push
Pushes the database or media files to the Divio Cloud.
Takes a required argument,db
ormedia
, followed optionally bytest
orlive
(if not specified, defaults totest
), and by—remote-id <project id>
to push to another project.setup
Replicates and builds a Divio Cloud project locally.
Takes a single argument, the slug of the project.
Can be run outside a project folder.status
- Shows the status of the local project, shutting down its containers.
stop
- Stops the local project (if it is running).
test
- Opens the project’s Test site in the browser.
- Starts up the local project.
update
Updates the local project with new code changes from the Cloud, then builds it. Runs:- git pull
docker-compose pull
docker-compose build
docker-compose run web start migrate
- git pull
version¶
Returns version information about the divio-cli.