Skip to content
/ cli Public

Unified CLI for DHIS 2 development workflows

License

Notifications You must be signed in to change notification settings

dhis2/cli

Repository files navigation

D2 CLI

A unified CLI for DHIS2 development workflows.

dhis2-cli Compatible build Conventional Commits Greenkeeper badge

Docs are available at cli.dhis2.nu.

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
d2 utils cypress d2-utils-cypress @dhis2/cli-utils-cypress dhis2/cli-utils-cypress 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

Conventions

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.