Skip to content
A unified CLI for DHIS 2 development workflows.
JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.eslintrc.js chore: prepare 2.0 of d2 (#100) Jul 15, 2019
.huskyrc.js feat(cluster): add option to pass in path to custom dhis.conf (#236) Jan 9, 2020
yarn.lock chore(deps): bump @dhis2/cli-app-scripts from 3.2.1 to 3.2.2 (#256) Jan 20, 2020


A unified CLI for DHIS2 development workflows.

dhis2-cli Compatible build Conventional Commits Greenkeeper badge

Docs are available at

Alias Executable Package Source Version
d2 d2 @dhis2/cli ./packages/main npm
d2 app d2-app @dhis2/cli-app ./packages/app npm
d2 app scripts d2-app-scripts @dhis2/cli-app-scripts dhis2/app-platform npm
d2 cluster d2-cluster @dhis2/cli-cluster ./packages/cluster npm
d2 create d2-create @dhis2/cli-create ./packages/create npm
d2 create app d2-create-app @dhis2/create-app ./packages/create-app npm
d2 style d2-style @dhis2/cli-style dhis2/cli-style npm
d2 utils d2-utils @dhis2/cli-utils ./packages/utils npm
d2 utils docsite d2-utils-docsite @dhis2/cli-utils-docsite dhis2/cli-utils-docsite npm
@dhis2/cli-helpers-engine dhis2/cli-helpers-engine npm
@dhis2/cli-helpers-template dhis2/cli-helpers-template npm

Installation and Usage

See the main entrypoint package for end-user installation and usage instructions


The d2 command-line tool is structured as a collection of namespaces, each of which may include sub-namespaces and sub-commands. This heirarchy should follow one simple rule:

namespaces are nouns, commands are verbs

Each subsequent namespace should narrow the context in which a command (an action) will be performed. For example:

  • d2 cluster restart performs the action restart in the d2 cluster namespace
  • d2 style js apply performs the apply action in the js sub-namespace of the d2 style namespace

Anything following the action verb is either a positional argument or a flag (if preceded by - or --), i.e.:

  • d2 style js apply --all --no-stage tells the apply action to run on all files and not to stage the changes in git
  • d2 cluster restart dev gateway passes the arguments dev and gateway to the restart action, which tells the action which service to restart.
You can’t perform that action at this time.