Skip to content

D2 CLI

A unified CLI for DHIS2 development workflows.

dhis2-cli CompatiblebuildConventional Commits

Installation and Usage

See the documentation site 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 hierarchy 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.

CLI Modules

AliasExecutablePackageSourceVersion
d2d2@dhis2/cli./packages/mainnpm
d2 appd2-app@dhis2/cli-app./packages/appnpm
d2 app scriptsd2-app-scripts@dhis2/cli-app-scriptsdhis2/app-platformnpm
d2 clusterd2-cluster@dhis2/cli-cluster./packages/clusternpm
d2 created2-create@dhis2/cli-create./packages/createnpm
d2 create appd2-create-app@dhis2/create-app./packages/create-appnpm
d2 styled2-style@dhis2/cli-styledhis2/cli-stylenpm
d2 utilsd2-utils@dhis2/cli-utils./packages/utilsnpm
d2 utils docsited2-utils-docsite@dhis2/cli-utils-docsitedhis2/cli-utils-docsitenpm
d2 utils cypressd2-utils-cypress@dhis2/cli-utils-cypressdhis2/cli-utils-cypressnpm
d2 utils codemodsd2-utils-codemods@dhis2/cli-utils-codemodsdhis2/cli-utils-codemodsnpm
@dhis2/cli-helpers-enginedhis2/cli-helpers-enginenpm
@dhis2/cli-helpers-templatedhis2/cli-helpers-templatenpm

Report an issue

The issue tracker can be found in DHIS2 JIRA under the CLI project.

Deep links:

About

Unified CLI for DHIS 2 development workflows

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

15 stars

Watchers

22 watching

Forks

Releases

Packages

Used by

Contributors

Languages