CLI reference¶
dhis2 — command-line interface for DHIS2 (discovers plugins from dhis2w-core).
Usage:
Options:
-p, --profile TEXT: DHIS2 profile name (overrides DHIS2_PROFILE env + TOML default).-d, --debug: Verbose output on stderr — HTTP method/URL/status/elapsed for every request.-j, --json: Emit raw JSON to stdout instead of Rich tables (uniform across all commands).--help: Show this message and exit.
Commands:
analytics: DHIS2 analytics queries.apps: DHIS2 apps — /api/apps + /api/appHub.browser: Playwright-driven DHIS2 UI automation.data: DHIS2 data values (aggregate + tracker).dev: Developer/operator tools.doctor: Probe a DHIS2 instance for known gotchas +...files: Manage DHIS2 documents + file resources.maintenance: DHIS2 maintenance (tasks, cache,...messaging: DHIS2 internal messaging.metadata: DHIS2 metadata inspection.profile: Manage DHIS2 profiles.route: DHIS2 integration routes.system: DHIS2 system info.user: DHIS2 user administration.user-group: DHIS2 user-group administration.user-role: DHIS2 user-role administration.
dhis2 analytics¶
DHIS2 analytics queries.
Usage:
Options:
--help: Show this message and exit.
Commands:
query: Run an analytics query.outlier-detection: Run/api/analytics/outlierDetection—...events: Event analytics — line-lists events or...enrollments: Enrollment analytics — line-lists...tracked-entities: Tracked-entity analytics — line-list TEs...
dhis2 analytics query¶
Run an analytics query. Use --shape to pick table, raw, or dvs.
Usage:
Options:
--dimension, --dim TEXT: Dimension string (repeatable), e.g. dx:UID, pe:LAST_12_MONTHS, ou:UID. [required]--shape TEXT: Response shape:table(default, aggregated),raw(/api/analytics/rawData),dvs(/api/analytics/dataValueSet — DataValueSet shape). [default: table]--filter TEXT: Filter string (repeatable), same syntax as --dimension.--agg TEXT: SUM | AVERAGE | COUNT | MIN | MAX | AVERAGE_SUM_ORG_UNIT ...--output-id-scheme TEXT: UID | NAME | CODE | ID — how UIDs appear in the response--num-den / --no-num-den: Include indicator numerator/denominator columns. [default: no-num-den]--display-property TEXT: NAME | SHORTNAME — which label to render metadata with.--start-date TEXT--end-date TEXT--skip-meta--help: Show this message and exit.
dhis2 analytics outlier-detection¶
Run /api/analytics/outlierDetection — flag statistical anomalies in data values.
Usage:
Options:
--data-element, --de TEXT: Data-element UID (repeatable).--data-set, --ds TEXT: Data-set UID (repeatable) — expanded to its dataElements.--org-unit, --ou TEXT: Org-unit UID (repeatable).--period, --pe TEXT: Period identifier (e.g. LAST_12_MONTHS, 202401).--start-date TEXT: ISO date YYYY-MM-DD.--end-date TEXT: ISO date YYYY-MM-DD.--algorithm TEXT: Z_SCORE (default) | MODIFIED_Z_SCORE | MIN_MAX. (Upstream OAS still shows MOD_Z_SCORE but the server rejects that value — see BUGS.md.)--threshold FLOAT: Standard-deviation cutoff (default 3.0).--max-results INTEGER: Cap the number of outliers returned (default 500).--order-by TEXT: ABS_DEV | STANDARD_DEVIATION | Z_SCORE | ...--sort-order TEXT: ASC | DESC.--help: Show this message and exit.
dhis2 analytics events¶
Event analytics — line-lists events or aggregates them.
Usage:
Options:
--help: Show this message and exit.
Commands:
query: Run an event analytics query...
dhis2 analytics events query¶
Run an event analytics query (/api/analytics/events/{mode}/{program}).
Usage:
Arguments:
PROGRAM: Program UID. [required]
Options:
--mode TEXT:query(line-listed events) oraggregate(grouped counts). [default: query]--dimension, --dim TEXT: Dimension string (repeatable), e.g. pe:LAST_12_MONTHS, ou:UID.--filter TEXT: Filter string (repeatable), same syntax as --dimension.--stage TEXT: Program stage UID to narrow events.--output-type TEXT: EVENT | ENROLLMENT | TRACKED_ENTITY_INSTANCE (row shape).--start-date TEXT--end-date TEXT--skip-meta--page INTEGER--page-size INTEGER--help: Show this message and exit.
dhis2 analytics enrollments¶
Enrollment analytics — line-lists enrollments.
Usage:
Options:
--help: Show this message and exit.
Commands:
query: Run an enrollment analytics query...
dhis2 analytics enrollments query¶
Run an enrollment analytics query (/api/analytics/enrollments/query/{program}).
Usage:
Arguments:
PROGRAM: Program UID. [required]
Options:
--dimension, --dim TEXT: Dimension string (repeatable).--filter TEXT: Filter string (repeatable).--start-date TEXT--end-date TEXT--skip-meta--page INTEGER--page-size INTEGER--help: Show this message and exit.
dhis2 analytics tracked-entities¶
Tracked-entity analytics — line-list TEs for a given type.
Usage:
Options:
--help: Show this message and exit.
Commands:
query: Line-list tracked entities via...
dhis2 analytics tracked-entities query¶
Line-list tracked entities via /api/analytics/trackedEntities/query/{TET_UID}.
Usage:
Arguments:
TRACKED_ENTITY_TYPE: TrackedEntityType UID. [required]
Options:
--dimension, --dim TEXT: Dimension string (repeatable).--filter TEXT: Filter string (repeatable).--program TEXT: Program UID (repeatable) to narrow results.--start-date TEXT--end-date TEXT--ou-mode TEXT: SELECTED | CHILDREN | DESCENDANTS | ACCESSIBLE | ALL (default SELECTED).--display-property TEXT: NAME | SHORTNAME.--skip-meta--skip-data--include-metadata-details: Include nested objects in the metaData map.--page INTEGER--page-size INTEGER--asc TEXT: Field to sort ascending (repeatable).--desc TEXT: Field to sort descending (repeatable).--help: Show this message and exit.
dhis2 apps¶
DHIS2 apps — /api/apps + /api/appHub.
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every installed app (GET /api/apps).list: List every installed app (GET /api/apps).add: Install an app from a local zip or an App...rm: Uninstall an app by key (`DELETE...remove: Uninstall an app by key (`DELETE...update: Update one app or every installed app to...reload: Ask DHIS2 to re-read every app from disk...restore: Reinstall every hub-backed entry from a...snapshot: Capture every installed app into a...hub-list: List apps available in the configured App...hub-url: Read or write DHIS2's configured App Hub...
dhis2 apps ls¶
List every installed app (GET /api/apps).
Usage:
Options:
--help: Show this message and exit.
dhis2 apps list¶
List every installed app (GET /api/apps).
Usage:
Options:
--help: Show this message and exit.
dhis2 apps add¶
Install an app from a local zip or an App Hub version id.
Auto-dispatches based on whether source is an existing file on disk:
file → multipart upload to /api/apps; otherwise → POST to
/api/appHub/{source}. DHIS2 overwrites an existing install of the
same app in both paths.
Usage:
Arguments:
SOURCE: Either a path to a local.zip(installs via /api/apps) or an App Hub version id (installs via /api/appHub/{versionId}). [required]
Options:
--help: Show this message and exit.
dhis2 apps rm¶
Uninstall an app by key (DELETE /api/apps/{key}).
Usage:
Arguments:
KEY: App key (folder name) fromapps list. [required]
Options:
-y, --yes: Skip the confirmation prompt.--help: Show this message and exit.
dhis2 apps remove¶
Uninstall an app by key (DELETE /api/apps/{key}).
Usage:
Arguments:
KEY: App key (folder name) fromapps list. [required]
Options:
-y, --yes: Skip the confirmation prompt.--help: Show this message and exit.
dhis2 apps update¶
Update one app or every installed app to its latest App Hub version.
Apps without an app_hub_id (typically side-loaded zips) are reported
as SKIPPED — they're not installable via the hub. Bundled core apps
(bundled=True) still carry an app_hub_id and can be updated in
place, so they're treated like any other hub-updatable app. With
--dry-run, every available update prints as
AVAILABLE and no install call is made, so you can preview the delta
first.
Usage:
Arguments:
[KEY]: App key; omit with --all to update every app.
Options:
--all: Update every installed app.--dry-run: Show what would change without installing — report the newer hub version for every app with an update available, tagged AVAILABLE.--help: Show this message and exit.
dhis2 apps reload¶
Ask DHIS2 to re-read every app from disk (PUT /api/apps).
Usage:
Options:
--help: Show this message and exit.
dhis2 apps restore¶
Reinstall every hub-backed entry from a snapshot JSON.
The flip side of dhis2 apps snapshot. Reads the JSON produced by
snapshot, walks each entry, and calls /api/appHub/{versionId}
for every app whose hub_version_id is set and whose currently
installed version differs from the snapshot's. Side-loaded entries
(no hub_version_id) report as SKIPPED — the snapshot doesn't
carry their zips.
Usage:
Arguments:
MANIFEST: Path to a snapshot JSON file produced bydhis2 apps snapshot. [required]
Options:
--dry-run: Show what would install without running the /api/appHub POSTs — entries that would install are tagged AVAILABLE.--help: Show this message and exit.
dhis2 apps snapshot¶
Capture every installed app into a portable JSON snapshot.
One entry per installed app — key, name, version, app_hub_id, and
(when the app came from the App Hub) the hub versionId +
downloadUrl needed to re-install it on another instance. Apps
without an app_hub_id are captured as source=side-loaded; they
appear in the snapshot but can't be rehydrated without their zip.
Useful as a "pin my apps catalog at this point in time" operation — diff two snapshots to see drift, or re-apply on staging after a bulk-install on production.
Usage:
Options:
-o, --output PATH: Write the snapshot JSON to this file. Omit to print to stdout.--help: Show this message and exit.
dhis2 apps hub-list¶
List apps available in the configured App Hub (GET /api/appHub).
Pass --search <query> to filter the catalog by app name or
description substring. The filter runs client-side — DHIS2's
/api/appHub proxy doesn't expose a server-side query parameter
on v42, so the full catalog is fetched and filtered after.
Usage:
Options:
-s, --search TEXT: Case-insensitive substring filter on name + description (client-side).--limit INTEGER: Cap the number of rows shown. [default: 50]--help: Show this message and exit.
dhis2 apps hub-url¶
Read or write DHIS2's configured App Hub URL (keyAppHubUrl system setting).
The App Hub is open source (https://github.com/dhis2/app-hub); teams
running a self-hosted hub can point DHIS2 at it by setting this.
Pass --set <url> to update, --clear to revert to DHIS2's
hard-coded default (typically https://apps.dhis2.org/api).
Usage:
Options:
--set TEXT: Point this DHIS2 instance at a different App Hub (writes thekeyAppHubUrlsystem setting).--clear: Clear thekeyAppHubUrlsetting so DHIS2 reverts to its default hub.--help: Show this message and exit.
dhis2 browser¶
Playwright-driven DHIS2 UI automation.
Usage:
Options:
--help: Show this message and exit.
Commands:
pat: Mint a Personal Access Token V2 via...dashboard: Dashboard capture workflows.viz: Visualization capture workflows.map: Map capture workflows.
dhis2 browser pat¶
Mint a Personal Access Token V2 via Playwright and print the token value to stdout.
DHIS2 only returns the token value once, at creation — store it somewhere
persistent immediately. Subsequent GET /api/apiToken/{id} calls return
metadata but not the secret.
Usage:
Options:
--url TEXT: Base URL of the DHIS2 instance. [required]--username TEXT: Login username. [required]--password TEXT: Login password. [required]--name TEXT: Friendly display name for the token.--expires-in-days INTEGER: Token lifetime in days; omit for no expiry.--allowed-ip TEXT: CIDR/IP allowlist entry; repeat for multiple.--allowed-method TEXT: HTTP method allowlist; repeat for each method.--allowed-referrer TEXT: Referer URL allowlist; repeat for each.--headless / --headful: Run browser headlessly (default: visible, so you can watch the flow). [default: headful]--help: Show this message and exit.
dhis2 browser dashboard¶
Dashboard capture workflows.
Usage:
Options:
--help: Show this message and exit.
Commands:
screenshot: Capture full-page PNGs of every DHIS2...
dhis2 browser dashboard screenshot¶
Capture full-page PNGs of every DHIS2 dashboard (or just the ones named via --only).
Shares a single Playwright context across dashboards — one login, one dashboard-app load, then hash-only navigation between dashboards. The capture loop waits for each item's plugin iframe to render substantial content (canvas / svg / leaflet / highcharts / img / long text) with a plateau detector so one stuck item doesn't stall the batch.
Usage:
Options:
-o, --output-dir PATH: Directory for the PNG output. Defaults to./screenshots. Each run auto-creates an{instance-slug}/subdirectory keyed on the profile's base URL so multi-stack captures don't overwrite.--only TEXT: Capture only these dashboard UIDs; repeat for multiple.--headless / --headful: Run browser headlessly (default: yes — automation-friendly). [default: headless]--banner / --no-banner: Prepend an info banner (instance / user / timestamp) to each PNG. [default: banner]--trim / --no-trim: Crop uniform-colour edges off the bottom + right of each PNG. [default: trim]--help: Show this message and exit.
dhis2 browser viz¶
Visualization capture workflows.
Usage:
Options:
--help: Show this message and exit.
Commands:
screenshot: Capture a PNG of each Visualization (or...
dhis2 browser viz screenshot¶
Capture a PNG of each Visualization (or just the UIDs named via --only).
Each capture navigates the DHIS2 Data Visualizer app
(/dhis-web-data-visualizer/#/<uid>) inside a shared Playwright
context — one login, one app-shell load, hash-only navigation
between vizes. Renders wait for the chart to materialise (SVG /
canvas / pivot table / long text) with a plateau detector so one
stuck viz doesn't stall the batch.
DHIS2 has no native /api/visualizations/{uid}.png endpoint, so
every PNG goes through Chromium. Install the extra via
uv add 'dhis2w-cli' + playwright install
chromium first.
Usage:
Options:
-o, --output-dir PATH: Directory for the PNG output. Defaults to./screenshots. Each run auto-creates an{instance-slug}/subdirectory keyed on the profile's base URL so multi-stack captures don't overwrite.--only TEXT: Capture only these Visualization UIDs; repeat for multiple.--headless / --headful: Run browser headlessly (default: yes — automation-friendly). [default: headless]--banner / --no-banner: Prepend an info banner (name / type / instance / user / timestamp) to each PNG. [default: banner]--trim / --no-trim: Crop uniform-colour edges off the bottom + right of each PNG. [default: trim]--help: Show this message and exit.
dhis2 browser map¶
Map capture workflows.
Usage:
Options:
--help: Show this message and exit.
Commands:
screenshot: Capture a PNG of each Map (or the UIDs...
dhis2 browser map screenshot¶
Capture a PNG of each Map (or the UIDs named via --only).
Navigates the DHIS2 Maps app (/dhis-web-maps/#/<uid>) in a shared
Playwright context — one login, one app-shell load, hash-nav between
maps. Waits for MapLibre canvas + vector overlays to render before
snapping. Requires the ` extra (install withuv add 'dhis2w-cli'+playwright install chromium`).
Usage:
Options:
-o, --output-dir PATH: Directory for the PNG output. Defaults to./screenshots. Each run auto-creates an{instance-slug}/subdirectory keyed on the profile's base URL so multi-stack captures don't overwrite.--only TEXT: Capture only these Map UIDs; repeat for multiple.--headless / --headful: Run browser headlessly (default: yes — automation-friendly). [default: headless]--banner / --no-banner: Prepend an info banner (name / layer count / instance / user / timestamp) to each PNG. [default: banner]--trim / --no-trim: Crop uniform-colour edges off the bottom + right of each PNG. [default: trim]--help: Show this message and exit.
dhis2 data¶
DHIS2 data values (aggregate + tracker).
Usage:
Options:
--help: Show this message and exit.
Commands:
aggregate: Aggregate data values (dataValueSets).tracker: Tracker (entities, enrollments, events,...
dhis2 data aggregate¶
Aggregate data values (dataValueSets).
Usage:
Options:
--help: Show this message and exit.
Commands:
get: Fetch a data value set.push: Bulk push data values from a JSON file.set: Set a single data value.delete: Delete a single data value.
dhis2 data aggregate get¶
Fetch a data value set.
Usage:
Options:
--data-set, --ds TEXT: DataSet UID.--period, --pe TEXT: Period (e.g. 202401, 2024W12, 2024).--start-date TEXT: ISO date (YYYY-MM-DD).--end-date TEXT: ISO date (YYYY-MM-DD).--org-unit, --ou TEXT: OrganisationUnit UID.--children: Include descendants of org_unit.--data-element-group, --deg TEXT: DataElementGroup UID (narrows to its member DEs).--limit INTEGER: Max rows to include in output.--help: Show this message and exit.
dhis2 data aggregate push¶
Bulk push data values from a JSON file.
Usage:
Arguments:
FILE: Path to a JSON file containing a dataValues array or envelope. [required]
Options:
--data-set, --ds TEXT--period, --pe TEXT--org-unit, --ou TEXT--dry-run--strategy TEXT: CREATE | UPDATE | CREATE_AND_UPDATE | DELETE--help: Show this message and exit.
dhis2 data aggregate set¶
Set a single data value.
Usage:
Options:
--data-element, --de TEXT: DataElement UID. [required]--period, --pe TEXT: Period (e.g. 202401). [required]--org-unit, --ou TEXT: OrganisationUnit UID. [required]--value TEXT: The value to set (as a string). [required]--coc TEXT: CategoryOptionCombo UID.--aoc TEXT: AttributeOptionCombo UID (category-combo attributes).--comment TEXT--help: Show this message and exit.
dhis2 data aggregate delete¶
Delete a single data value.
Usage:
Options:
--data-element, --de TEXT: [required]--period, --pe TEXT: [required]--org-unit, --ou TEXT: [required]--coc TEXT--aoc TEXT--help: Show this message and exit.
dhis2 data tracker¶
Tracker (entities, enrollments, events, relationships).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List tracked entities of the given...list: List tracked entities of the given...get: Fetch one tracked entity by UID...type: List every configured TrackedEntityType on...push: Bulk import via POST /api/tracker.register: Register a tracked entity + enroll in one...outstanding: List ACTIVE enrollments missing events on...enrollment: Enrollments.event: Events.relationship: Relationships.
dhis2 data tracker ls¶
List tracked entities of the given TrackedEntityType (name or UID).
Usage:
Arguments:
TYPE: TrackedEntityType name (case-insensitive) or UID — e.g. 'Person', 'Patient', or 'tet01234567'. [required]
Options:
--program TEXT: Optional program UID to further scope the listing.--te-uids TEXT: Comma-separated tracked-entity UIDs to fetch directly.--org-unit, --ou TEXT--ou-mode TEXT: [default: DESCENDANTS]--fields TEXT--filter TEXT--page-size INTEGER: [default: 50]--page INTEGER: 1-based page number.--updated-after TEXT: ISO-8601 cutoff — only entities updated after this.--help: Show this message and exit.
dhis2 data tracker list¶
List tracked entities of the given TrackedEntityType (name or UID).
Usage:
Arguments:
TYPE: TrackedEntityType name (case-insensitive) or UID — e.g. 'Person', 'Patient', or 'tet01234567'. [required]
Options:
--program TEXT: Optional program UID to further scope the listing.--te-uids TEXT: Comma-separated tracked-entity UIDs to fetch directly.--org-unit, --ou TEXT--ou-mode TEXT: [default: DESCENDANTS]--fields TEXT--filter TEXT--page-size INTEGER: [default: 50]--page INTEGER: 1-based page number.--updated-after TEXT: ISO-8601 cutoff — only entities updated after this.--help: Show this message and exit.
dhis2 data tracker get¶
Fetch one tracked entity by UID (TrackedEntityType inferred from the entity).
Usage:
Arguments:
UID: Tracked entity UID. [required]
Options:
--program TEXT--fields TEXT--help: Show this message and exit.
dhis2 data tracker type¶
List every configured TrackedEntityType on the connected instance (name + UID).
The list and get commands accept either a name or a UID in their <type>
positional — run this first to see what's configured.
Usage:
Options:
--help: Show this message and exit.
dhis2 data tracker push¶
Bulk import via POST /api/tracker.
Usage:
Arguments:
FILE: JSON file containing the tracker bundle. [required]
Options:
--strategy TEXT: CREATE | UPDATE | CREATE_AND_UPDATE | DELETE--atomic TEXT: ALL | OBJECT--dry-run--async--help: Show this message and exit.
dhis2 data tracker register¶
Register a tracked entity + enroll in one program in one call.
The typical clinic-intake flow: fills the TrackedEntityAttribute form, stamps an enrollment into the program, all atomic via POST /api/tracker. Prints the new tracked-entity + enrollment UIDs so the caller can reference them downstream.
Usage:
Arguments:
PROGRAM: Program UID to enroll into. [required]
Options:
--org-unit, --ou TEXT: OrgUnit UID where the TE lives + is enrolled. [required]--tet TEXT: TrackedEntityType UID. Defaults to the program's trackedEntityType if unset.--attr TEXT: TrackedEntityAttribute UID=value. Repeatable. Example: --attr w75KJ2mc4zz=Jane--enrolled-at TEXT: Enrollment date (ISO, e.g. 2024-06-01). Defaults to today server-side.--help: Show this message and exit.
dhis2 data tracker outstanding¶
List ACTIVE enrollments missing events on any non-repeatable program stage.
Renders each hit with its tracked-entity UID, OU, and the program-stage UIDs that still need an event. A "what's due" report for tracker follow-ups.
"Required" here means repeatable=false on the program stage —
repeatable stages (weekly checkups, periodic screenings) don't have
a single outstanding semantic and are skipped.
Usage:
Arguments:
PROGRAM: Program UID — the scope for the 'what's due' report. [required]
Options:
--org-unit, --ou TEXT: Narrow to one OU subtree. Default: every active enrollment on the program.--ou-mode TEXT: SELECTED | CHILDREN | DESCENDANTS | ALL [default: DESCENDANTS]--page-size INTEGER: Max enrollments scanned (default 200). [default: 200]--help: Show this message and exit.
dhis2 data tracker enrollment¶
Enrollments.
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List enrollments (tracker programs only).list: List enrollments (tracker programs only).create: Enroll an existing tracked entity in a...
dhis2 data tracker enrollment ls¶
List enrollments (tracker programs only).
Usage:
Options:
--program TEXT--org-unit, --ou TEXT--ou-mode TEXT: [default: DESCENDANTS]--te TEXT--status TEXT: ACTIVE | COMPLETED | CANCELLED--fields TEXT--page-size INTEGER: [default: 50]--page INTEGER--updated-after TEXT--help: Show this message and exit.
dhis2 data tracker enrollment list¶
List enrollments (tracker programs only).
Usage:
Options:
--program TEXT--org-unit, --ou TEXT--ou-mode TEXT: [default: DESCENDANTS]--te TEXT--status TEXT: ACTIVE | COMPLETED | CANCELLED--fields TEXT--page-size INTEGER: [default: 50]--page INTEGER--updated-after TEXT--help: Show this message and exit.
dhis2 data tracker enrollment create¶
Enroll an existing tracked entity in a program.
Usage:
Arguments:
TRACKED_ENTITY: Existing TrackedEntity UID to enroll. [required]PROGRAM: Program UID to enroll into. [required]
Options:
--at TEXT: OrgUnit UID where the enrollment lives. [required]--enrolled-at TEXT: ISO date; defaults to today server-side.--help: Show this message and exit.
dhis2 data tracker event¶
Events.
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List events (works with both event and...list: List events (works with both event and...create: Add one event — tracker (with enrollment)...
dhis2 data tracker event ls¶
List events (works with both event and tracker programs).
Usage:
Options:
--program TEXT--program-stage TEXT--org-unit, --ou TEXT--ou-mode TEXT: [default: DESCENDANTS]--te TEXT--enrollment TEXT--status TEXT--after TEXT--before TEXT--fields TEXT--page-size INTEGER: [default: 50]--page INTEGER--help: Show this message and exit.
dhis2 data tracker event list¶
List events (works with both event and tracker programs).
Usage:
Options:
--program TEXT--program-stage TEXT--org-unit, --ou TEXT--ou-mode TEXT: [default: DESCENDANTS]--te TEXT--enrollment TEXT--status TEXT--after TEXT--before TEXT--fields TEXT--page-size INTEGER: [default: 50]--page INTEGER--help: Show this message and exit.
dhis2 data tracker event create¶
Add one event — tracker (with enrollment) or event-only (standalone).
For tracker programs, pass --enrollment (the event binds to the enrollment's timeline). For event programs (WITHOUT_REGISTRATION — community surveys, case-investigation forms), omit --enrollment; the event stands alone, scoped by program + stage + org unit.
Usage:
Options:
--program TEXT: Program UID. [required]--stage TEXT: ProgramStage UID. [required]--at TEXT: OrgUnit UID where the event happened. [required]--enrollment TEXT: Enrollment UID for tracker (WITH_REGISTRATION) programs. Omit for event (WITHOUT_REGISTRATION) programs.--te TEXT: TrackedEntity UID (tracker programs only). Optional — DHIS2 derives from the enrollment.--dv TEXT: DataElement UID=value. Repeatable. Example: --dv fClA2Erf6IO=5--occurred-at TEXT: ISO event date; defaults to today server-side.--help: Show this message and exit.
dhis2 data tracker relationship¶
Relationships.
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List relationships (one of...list: List relationships (one of...
dhis2 data tracker relationship ls¶
List relationships (one of --te/--enrollment/--event required).
Usage:
Options:
--te TEXT--enrollment TEXT--event TEXT--fields TEXT--page-size INTEGER: [default: 50]--help: Show this message and exit.
dhis2 data tracker relationship list¶
List relationships (one of --te/--enrollment/--event required).
Usage:
Options:
--te TEXT--enrollment TEXT--event TEXT--fields TEXT--page-size INTEGER: [default: 50]--help: Show this message and exit.
dhis2 dev¶
Developer/operator tools.
Usage:
Options:
--help: Show this message and exit.
Commands:
codegen: Generate version-aware DHIS2 client code...uid: Generate 11-char DHIS2 UIDs.pat: Personal Access Tokens — provision PATs on...oauth2: Manage DHIS2 OAuth2 clients on the server...sample: Inject known-good fixtures to verify the...customize: Brand + theme a DHIS2 instance (logos,...
dhis2 dev codegen¶
Generate version-aware DHIS2 client code from /api/schemas.
Usage:
Options:
--help: Show this message and exit.
Commands:
generate: Generate the client for the DHIS2 version...rebuild: Regenerate the client from saved...oas-rebuild: Emit OpenAPI-derived pydantic models into...diff: Diff two committedschemas_manifest.json...
dhis2 dev codegen generate¶
Generate the client for the DHIS2 version reported by --url.
Usage:
Options:
--url TEXT: Base URL of the DHIS2 instance. [required]--username TEXT: Basic-auth username.--password TEXT: Basic-auth password.--pat TEXT: Personal Access Token.--output-root PATH: Directory containing versioned subfolders; defaults to dhis2w-client's generated/ folder.--help: Show this message and exit.
dhis2 dev codegen rebuild¶
Regenerate the client from saved schemas_manifest.json files (no network).
Useful after touching emit.py / templates when you want every committed
version refreshed without spinning up a live DHIS2 for each. If --manifest
is omitted, walks the output root and rebuilds each version whose
schemas_manifest.json is checked in.
Usage:
Options:
--manifest PATH: Path to a committed schemas_manifest.json. Defaults to every version under the generated root.--output-root PATH: Directory of versioned subfolders; defaults to dhis2w-client generated/.--help: Show this message and exit.
dhis2 dev codegen oas-rebuild¶
Emit OpenAPI-derived pydantic models into generated/v{N}/oas/.
Reads the committed openapi.json + schemas_manifest.json from each
version directory (no network). Output lands alongside the /api/schemas
emitter's output under schemas/.
Usage:
Options:
--version TEXT: Version key (e.g. v42). Defaults to every committed version.--output-root PATH: Directory of versioned subfolders; defaults to dhis2w-client generated/.--help: Show this message and exit.
dhis2 dev codegen diff¶
Diff two committed schemas_manifest.json files and report drift.
Lists schemas added, removed, and per-property changes (type, klass, bounds, owner/required/etc). Useful for spotting upstream API drift when bumping DHIS2 majors.
Usage:
Arguments:
FROM_VERSION: Source version key (e.g. v42). [required]TO_VERSION: Target version key (e.g. v43). [required]
Options:
--output-root PATH: Directory of versioned subfolders; defaults to dhis2w-client generated/.--json: Emit a JSON dump instead of the human-readable report.--help: Show this message and exit.
dhis2 dev uid¶
Generate 11-char DHIS2 UIDs.
Usage:
Options:
-n, --count INTEGER RANGE: How many UIDs to generate. [default: 1; 1<=x<=10000]--help: Show this message and exit.
dhis2 dev pat¶
Personal Access Tokens — provision PATs on DHIS2.
Usage:
Options:
--help: Show this message and exit.
Commands:
create: Create a DHIS2 Personal Access Token via...
dhis2 dev pat create¶
Create a DHIS2 Personal Access Token via POST /api/apiToken.
Admin creds come from env or prompt (never argv). The PAT value is only returned once by DHIS2 — capture it here and pipe into a profile:
export DHIS2_PAT=$(dhis2 dev pat create --url $URL -q)
dhis2 profile add local --url $URL --auth pat
Or use dhis2 profile bootstrap --auth pat for a one-shot setup.
Usage:
Options:
--url TEXT: DHIS2 base URL (also: DHIS2_URL env).--admin-user TEXT--description TEXT--expires-in-days INTEGER--allowed-ip TEXT: IP allowlist entry; repeat for multiple.--allowed-method TEXT: HTTP method allowlist; repeat for each method.--allowed-referrer TEXT: Referer allowlist entry; repeat for multiple.-q, --quiet: Print only the PAT value, suitable for $(command substitution).--help: Show this message and exit.
dhis2 dev oauth2¶
Manage DHIS2 OAuth2 clients on the server (admin ops).
Usage:
Options:
--help: Show this message and exit.
Commands:
client: OAuth2 client registrations at...
dhis2 dev oauth2 client¶
OAuth2 client registrations at /api/oAuth2Clients.
Usage:
Options:
--help: Show this message and exit.
Commands:
register: Register an OAuth2 client on DHIS2 via...
dhis2 dev oauth2 client register¶
Register an OAuth2 client on DHIS2 via POST /api/oAuth2Clients.
Secrets (admin credentials, client_secret) come from env or interactive prompt — never argv.
Prints client_id + metadata UID so they can be piped into
dhis2 profile add --auth oauth2 .... For a one-shot bootstrap (register
+ save profile + log in) use dhis2 profile bootstrap instead.
Usage:
Options:
--url TEXT: DHIS2 base URL (also: DHIS2_URL env).--admin-user TEXT--client-id TEXT: [default: dhis2-utils-local]--redirect-uri TEXT: [default: http://localhost:8765]--scope TEXT: [default: ALL]--name TEXT--help: Show this message and exit.
dhis2 dev sample¶
Inject known-good fixtures to verify the stack end-to-end (route, data, pat, oauth2-client).
Usage:
Options:
--help: Show this message and exit.
Commands:
route: Create a sample route, run it, and (unless...pat: Create a sample PAT, use it to call...data-value: Write a sample data value, read it back,...oauth2-client: Create a sample OAuth2 client on DHIS2,...all: Run every sample in sequence — route,...
dhis2 dev sample route¶
Create a sample route, run it, and (unless --keep) delete it.
Verifies the full /api/routes lifecycle end-to-end: create -> run (proxy to target URL) -> delete.
Usage:
Options:
--url TEXT: URL the sample route will proxy to. [default: https://httpbin.org/get]--code TEXT: [default: SMOKE_ROUTE]--keep: Don't delete the sample route afterwards.--help: Show this message and exit.
dhis2 dev sample pat¶
Create a sample PAT, use it to call /api/me, then (unless --keep) delete it.
Usage:
Options:
--url TEXT: DHIS2 base URL (also: DHIS2_URL env).--admin-user TEXT--keep: Don't delete the sample PAT afterwards.--help: Show this message and exit.
dhis2 dev sample data-value¶
Write a sample data value, read it back, and (unless --keep) delete it.
Uses the Sierra Leone play42 fixture by default:
bvoJ1MGZKQv ("Example indicator", INTEGER_ZERO_OR_POSITIVE, default
CategoryOptionCombo) at Rp268JB6Ne4 (Adonkia CHP, facility level) for
202406 (within the seeded 2024 data window). Override with
--de / --ou / --pe for other scopes.
Usage:
Options:
--data-element, --de TEXT: DataElement UID. [default: bvoJ1MGZKQv]--org-unit, --ou TEXT: OrganisationUnit UID. [default: Rp268JB6Ne4]--period, --pe TEXT: Period (e.g. 202406). [default: 202406]--value TEXT: [default: 42]--keep: Don't delete the sample data value afterwards.--help: Show this message and exit.
dhis2 dev sample oauth2-client¶
Create a sample OAuth2 client on DHIS2, verify it persisted, then (unless --keep) delete it.
Lifecycle: POST /api/oAuth2Clients -> GET /api/oAuth2Clients/{uid} -> DELETE /api/oAuth2Clients/{uid}. The admin user is the owner DHIS2 records on the client; no user-impersonation happens.
Usage:
Options:
--url TEXT: DHIS2 base URL (also: DHIS2_URL env).--admin-user TEXT--client-id TEXT: OAuth2 client_id; default = smoke-<epoch>.--keep: Don't delete the sample OAuth2 client afterwards.--help: Show this message and exit.
dhis2 dev sample all¶
Run every sample in sequence — route, data-value, pat, oauth2-client.
Usage:
Options:
--url TEXT: DHIS2 base URL (also: DHIS2_URL env).--admin-user TEXT--keep: Don't delete the fixtures afterwards.--help: Show this message and exit.
dhis2 dev customize¶
Brand + theme a DHIS2 instance (logos, copy, CSS).
Usage:
Options:
--help: Show this message and exit.
Commands:
logo-front: Upload the login-page splash / upper-right...logo-banner: Upload the top-menu banner logo (appears...style: Upload a CSS stylesheet that DHIS2 serves...set: Set a single system setting.settings: Bulk-set system settings from a JSON file.apply: Apply a committed preset directory in one...show: Show DHIS2's current/api/loginConfig...
dhis2 dev customize logo-front¶
Upload the login-page splash / upper-right logo.
Usage:
Arguments:
FILE: PNG/JPG/SVG to upload as the login splash logo. [required]
Options:
--help: Show this message and exit.
dhis2 dev customize logo-banner¶
Upload the top-menu banner logo (appears on every authenticated page).
Usage:
Arguments:
FILE: PNG/JPG/SVG to upload as the top-menu banner. [required]
Options:
--help: Show this message and exit.
dhis2 dev customize style¶
Upload a CSS stylesheet that DHIS2 serves on every authenticated page.
NOTE: DHIS2's standalone login app (/dhis-web-login/) does NOT include this
stylesheet. Post-auth pages do.
Usage:
Arguments:
FILE: CSS file to upload as/api/files/style. [required]
Options:
--help: Show this message and exit.
dhis2 dev customize set¶
Set a single system setting.
Usage:
Arguments:
KEY: System setting key (e.g. applicationTitle, keyApplicationFooter). [required]VALUE: New value. [required]
Options:
--help: Show this message and exit.
dhis2 dev customize settings¶
Bulk-set system settings from a JSON file.
Usage:
Arguments:
FILE: JSON file containing a {key: value} object. [required]
Options:
--help: Show this message and exit.
dhis2 dev customize apply¶
Apply a committed preset directory in one call (skips files that don't exist).
Usage:
Arguments:
DIRECTORY: Directory containing optional logo_front.png, logo_banner.png, style.css, preset.json. [required]
Options:
--help: Show this message and exit.
dhis2 dev customize show¶
Show DHIS2's current /api/loginConfig snapshot (what the login app sees).
Usage:
Options:
--help: Show this message and exit.
dhis2 doctor¶
Probe a DHIS2 instance for known gotchas + requirements.
Usage:
Options:
--all: Run every category (metadata + integrity + bugs).--help: Show this message and exit.
Commands:
metadata: Run workspace metadata-health probes only...integrity: Run DHIS2's own...bugs: Run BUGS.md workaround drift detection...
dhis2 doctor metadata¶
Run workspace metadata-health probes only (data sets without DEs, programs without stages, ...).
Usage:
Options:
--help: Show this message and exit.
dhis2 doctor integrity¶
Run DHIS2's own /api/dataIntegrity/summary and surface each check as a probe.
Usage:
Options:
--help: Show this message and exit.
dhis2 doctor bugs¶
Run BUGS.md workaround drift detection (workspace maintenance, not operator-facing).
Usage:
Options:
--help: Show this message and exit.
dhis2 files¶
Manage DHIS2 documents + file resources.
Usage:
Options:
--help: Show this message and exit.
Commands:
documents: Documents (/api/documents).resources: File resources (/api/fileResources).
dhis2 files documents¶
Documents (/api/documents).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List documents — external URL links and...list: List documents — external URL links and...get: Show metadata for one document.upload: Upload a binary document — prints the new...upload-url: Create an EXTERNAL_URL document — no bytes...download: Download the binary payload todestination.delete: Delete one document.
dhis2 files documents ls¶
List documents — external URL links and UPLOAD_FILE blobs.
For UPLOAD_FILE docs the backing blob lives in /api/fileResources/{uid}
where {uid} is Document.url (DHIS2 reuses the url field as the FR
pointer). Pass --details to pull each fileResource's contentType,
contentLength, and storageStatus inline.
Usage:
Options:
--filter TEXT: DHIS2 filter, e.g.name:like:Annual.--page INTEGER: 1-indexed page number.--page-size INTEGER: Rows per page (default 50).--details: For each UPLOAD_FILE, also fetch the backing fileResource's contentType / size / storageStatus (one extra request per row).--help: Show this message and exit.
dhis2 files documents list¶
List documents — external URL links and UPLOAD_FILE blobs.
For UPLOAD_FILE docs the backing blob lives in /api/fileResources/{uid}
where {uid} is Document.url (DHIS2 reuses the url field as the FR
pointer). Pass --details to pull each fileResource's contentType,
contentLength, and storageStatus inline.
Usage:
Options:
--filter TEXT: DHIS2 filter, e.g.name:like:Annual.--page INTEGER: 1-indexed page number.--page-size INTEGER: Rows per page (default 50).--details: For each UPLOAD_FILE, also fetch the backing fileResource's contentType / size / storageStatus (one extra request per row).--help: Show this message and exit.
dhis2 files documents get¶
Show metadata for one document.
Usage:
Arguments:
UID: Document UID. [required]
Options:
--help: Show this message and exit.
dhis2 files documents upload¶
Upload a binary document — prints the new UID.
Usage:
Arguments:
FILE: File to upload. [required]
Options:
--name TEXT: Document name (defaults to filename).--help: Show this message and exit.
dhis2 files documents upload-url¶
Create an EXTERNAL_URL document — no bytes uploaded; DHIS2 links out to url.
Usage:
Arguments:
NAME: Document display name. [required]URL: External URL DHIS2 will link to. [required]
Options:
--help: Show this message and exit.
dhis2 files documents download¶
Download the binary payload to destination.
Usage:
Arguments:
UID: Document UID. [required]DESTINATION: Output file path. [required]
Options:
--help: Show this message and exit.
dhis2 files documents delete¶
Delete one document.
Usage:
Arguments:
UID: Document UID. [required]
Options:
--help: Show this message and exit.
dhis2 files resources¶
File resources (/api/fileResources).
Usage:
Options:
--help: Show this message and exit.
Commands:
upload: Upload a file resource; prints the new UID...get: Show metadata for one file resource.download: Download the file-resource payload to...
dhis2 files resources upload¶
Upload a file resource; prints the new UID (reference it from the owning metadata object).
Usage:
Arguments:
FILE: File to upload as a fileResource. [required]
Options:
--domain [data_value|push_analysis|document|message_attachment|user_avatar|org_unit|icon|job_data]: FileResource domain (DATA_VALUE, ICON, MESSAGE_ATTACHMENT, ...). [default: DATA_VALUE]--help: Show this message and exit.
dhis2 files resources get¶
Show metadata for one file resource.
Usage:
Arguments:
UID: FileResource UID. [required]
Options:
--help: Show this message and exit.
dhis2 files resources download¶
Download the file-resource payload to destination.
Usage:
Arguments:
UID: FileResource UID. [required]DESTINATION: Output file path. [required]
Options:
--help: Show this message and exit.
dhis2 maintenance¶
DHIS2 maintenance (tasks, cache, integrity, cleanup, refresh).
Usage:
Options:
--help: Show this message and exit.
Commands:
cache: Clear every server-side cache (Hibernate +...task: Background-task polling (all long-running...cleanup: Hard-remove soft-deleted rows (unblocks...dataintegrity: DHIS2 data-integrity checks.refresh: Regenerate analytics / resource /...validation: Run validation rules + inspect violations...predictors: Run predictor expressions (CRUD on...
dhis2 maintenance cache¶
Clear every server-side cache (Hibernate + app caches).
Usage:
Options:
--help: Show this message and exit.
dhis2 maintenance task¶
Background-task polling (all long-running DHIS2 ops).
Usage:
Options:
--help: Show this message and exit.
Commands:
types: List every background-job type DHIS2...ls: List every task UID recorded for a given...list: List every task UID recorded for a given...status: Print every notification emitted by a...watch: Poll a task until it reports...
dhis2 maintenance task types¶
List every background-job type DHIS2 tracks (ANALYTICS_TABLE, DATA_INTEGRITY, ...).
Usage:
Options:
--help: Show this message and exit.
dhis2 maintenance task ls¶
List every task UID recorded for a given job type.
Usage:
Arguments:
TASK_TYPE: Task type, e.g. ANALYTICS_TABLE. [required]
Options:
--help: Show this message and exit.
dhis2 maintenance task list¶
List every task UID recorded for a given job type.
Usage:
Arguments:
TASK_TYPE: Task type, e.g. ANALYTICS_TABLE. [required]
Options:
--help: Show this message and exit.
dhis2 maintenance task status¶
Print every notification emitted by a task, oldest first.
Usage:
Arguments:
TASK_TYPE: Task type, e.g. ANALYTICS_TABLE. [required]TASK_UID: Task UID returned by the async POST. [required]
Options:
--help: Show this message and exit.
dhis2 maintenance task watch¶
Poll a task until it reports completed=true, streaming each new notification.
Usage:
Arguments:
TASK_TYPE: Task type, e.g. DATA_INTEGRITY. [required]TASK_UID: Task UID returned by the async POST. [required]
Options:
--interval FLOAT: Poll interval in seconds. [default: 2.0]--timeout FLOAT: Abort after N seconds (default 600). [default: 600.0]--help: Show this message and exit.
dhis2 maintenance cleanup¶
Hard-remove soft-deleted rows (unblocks metadata deletion).
Usage:
Options:
--help: Show this message and exit.
Commands:
data-values: Hard-remove soft-deleted data values from...events: Hard-remove soft-deleted tracker events.enrollments: Hard-remove soft-deleted tracker enrollments.tracked-entities: Hard-remove soft-deleted tracked entities.
dhis2 maintenance cleanup data-values¶
Hard-remove soft-deleted data values from /api/dataValueSets imports.
Usage:
Options:
--help: Show this message and exit.
dhis2 maintenance cleanup events¶
Hard-remove soft-deleted tracker events.
Usage:
Options:
--help: Show this message and exit.
dhis2 maintenance cleanup enrollments¶
Hard-remove soft-deleted tracker enrollments.
Usage:
Options:
--help: Show this message and exit.
dhis2 maintenance cleanup tracked-entities¶
Hard-remove soft-deleted tracked entities.
Usage:
Options:
--help: Show this message and exit.
dhis2 maintenance dataintegrity¶
DHIS2 data-integrity checks.
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every built-in data-integrity check...list: List every built-in data-integrity check...run: Kick off a data-integrity run; with...result: Read the stored result of a completed...
dhis2 maintenance dataintegrity ls¶
List every built-in data-integrity check (name, section, severity).
Usage:
Options:
--help: Show this message and exit.
dhis2 maintenance dataintegrity list¶
List every built-in data-integrity check (name, section, severity).
Usage:
Options:
--help: Show this message and exit.
dhis2 maintenance dataintegrity run¶
Kick off a data-integrity run; with --watch, stream progress to completion.
Usage:
Arguments:
[CHECK]...: Check name(s); omit to run every check.
Options:
--details: Hit /details (populates issues[]) instead of /summary.--slow: Include the ~19isSlowchecks DHIS2 skips by default. Resolves the full check list via /api/dataIntegrity and passes every name explicitly — DHIS2 only runs a slow check when it's named in thechecksfilter.-w, --watch: After kicking off the job, poll /api/system/tasks until it reports completed=true.--interval FLOAT: Poll interval in seconds when --watch is set. [default: 2.0]--timeout FLOAT: Abort polling after N seconds (default 600). [default: 600.0]--help: Show this message and exit.
dhis2 maintenance dataintegrity result¶
Read the stored result of a completed data-integrity run (summary or details mode).
Usage:
Arguments:
[CHECK]...: Check name(s) to read; omit for all.
Options:
--details: Hit /details (issues[]) instead of /summary (count only).--help: Show this message and exit.
dhis2 maintenance refresh¶
Regenerate analytics / resource / monitoring backing tables.
Usage:
Options:
--help: Show this message and exit.
Commands:
analytics: Regenerate the full analytics star schema...resource-tables: Regenerate resource tables only...monitoring: Regenerate monitoring tables...
dhis2 maintenance refresh analytics¶
Regenerate the full analytics star schema (/api/resourceTables/analytics, job=ANALYTICS_TABLE).
Primary workflow after pushing new data values: DHIS2's analytics queries
read from these tables, so they must be rebuilt for fresh data to show up.
Also refreshes resource tables unless --skip-resource-tables is set.
Usage:
Options:
--last-years INTEGER--skip-resource-tables-w, --watch: After kicking off the job, poll /api/system/tasks until it reports completed=true.--interval FLOAT: Poll interval in seconds when --watch is set. [default: 2.0]--timeout FLOAT: Abort polling after N seconds (default 600). [default: 600.0]--help: Show this message and exit.
dhis2 maintenance refresh resource-tables¶
Regenerate resource tables only (/api/resourceTables, job=RESOURCE_TABLE).
Rebuilds the supporting OU / category hierarchy tables without touching
the analytics star schema. Use when OU / category metadata changed but
no new data values landed — faster than a full refresh analytics run.
Usage:
Options:
-w, --watch: After kicking off the job, poll /api/system/tasks until it reports completed=true.--interval FLOAT: Poll interval in seconds when --watch is set. [default: 2.0]--timeout FLOAT: Abort polling after N seconds (default 600). [default: 600.0]--help: Show this message and exit.
dhis2 maintenance refresh monitoring¶
Regenerate monitoring tables (/api/resourceTables/monitoring, job=MONITORING).
Rebuilds the tables backing DHIS2's data-quality / validation-rule monitoring. Independent of the analytics + resource tables.
Usage:
Options:
-w, --watch: After kicking off the job, poll /api/system/tasks until it reports completed=true.--interval FLOAT: Poll interval in seconds when --watch is set. [default: 2.0]--timeout FLOAT: Abort polling after N seconds (default 600). [default: 600.0]--help: Show this message and exit.
dhis2 maintenance validation¶
Run validation rules + inspect violations (CRUD on rules: dhis2 metadata list validationRules).
Usage:
Options:
--help: Show this message and exit.
Commands:
run: Run a validation-rule analysis + render...send-notifications: Fire configured notification templates for...validate-expression: Parse-check an expression + render a human...result: List / get / delete persisted validation...
dhis2 maintenance validation run¶
Run a validation-rule analysis + render the violations.
Usage:
Arguments:
ORG_UNIT: Org-unit UID to evaluate rules under (DHIS2 walks the sub-tree). [required]
Options:
--start-date TEXT: Period start, YYYY-MM-DD. [required]--end-date TEXT: Period end, YYYY-MM-DD. [required]--group TEXT: ValidationRuleGroup UID to narrow the rules evaluated.--max-results INTEGER: Cap on violations returned (DHIS2 default ~500).--notification: Fire configured notification templates for each triggered rule.--persist: Write violations into/api/validationResults(otherwise ephemeral).--help: Show this message and exit.
dhis2 maintenance validation send-notifications¶
Fire configured notification templates for every current validation violation.
Usage:
Options:
--help: Show this message and exit.
dhis2 maintenance validation validate-expression¶
Parse-check an expression + render a human description.
Usage:
Arguments:
EXPRESSION: DHIS2 expression to parse-check. [required]
Options:
--context TEXT: Expression parser context: one of generic, validation-rule, indicator, predictor, program-indicator. [default: generic]--help: Show this message and exit.
dhis2 maintenance validation result¶
List / get / delete persisted validation results.
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List persisted validation results.list: List persisted validation results.get: Show one persisted validation result by id.delete: Bulk-delete validation results by filter.
dhis2 maintenance validation result ls¶
List persisted validation results.
Usage:
Options:
--org-unit, --ou TEXT: Org-unit UID filter.--period, --pe TEXT: Period filter (e.g. 202501).--vr TEXT: Validation-rule UID filter.--page INTEGER--page-size INTEGER--help: Show this message and exit.
dhis2 maintenance validation result list¶
List persisted validation results.
Usage:
Options:
--org-unit, --ou TEXT: Org-unit UID filter.--period, --pe TEXT: Period filter (e.g. 202501).--vr TEXT: Validation-rule UID filter.--page INTEGER--page-size INTEGER--help: Show this message and exit.
dhis2 maintenance validation result get¶
Show one persisted validation result by id.
Usage:
Arguments:
RESULT_ID: Numeric validation-result id. [required]
Options:
--help: Show this message and exit.
dhis2 maintenance validation result delete¶
Bulk-delete validation results by filter. At least one filter is required.
Usage:
Options:
--org-unit, --ou TEXT: Org-unit UID filter. Repeatable.--period, --pe TEXT: Period filter. Repeatable.--vr TEXT: Validation-rule UID filter. Repeatable.--help: Show this message and exit.
dhis2 maintenance predictors¶
Run predictor expressions (CRUD on predictors: dhis2 metadata list predictors).
Usage:
Options:
--help: Show this message and exit.
Commands:
run: Run predictor expressions + emit data...
dhis2 maintenance predictors run¶
Run predictor expressions + emit data values for the given date range.
Usage:
Options:
--start-date TEXT: Period start, YYYY-MM-DD. [required]--end-date TEXT: Period end, YYYY-MM-DD. [required]--predictor TEXT: Run one predictor by UID. Mutually exclusive with --group.--group TEXT: Run all predictors in a PredictorGroup by UID.--help: Show this message and exit.
dhis2 messaging¶
DHIS2 internal messaging.
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List conversations the authenticated user...list: List conversations the authenticated user...get: Show one conversation's metadata + message...send: Create a new conversation with an initial...reply: Reply to an existing conversation with a...mark-read: Mark one or more conversations as read.mark-unread: Mark one or more conversations as unread.delete: Delete a conversation (soft-delete for the...set-priority: Set a conversation's ticket-workflow...set-status: Set a conversation's ticket-workflow status.assign: Assign a conversation to a user (ticket...unassign: Remove the assignee from a conversation.
dhis2 messaging ls¶
List conversations the authenticated user is part of.
Usage:
Options:
--filter TEXT: DHIS2 filter. Example:read:eq:falsefor unread only.--page INTEGER: 1-indexed page number.--page-size INTEGER: Rows per page (default 50).--help: Show this message and exit.
dhis2 messaging list¶
List conversations the authenticated user is part of.
Usage:
Options:
--filter TEXT: DHIS2 filter. Example:read:eq:falsefor unread only.--page INTEGER: 1-indexed page number.--page-size INTEGER: Rows per page (default 50).--help: Show this message and exit.
dhis2 messaging get¶
Show one conversation's metadata + message thread.
Usage:
Arguments:
UID: Conversation UID. [required]
Options:
--help: Show this message and exit.
dhis2 messaging send¶
Create a new conversation with an initial message.
Usage:
Arguments:
SUBJECT: Subject line. [required]TEXT: Message body. [required]
Options:
-u, --user TEXT: User UID recipient. Repeatable.-g, --user-group TEXT: User-group UID recipient. Repeatable.--org-unit, --ou TEXT: Organisation-unit UID recipient. Repeatable.-a, --attachment TEXT: FileResource UID to attach (upload viadhis2 files resources upload --domain MESSAGE_ATTACHMENTfirst). Repeatable.--help: Show this message and exit.
dhis2 messaging reply¶
Reply to an existing conversation with a plain-text message.
DHIS2's reply endpoint takes text/plain only on v42 — attachments +
internal-note flag only work on the initial send call.
Usage:
Arguments:
UID: Conversation UID. [required]TEXT: Reply body (plain text). [required]
Options:
--help: Show this message and exit.
dhis2 messaging mark-read¶
Mark one or more conversations as read.
Usage:
Arguments:
UID...: Conversation UID(s). One or more. [required]
Options:
--help: Show this message and exit.
dhis2 messaging mark-unread¶
Mark one or more conversations as unread.
Usage:
Arguments:
UID...: Conversation UID(s). One or more. [required]
Options:
--help: Show this message and exit.
dhis2 messaging delete¶
Delete a conversation (soft-delete for the calling user; other participants keep it).
Usage:
Arguments:
UID: Conversation UID. [required]
Options:
--help: Show this message and exit.
dhis2 messaging set-priority¶
Set a conversation's ticket-workflow priority.
Values: NONE / LOW / MEDIUM / HIGH. Applies to any messageType — most meaningful on TICKET conversations, stored on PRIVATE threads too.
Usage:
Arguments:
UID: Conversation UID. [required]PRIORITY: Priority — NONE / LOW / MEDIUM / HIGH. [required]
Options:
--help: Show this message and exit.
dhis2 messaging set-status¶
Set a conversation's ticket-workflow status.
Values: NONE / OPEN / PENDING / INVALID / SOLVED. Not wired into the
initial send — DHIS2's API requires a separate POST on the
/status sub-resource.
Usage:
Arguments:
UID: Conversation UID. [required]STATUS: Status — NONE / OPEN / PENDING / INVALID / SOLVED. [required]
Options:
--help: Show this message and exit.
dhis2 messaging assign¶
Assign a conversation to a user (ticket workflows).
Usage:
Arguments:
UID: Conversation UID. [required]USER: User UID to assign the conversation to. [required]
Options:
--help: Show this message and exit.
dhis2 messaging unassign¶
Remove the assignee from a conversation.
Usage:
Arguments:
UID: Conversation UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata¶
DHIS2 metadata inspection.
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List instances of a metadata resource.list: List instances of a metadata resource.search: Cross-resource metadata search.usage: Reverse lookup — find every object that...get: Fetch one metadata object by UID.export: Download a metadata bundle from `GET...import: Upload a metadata bundle via `POST...patch: Apply an RFC 6902 JSON Patch to a metadata...rename: Bulk-rename metadata objects by RFC 6902...retag: Bulk-rewrite ref / enum fields on metadata...share: Apply one sharing block across many UIDs...diff: Compare two metadata bundles (or one...diff-profiles: Diff a metadata slice between two...merge: Export resources from one profile and...merge-bundle: Import a saved bundle file into a target...type: Metadata resource types (the catalog).options: OptionSet workflows (show / find / sync).attribute: Cross-resource AttributeValue workflows...program-rule: Program rule workflows (show / vars-for /...sql-view: SQL view workflows (list / show / execute...viz: Visualization authoring (list / show /...dashboard: Dashboard composition (list / show /...map: Map authoring (list / show / create /...data-elements: DataElement authoring (list / show /...data-element-groups: DataElementGroup workflows (list / show /...data-element-group-sets: DataElementGroupSet workflows (list / show...indicators: Indicator authoring (list / show / create...indicator-groups: IndicatorGroup workflows (list / show /...indicator-group-sets: IndicatorGroupSet workflows (list / show /...program-indicators: ProgramIndicator authoring (list / show /...program-indicator-groups: ProgramIndicatorGroup workflows (list /...category-options: CategoryOption authoring (list / show /...category-option-groups: CategoryOptionGroup workflows (list / show...category-option-group-sets: CategoryOptionGroupSet workflows (list /...categories: Category authoring (list / show / create /...category-combos: CategoryCombo authoring (list / show /...category-option-combos: CategoryOptionCombo read access (list /...data-sets: DataSet authoring (list / show / create /...sections: Section authoring (list / show / create /...validation-rules: ValidationRule authoring (list / show /...validation-rule-groups: ValidationRuleGroup workflows (list / show...predictors: Predictor authoring (list / show / create...predictor-groups: PredictorGroup workflows (list / show /...tracked-entity-attributes: TrackedEntityAttribute authoring (list /...tracked-entity-types: TrackedEntityType authoring (list / show /...programs: Program authoring (list / show / create /...program-stages: ProgramStage authoring (list / show /...organisation-units: OrganisationUnit hierarchy workflows (list...organisation-unit-groups: OrganisationUnitGroup workflows (list /...organisation-unit-group-sets: OrganisationUnitGroupSet workflows (list /...organisation-unit-levels: OrganisationUnitLevel naming (list / show...legend-sets: LegendSet authoring (list / show / create...
dhis2 metadata ls¶
List instances of a metadata resource.
Usage:
Arguments:
RESOURCE: Resource type, e.g. dataElements, indicators [required]
Options:
--fields TEXT: DHIS2 field selector: plain ('id,name'), presets (':identifiable', ':nameable', ':owner', ':all'), nested ('children'), or exclusions (':all,!lastUpdated'). [default: id,name]--filter TEXT: Filter inproperty:operator:valueform. Repeatable — AND'd by default, use --root-junction OR to switch.--root-junction TEXT: Combine repeated --filter as AND (default) or OR. [default: AND]--order TEXT: Sort clause like 'name:asc' or 'created:desc'. Repeatable (later clauses tie-break).--page INTEGER: Server-side page number (1-based). Ignored when --all is set.--page-size INTEGER: Server-side page size (default 50). Ignored when --all is set.--all: Stream every page server-side (ignores --page/--page-size). Useful for dumping a full catalog.--translate / --no-translate: Return server-side translations for i18n fields.--locale TEXT: Locale for --translate, e.g. 'fr'.--help: Show this message and exit.
dhis2 metadata list¶
List instances of a metadata resource.
Usage:
Arguments:
RESOURCE: Resource type, e.g. dataElements, indicators [required]
Options:
--fields TEXT: DHIS2 field selector: plain ('id,name'), presets (':identifiable', ':nameable', ':owner', ':all'), nested ('children'), or exclusions (':all,!lastUpdated'). [default: id,name]--filter TEXT: Filter inproperty:operator:valueform. Repeatable — AND'd by default, use --root-junction OR to switch.--root-junction TEXT: Combine repeated --filter as AND (default) or OR. [default: AND]--order TEXT: Sort clause like 'name:asc' or 'created:desc'. Repeatable (later clauses tie-break).--page INTEGER: Server-side page number (1-based). Ignored when --all is set.--page-size INTEGER: Server-side page size (default 50). Ignored when --all is set.--all: Stream every page server-side (ignores --page/--page-size). Useful for dumping a full catalog.--translate / --no-translate: Return server-side translations for i18n fields.--locale TEXT: Locale for --translate, e.g. 'fr'.--help: Show this message and exit.
dhis2 metadata search¶
Cross-resource metadata search.
Three concurrent /api/metadata?filter=<field>:<op>:<q> calls (one
per match axis: id, code, name) merged client-side with UID dedup.
Paste whatever you have — UID, partial UID, business code, or name
fragment — to find every matching object grouped by resource.
--resource dataElements narrows to one resource kind. --fields
id,name,code,valueType asks DHIS2 for extra columns (rendered
after the standard four). --exact switches from ilike substring
to eq strict match — useful when a partial UID would otherwise
match too many siblings.
Usage:
Arguments:
QUERY: UID, code, or name fragment to search for. [required]
Options:
--page-size INTEGER: Max hits per resource type (default 50). [default: 50]--resource TEXT: Narrow to one DHIS2 resource (e.g. dataElements, dashboards).--fields TEXT: DHIS2 fields selector; extras land on SearchHit.extras (rendered as trailing columns).--exact: Use:eq:instead of:ilike:— strict UID / code match.--help: Show this message and exit.
dhis2 metadata usage¶
Reverse lookup — find every object that references the given UID.
Useful as a deletion-safety check: any dataset / visualization / map /
dashboard / program that references the UID shows up in the table.
Empty result means no reference was found on any covered path, but
is not a hard proof that the UID is safe to delete — coverage is
best-effort (see _USAGE_PATTERNS in the client).
Internally: resolves the UID's owning resource via
/api/identifiableObjects/{uid} first, then fans out concurrent
/api/<target>?filter=<path>:eq:<uid> calls over every known
reference-shape for that owning type.
Usage:
Arguments:
UID: UID to reverse-lookup — find every object that references it. [required]
Options:
--page-size INTEGER: Max hits per reference path (default 100). [default: 100]--help: Show this message and exit.
dhis2 metadata get¶
Fetch one metadata object by UID.
Prints a concise Rich summary by default (id, name, code, common metadata +
notable extras). Use --json for the full payload when debugging or
piping into jq. Pass --fields to narrow what DHIS2 returns.
Usage:
Arguments:
RESOURCE: Resource type, e.g. dataElements [required]UID: Object UID [required]
Options:
--fields TEXT: DHIS2 fields selector.--help: Show this message and exit.
dhis2 metadata export¶
Download a metadata bundle from GET /api/metadata.
Prints a per-resource count summary to stderr so stdout stays pipe-friendly
when --output is omitted. With --check-references (default), walks the
exported bundle and warns on any reference to a UID not in the bundle —
so a filtered --resource dataElements export doesn't silently produce a
bundle that won't round-trip because categoryCombos / optionSets / ...
are missing.
Usage:
Options:
--resource TEXT: Resource type to include (repeatable). Omit for every type DHIS2 exports by default.--fields TEXT: DHIS2 field selector. Defaults to ':owner' for a lossless round-trip import. [default: :owner]--filter TEXT: Per-resource filter in the formRESOURCE:property:operator:value. Repeatable. Example:--filter dataElements:name:like:ANC. Same DSL asdhis2 metadata list --filter, prefixed with the resource name.--resource-fields TEXT: Per-resource field selector in the formRESOURCE:SELECTOR. Repeatable. Overrides the global--fieldsfor the named resource. Example:--resource-fields dataElements::identifiable.--skip-sharing: Exclude sharing blocks from exported objects.--skip-translation: Exclude translation blocks.--skip-validation: Skip validation during export (matches DHIS2's server-side option).--check-references / --no-check-references: After export, walk the bundle and warn on references to UIDs not in the bundle (e.g. a dataElement's categoryCombo missing from a filtered export). On by default. [default: check-references]-o, --output PATH: Write the bundle to this file (JSON). Omit to print to stdout.--pretty / --no-pretty: Indent JSON output (default: pretty). [default: pretty]--help: Show this message and exit.
dhis2 metadata import¶
Upload a metadata bundle via POST /api/metadata and print the import report.
Usage:
Arguments:
FILE: Path to the metadata bundle JSON. [required]
Options:
--strategy TEXT: CREATE | UPDATE | CREATE_AND_UPDATE | DELETE (default CREATE_AND_UPDATE). [default: CREATE_AND_UPDATE]--atomic-mode TEXT: ALL (rollback on any failure) or NONE (commit surviving objects). [default: ALL]--dry-run: Validate + preheat without committing. Output is the import report DHIS2 would have produced.--identifier TEXT: UID | CODE | AUTO (default UID). [default: UID]--skip-sharing--skip-translation--skip-validation--merge-mode TEXT: REPLACE (overwrite) or MERGE (patch) existing objects.--preheat-mode TEXT: REFERENCE (default), ALL, or NONE.--flush-mode TEXT: AUTO (default) or OBJECT.--help: Show this message and exit.
dhis2 metadata patch¶
Apply an RFC 6902 JSON Patch to a metadata object (PATCH /api/<resource>/{uid}).
Two input modes:
--file patch.json— full patch array on disk, one op per entry:[{"op": "replace", "path": "/name", "value": "New"}, ...]--set path=value/--remove path(each repeatable) — inline shorthand for the common replace/remove cases. Values parse as JSON when possible (so--set /valueType=INTEGERsends a string,--set /disabled=truesends a boolean).
Usage:
Arguments:
RESOURCE: Resource type, e.g. dataElements, indicators. [required]UID: UID of the object to patch. [required]
Options:
--file PATH: JSON file with a RFC 6902 patch array. Mutually exclusive with --set/--remove.--set TEXT: Inlinereplaceop aspath=value. Repeatable. Values are JSON-decoded when they parse as JSON ({"a":1},true,42) and treated as strings otherwise.--remove TEXT: Inlineremoveop aspath. Repeatable.--help: Show this message and exit.
dhis2 metadata rename¶
Bulk-rename metadata objects by RFC 6902 patch.
Fans out concurrent PATCH /api/<resource>/{uid} requests via the
shared client.metadata.patch_bulk primitive (#187); per-UID
failures render through the same conflict table used by
metadata import instead of raising. Prefix / suffix flags are
idempotent — re-running won't double-prefix already-prefixed
objects.
Use --dry-run to preview which objects match + what the
before/after labels would be, then drop the flag to apply.
Usage:
Arguments:
RESOURCE: Resource type, e.g. dataElements, indicators. [required]
Options:
--filter TEXT: DHIS2 filter DSL (<prop>:<op>:<value>), repeatable. Example:--filter code:like:DE_ANCto narrow the cohort.--root-junction TEXT: Combine repeated --filter as AND (default) or OR.--name-prefix TEXT: Prefix each matched object'sname(idempotent).--name-suffix TEXT: Suffix each matched object'sname(idempotent).--name-strip-prefix TEXT: Remove this prefix from each matched object'sname(idempotent; no-op when absent).--name-strip-suffix TEXT: Remove this suffix from each matched object'sname(idempotent; no-op when absent).--short-name-prefix TEXT: Prefix each matched object'sshortName(idempotent).--short-name-suffix TEXT: Suffix each matched object'sshortName(idempotent).--short-name-strip-prefix TEXT: Remove this prefix from each matched object'sshortName(idempotent).--short-name-strip-suffix TEXT: Remove this suffix from each matched object'sshortName(idempotent).--set-description TEXT: Replace every matched object'sdescriptionwith this string.--concurrency INTEGER: Max concurrent PATCH requests (default 8). [default: 8]--dry-run: Preview the planned patches without sending them.--help: Show this message and exit.
dhis2 metadata retag¶
Bulk-rewrite ref / enum fields on metadata objects.
Sister verb to metadata rename. Flags map to RFC 6902 patches:
--category-combo <uid> → replace /categoryCombo, --option-set
<uid> → replace /optionSet, --clear-option-set → remove
/optionSet, --aggregation-type TYPE → replace
/aggregationType, --legend-set <uid> (repeatable) → replace
/legendSets with the whole list, --clear-legend-sets → empty
that list. Stack multiple flags in one invocation.
Per-UID failures render through the shared ConflictRow renderer
— e.g. --domain-type TRACKER against an Indicator surfaces as
409s instead of raising.
Usage:
Arguments:
RESOURCE: Resource type, e.g. dataElements, indicators. [required]
Options:
--filter TEXT: DHIS2 filter DSL (<prop>:<op>:<value>), repeatable.--root-junction TEXT: Combine repeated --filter as AND (default) or OR.--category-combo TEXT: Replace/categoryCombowith the given CategoryCombo UID.--option-set TEXT: Replace/optionSetwith the given OptionSet UID.--clear-option-set: Remove/optionSet(null out the ref).--aggregation-type TEXT: Replace/aggregationType(e.g. SUM, AVERAGE).--domain-type TEXT: Replace/domainType(AGGREGATE / TRACKER).--legend-set TEXT: Replace/legendSetswith the given UIDs (repeatable).--clear-legend-sets: Empty/legendSets.--concurrency INTEGER: Max concurrent PATCH requests (default 8). [default: 8]--dry-run: Preview without sending patches.--help: Show this message and exit.
dhis2 metadata share¶
Apply one sharing block across many UIDs of one resource.
Fans out concurrent POST /api/sharing?type=<resource_type>&id=<uid>
requests via the shared client.metadata.apply_sharing_bulk primitive.
Per-UID failures render through the same row table used by
metadata rename instead of raising.
Use --dry-run to preview the planned grants, then drop the flag to
apply. UIDs come from positional args or stdin (-); pipe from
dhis2 --json metadata list ... | jq -r '.[].id' to filter-then-share without
leaving the shell.
Usage:
Arguments:
RESOURCE_TYPE: DHIS2 singular resource type as it appears on/api/sharing?type=— e.g.dataSet,dataElement,program,dashboard. [required][UIDS]...: UIDs to share. Pass-to read one UID per line from stdin.
Options:
--public-access TEXT: Replace the public-access string. 8-char DHIS2 pattern (rwrw----,r-------,--------). Defaults tor-------if omitted and at least one grant is supplied.--user-access TEXT: Repeatable; grant a user access inUID:accessform (e.g.U_ALICE:rw------).--user-group-access TEXT: Repeatable; grant a user-group access inUID:accessform.--concurrency INTEGER: Max concurrent POSTs (default 8). [default: 8]--dry-run: Preview the planned grants without sending them.--help: Show this message and exit.
dhis2 metadata diff¶
Compare two metadata bundles (or one bundle against the live instance).
Per-resource counts of create/update/delete. Objects that differ only on
DHIS2's per-instance noise (lastUpdated, createdBy, etc.) are treated as
unchanged by default — --ignore extends that list.
Usage:
Arguments:
LEFT: Left-hand bundle — the 'source of truth' you're comparing against. [required][RIGHT]: Right-hand bundle. Omit with--liveto diff against the connected DHIS2 instance.
Options:
--live: Use the connected DHIS2 instance as the right-hand side. Exports only the resource types present in the left bundle (no full-catalog fetch). Incompatible with a positional right arg.--show-uids: List up to 5 offending UIDs per per-resource row.--ignore TEXT: Fields to skip when deciding if an object changed. Repeatable. Defaults cover DHIS2's per-instance noise (lastUpdated, createdBy, access, ...); pass--ignore sharingetc. to extend.--help: Show this message and exit.
dhis2 metadata diff-profiles¶
Diff a metadata slice between two registered profiles (staging vs prod drift).
Runs both exports in parallel, narrows to --resource types, optionally
filters each resource (--filter resource:prop:op:val), then structurally
diffs the two bundles ignoring DHIS2's per-instance noise
(timestamps, createdBy, access strings, …).
A whole-instance diff is almost never useful — staging and prod diverge on
user accounts, org-unit assignments, and incidental settings by design. Pick
a narrow resource slice (-r dataElements -r indicators), filter further
with --filter, and extend --ignore for anything else that's expected to
differ.
Exit code is 0 by default regardless of drift (so operators running this
interactively aren't tripped by per-command-exit conventions). Pass
--exit-on-drift for the CI shape.
Usage:
Arguments:
PROFILE_A: Name of the 'left' profile (source of truth). [required]PROFILE_B: Name of the 'right' profile (candidate). [required]
Options:
-r, --resource TEXT: Resource type to compare (e.g. dataElements, indicators). Repeatable. Required — whole-instance diffs are almost always noise.--filter TEXT: Per-resource filter inresource:property:operator:valueform. Repeatable. Example:--filter dataElements:name:like:ANConly compares data elements whose name contains 'ANC'. Same DHIS2 filter DSL asdhis2 metadata list --filter.--fields TEXT: DHIS2 field selector applied on both profiles. Defaults to ':owner' — the selector DHIS2 itself uses for cross-instance imports (preserves every field needed for a faithful round-trip). [default: :owner]--ignore TEXT: Additional fields to skip when deciding if an object changed. Repeatable. Defaults already cover DHIS2's per-instance noise (lastUpdated, createdBy, access, ...). Common extensions for drift checks:--ignore sharing --ignore translations.--show-uids: List up to 5 offending UIDs per per-resource row.--exit-on-drift: Exit 1 when any object differs. CI-friendly (default is always exit 0).--help: Show this message and exit.
dhis2 metadata merge¶
Export resources from one profile and import them into another.
Pairs with dhis2 metadata diff-profiles (which reads the same shape
of narrow resource slice + filters). Preview first with
diff-profiles, then apply the same --resource + --filter args
through merge to land the changes on the target.
Require --resource — a whole-instance merge would overwrite users,
org units, and incidental settings that staging and prod routinely
differ on for non-drift reasons.
--dry-run flips the target import into importMode=VALIDATE.
DHIS2 walks the bundle, reports conflicts + stats, and commits
nothing. Use to catch "this object references a user UID that
doesn't exist on the target" before the real run.
Usage:
Arguments:
SOURCE_PROFILE: Source profile — the--fromside of the merge. [required]TARGET_PROFILE: Target profile — where the source's resources land. [required]
Options:
-r, --resource TEXT: Resource type to merge (e.g. dataElements, indicators). Repeatable. Required — whole-instance merges are almost never what you want.--filter TEXT: Per-resource filter inresource:property:operator:valueform. Repeatable. Same DSL asdhis2 metadata list --filteranddhis2 metadata diff-profiles.--fields TEXT: DHIS2 field selector applied on the source export. Defaults to ':owner' (faithful round-trip). [default: :owner]--strategy TEXT: Import strategy — CREATE / UPDATE / CREATE_AND_UPDATE / DELETE (default: CREATE_AND_UPDATE). [default: CREATE_AND_UPDATE]--atomic TEXT: atomicMode — ALL / NONE (default: ALL; one broken object aborts the whole import). [default: ALL]--include-sharing / --skip-sharing: Carry sharing blocks across. OFF by default — different instances typically have different user / group UIDs and sharing imports fail with false-positive conflicts. [default: skip-sharing]--dry-run: SendimportMode=VALIDATEto the target; reports conflicts + counts without committing.--help: Show this message and exit.
dhis2 metadata merge-bundle¶
Import a saved bundle file into a target profile.
The bundle-source variant of dhis2 metadata merge: instead of
exporting from a source profile, read the bundle from disk. Useful
when the bundle came from a saved metadata export, was hand-crafted
by an operator, or was produced by a non-DHIS2 tool. All other
semantics match merge — atomic + sharing skipped by default,
--dry-run flips to importMode=VALIDATE.
Usage:
Arguments:
TARGET_PROFILE: Target profile — where the bundle's resources land. [required]BUNDLE: Path to a JSON metadata bundle (the shapeGET /api/metadatareturns). [required]
Options:
-r, --resource TEXT: Resource type to include in the count summary (e.g. dataElements). Repeatable. Optional — when omitted, every resource section in the bundle is reported.--strategy TEXT: Import strategy — CREATE / UPDATE / CREATE_AND_UPDATE / DELETE (default: CREATE_AND_UPDATE). [default: CREATE_AND_UPDATE]--atomic TEXT: atomicMode — ALL / NONE (default: ALL; one broken object aborts the whole import). [default: ALL]--include-sharing / --skip-sharing: Carry sharing blocks across. OFF by default — different instances typically have different user / group UIDs and sharing imports fail with false-positive conflicts. [default: skip-sharing]--dry-run: SendimportMode=VALIDATEto the target; reports conflicts + counts without committing.--help: Show this message and exit.
dhis2 metadata type¶
Metadata resource types (the catalog).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List the metadata resource types exposed...list: List the metadata resource types exposed...
dhis2 metadata type ls¶
List the metadata resource types exposed by the connected DHIS2 instance.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata type list¶
List the metadata resource types exposed by the connected DHIS2 instance.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata options¶
OptionSet workflows (show / find / sync).
Usage:
Options:
--help: Show this message and exit.
Commands:
get: Show one OptionSet with its options...find: Locate a single option inside a set by...sync: Idempotently sync an OptionSet to match a...attribute: External-system code mapping on Options...
dhis2 metadata options get¶
Show one OptionSet with its options resolved inline.
Usage:
Arguments:
UID_OR_CODE: OptionSet UID (11 chars) or business code. [required]
Options:
--help: Show this message and exit.
dhis2 metadata options find¶
Locate a single option inside a set by code or name; exit 1 if no match.
Usage:
Options:
--set TEXT: OptionSet UID or business code. [required]--code TEXT: Business code of the option to locate.--name TEXT: Display name of the option (exact match).--help: Show this message and exit.
dhis2 metadata options sync¶
Idempotently sync an OptionSet to match a JSON spec file.
The spec is a JSON array of {code, name, sort_order?} objects. Codes
not currently in the set get added; codes present but with changed
names or sort order get updated; exact matches are skipped.
Pass --remove-missing to also drop options whose code isn't in the
spec. --dry-run previews the diff without writing.
Usage:
Arguments:
SET_REF: OptionSet UID or business code. [required]SPEC_FILE: JSON file — list of{code, name, sort_order?}objects. [required]
Options:
--remove-missing: Also delete options whose code isn't in the spec. Off by default — safer for partial refreshes.--dry-run: Compute the diff without writing anything.--help: Show this message and exit.
dhis2 metadata options attribute¶
External-system code mapping on Options via Attribute values.
Usage:
Options:
--help: Show this message and exit.
Commands:
get: Read one attribute value off an Option;...set: Set / replace an attribute value on an...find: Reverse lookup — find the Option whose...
dhis2 metadata options attribute get¶
Read one attribute value off an Option; exit 1 if unset.
Usage:
Arguments:
OPTION_UID: Option UID (11 chars). [required]ATTRIBUTE: Attribute UID or business code (e.g. 'SNOMED_CODE'). [required]
Options:
--help: Show this message and exit.
dhis2 metadata options attribute set¶
Set / replace an attribute value on an Option.
Reads the full Option, merges the new value (replaces any prior value for the same attribute UID), PUTs the payload back. DHIS2's attribute-value list is identity-keyed by attribute UID, so this is idempotent — calling twice with the same value is a no-op.
Usage:
Arguments:
OPTION_UID: Option UID (11 chars). [required]ATTRIBUTE: Attribute UID or business code (e.g. 'SNOMED_CODE'). [required]VALUE: New attribute value. [required]
Options:
--help: Show this message and exit.
dhis2 metadata options attribute find¶
Reverse lookup — find the Option whose attribute matches a value.
The killer integration helper: external systems know a SNOMED / ICD / LOINC code; this command returns the DHIS2 Option it maps to. Exits 1 on miss with a stderr hint.
Usage:
Options:
--set TEXT: OptionSet UID or business code. [required]--attribute TEXT: Attribute UID or business code (e.g. 'SNOMED_CODE'). [required]--value TEXT: Attribute value to match exactly. [required]--help: Show this message and exit.
dhis2 metadata attribute¶
Cross-resource AttributeValue workflows (get / set / delete / find).
Usage:
Options:
--help: Show this message and exit.
Commands:
get: Read one attribute value off any resource;...set: Set / replace one attribute value on any...delete: Remove one attribute value from any...find: Reverse lookup across any resource — list...
dhis2 metadata attribute get¶
Read one attribute value off any resource; exit 1 if unset.
Usage:
Arguments:
RESOURCE: Plural DHIS2 resource name (e.g.dataElements,options,organisationUnits). [required]RESOURCE_UID: UID of the resource instance. [required]ATTRIBUTE: Attribute UID or business code (e.g.ICD10_CODE). [required]
Options:
--help: Show this message and exit.
dhis2 metadata attribute set¶
Set / replace one attribute value on any resource (read-merge-write).
Usage:
Arguments:
RESOURCE: Plural DHIS2 resource name. [required]RESOURCE_UID: UID of the resource instance. [required]ATTRIBUTE: Attribute UID or business code. [required]VALUE: New attribute value. [required]
Options:
--help: Show this message and exit.
dhis2 metadata attribute delete¶
Remove one attribute value from any resource; exit 0 regardless of whether it existed.
Usage:
Arguments:
RESOURCE: Plural DHIS2 resource name. [required]RESOURCE_UID: UID of the resource instance. [required]ATTRIBUTE: Attribute UID or business code. [required]
Options:
--help: Show this message and exit.
dhis2 metadata attribute find¶
Reverse lookup across any resource — list every UID whose attribute value matches.
Returns UIDs only (one per line) to keep the helper generic across
resource types. Pipe into dhis2 metadata get <resource> <uid> or
dhis2 metadata list <resource> --filter id:in:[...] for typed
follow-ups.
Usage:
Arguments:
RESOURCE: Plural DHIS2 resource name. [required]ATTRIBUTE: Attribute UID or business code. [required]VALUE: Attribute value to match exactly. [required]
Options:
--filter TEXT: Extra DHIS2 filter constraints to narrow the search (e.g.domainType:eq:AGGREGATE). Repeatable.--help: Show this message and exit.
dhis2 metadata program-rule¶
Program rule workflows (show / vars-for / validate / where-de-is-used).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every ProgramRule (optionally scoped...list: List every ProgramRule (optionally scoped...get: Show one ProgramRule with its condition,...vars-for: List everyProgramRuleVariablein scope...validate-expression: Parse-check a program-rule condition...where-de-is-used: Impact analysis — list every rule whose...
dhis2 metadata program-rule ls¶
List every ProgramRule (optionally scoped to one program), sorted by priority.
Usage:
Options:
--program TEXT: Program UID; omit to list every rule on the instance.--help: Show this message and exit.
dhis2 metadata program-rule list¶
List every ProgramRule (optionally scoped to one program), sorted by priority.
Usage:
Options:
--program TEXT: Program UID; omit to list every rule on the instance.--help: Show this message and exit.
dhis2 metadata program-rule get¶
Show one ProgramRule with its condition, priority, and every action.
Usage:
Arguments:
RULE_UID: ProgramRule UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata program-rule vars-for¶
List every ProgramRuleVariable in scope for a program, sorted by name.
Usage:
Arguments:
PROGRAM_UID: Program UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata program-rule validate-expression¶
Parse-check a program-rule condition expression.
DHIS2 doesn't expose a dedicated program-rule expression validator —
the closest is the program-indicator parser (used by default here),
which enforces stricter #{stage.de} syntax than program rules
accept. For the common #{variableName} shorthand program rules
use, the PI validator flags "Invalid Program Stage / DataElement
syntax" — not a real error, just the parser mismatch. Trust a clean
OK as definitely valid; read the specific message on ERROR to
distinguish parser mismatches from real syntax problems.
Usage:
Arguments:
EXPRESSION: Program-rule condition expression. [required]
Options:
--context TEXT: Which DHIS2 expression parser to use: program-indicator (default), validation-rule, indicator, predictor, or generic. [default: program-indicator]--help: Show this message and exit.
dhis2 metadata program-rule where-de-is-used¶
Impact analysis — list every rule whose actions reference this DataElement.
Useful before renaming / removing a DE: catches rules that'd stop
firing once the reference breaks. Exit 1 if nothing matches (safe
shorthand for grep -q pipelines).
Usage:
Arguments:
DATA_ELEMENT_UID: DataElement UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata sql-view¶
SQL view workflows (list / show / execute / refresh / adhoc).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every SqlView on the instance, sorted...list: List every SqlView on the instance, sorted...get: Show one SqlView's metadata + its stored...execute: Run a SqlView and render its rows as a...refresh: Refresh a MATERIALIZED_VIEW or lazily...adhoc: Register a throwaway SqlView from a .sql...
dhis2 metadata sql-view ls¶
List every SqlView on the instance, sorted by name.
Usage:
Options:
--type TEXT: Filter by SqlViewType: VIEW, MATERIALIZED_VIEW, or QUERY.--help: Show this message and exit.
dhis2 metadata sql-view list¶
List every SqlView on the instance, sorted by name.
Usage:
Options:
--type TEXT: Filter by SqlViewType: VIEW, MATERIALIZED_VIEW, or QUERY.--help: Show this message and exit.
dhis2 metadata sql-view get¶
Show one SqlView's metadata + its stored SQL body.
Usage:
Arguments:
VIEW_UID: SqlView UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata sql-view execute¶
Run a SqlView and render its rows as a table, JSON array, or CSV.
Usage:
Arguments:
VIEW_UID: SqlView UID. [required]
Options:
--var TEXT:${name}substitution for QUERY views, inname:valueform. Repeatable. DHIS2 strips non-alphanumeric characters from values server-side — wildcards belong in the SQL.--criteria TEXT: Column filter for VIEW / MATERIALIZED_VIEW results, incolumn:valueform. Repeatable.--format TEXT: Output format: table (default), json, or csv. [default: table]--help: Show this message and exit.
dhis2 metadata sql-view refresh¶
Refresh a MATERIALIZED_VIEW or lazily create a VIEW's DB object.
POST /api/sqlViews/{uid}/execute is idempotent for VIEW types — the
first call creates the Postgres view; subsequent calls are no-ops.
MATERIALIZED_VIEW types re-run the underlying SQL each call.
Usage:
Arguments:
VIEW_UID: SqlView UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata sql-view adhoc¶
Register a throwaway SqlView from a .sql file, execute once, delete it on the way out.
Designed for iterating on SQL without leaving test metadata behind. Subject to DHIS2's SQL allowlist — for fully free-form queries, see the Postgres injector example.
Usage:
Arguments:
NAME: Display name for the throwaway view. [required]SQL_PATH: .sql file containing the query body. [required]
Options:
--type TEXT: SqlViewType — QUERY (default), VIEW, or MATERIALIZED_VIEW. [default: QUERY]--keep: Leave the view in place afterwards instead of deleting.--var TEXT:${name}substitution inname:valueform. Repeatable.--format TEXT: Output format: table (default), json, or csv. [default: table]--help: Show this message and exit.
dhis2 metadata viz¶
Visualization authoring (list / show / create / clone / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every Visualization on the instance,...list: List every Visualization on the instance,...get: Show one Visualization with axes + data...create: Create a Visualization from flags — one...clone: Clone an existing Visualization with a...delete: Delete a Visualization.
dhis2 metadata viz ls¶
List every Visualization on the instance, sorted by name.
Usage:
Options:
--type TEXT: Filter by VisualizationType (LINE / COLUMN / PIVOT_TABLE / SINGLE_VALUE / ...).--help: Show this message and exit.
dhis2 metadata viz list¶
List every Visualization on the instance, sorted by name.
Usage:
Options:
--type TEXT: Filter by VisualizationType (LINE / COLUMN / PIVOT_TABLE / SINGLE_VALUE / ...).--help: Show this message and exit.
dhis2 metadata viz get¶
Show one Visualization with axes + data dimensions + period / ou selection.
Usage:
Arguments:
VIZ_UID: Visualization UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata viz create¶
Create a Visualization from flags — one command, no hand-rolled JSON.
Uses VisualizationSpec defaults per chart type: LINE / COLUMN / BAR /
etc. default to rows= / columns= / filters=; PIVOT_TABLE
defaults to rows= / columns= / filters=; SINGLE_VALUE
collapses to columns= / filters=. Override any slot with
--category-dim / --series-dim / --filter-dim.
Usage:
Options:
--name TEXT: Display name for the new Visualization. [required]--type TEXT: VisualizationType: LINE, COLUMN, STACKED_COLUMN, BAR, PIVOT_TABLE, SINGLE_VALUE, etc. [required]--data-element, --de TEXT: DataElement UID (repeat for multi-DE charts). [required]--period, --pe TEXT: Period ID (e.g. 202401, 2024Q1, 2024). Repeat for multi-period. [required]--org-unit, --ou TEXT: OrganisationUnit UID. Repeat for multi-OU. [required]--description TEXT: Optional long description.--uid TEXT: Explicit UID (11 chars). Auto-generates when omitted.--category-dim TEXT: Override category axis: dx / pe / ou.--series-dim TEXT: Override series dimension: dx / pe / ou.--filter-dim TEXT: Override filter dimension: dx / pe / ou.--help: Show this message and exit.
dhis2 metadata viz clone¶
Clone an existing Visualization with a fresh UID + new name.
Usage:
Arguments:
SOURCE_UID: Source Visualization UID. [required]
Options:
--new-name TEXT: Display name for the cloned Visualization. [required]--new-uid TEXT: Explicit UID for the clone (11 chars). Auto-generates when omitted.--new-description TEXT: Override the source's description on the clone.--help: Show this message and exit.
dhis2 metadata viz delete¶
Delete a Visualization.
Usage:
Arguments:
VIZ_UID: Visualization UID to delete. [required]
Options:
-y, --yes: Skip the confirmation prompt.--help: Show this message and exit.
dhis2 metadata dashboard¶
Dashboard composition (list / show / add-item / remove-item).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every Dashboard on the instance,...list: List every Dashboard on the instance,...get: Show one Dashboard with every...add-item: Add a Visualization or Map item to a...remove-item: Remove one dashboardItem by its UID.
dhis2 metadata dashboard ls¶
List every Dashboard on the instance, sorted by name.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata dashboard list¶
List every Dashboard on the instance, sorted by name.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata dashboard get¶
Show one Dashboard with every dashboardItem resolved inline.
Usage:
Arguments:
DASHBOARD_UID: Dashboard UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata dashboard add-item¶
Add a Visualization or Map item to a dashboard.
Pass --viz to add a VISUALIZATION item or --map to add a MAP item (exactly one required). Omit --x / --y / --width / --height to auto-stack below existing items (full width); supply them when you want side-by-side tiling.
Usage:
Arguments:
DASHBOARD_UID: Dashboard UID. [required]
Options:
--viz TEXT: Visualization UID (mutually exclusive with --map).--map TEXT: Map UID to add as a MAP-type dashboard item.--x INTEGER: Grid x coordinate (0-60). Auto-stacks when omitted.--y INTEGER: Grid y coordinate. Auto-stacks below existing when omitted.--width INTEGER: Slot width (1-60). Defaults to 60 when auto.--height INTEGER: Slot height. Defaults to 20 when auto.--help: Show this message and exit.
dhis2 metadata dashboard remove-item¶
Remove one dashboardItem by its UID.
Usage:
Arguments:
DASHBOARD_UID: Dashboard UID. [required]ITEM_UID: DashboardItem UID to remove. [required]
Options:
--help: Show this message and exit.
dhis2 metadata map¶
Map authoring (list / show / create / clone / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every Map on the instance, sorted by...list: List every Map on the instance, sorted by...get: Show one Map with its viewport + every...create: Create a single-layer thematic choropleth...clone: Clone an existing Map with a fresh UID +...delete: Delete a Map.
dhis2 metadata map ls¶
List every Map on the instance, sorted by name.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata map list¶
List every Map on the instance, sorted by name.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata map get¶
Show one Map with its viewport + every mapViews layer.
Usage:
Arguments:
MAP_UID: Map UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata map create¶
Create a single-layer thematic choropleth Map from flags.
Multi-layer maps need raw Map / MapView construction — use
client.maps.create_from_spec(MapSpec(layers=[...])) from the
library side and extend the spec to include boundary / facility
/ event layers.
Usage:
Options:
--name TEXT: Display name for the new Map. [required]--data-element, --de TEXT: DataElement UID for the thematic layer. [required]--period, --pe TEXT: Period ID. Repeat for multi-period. [required]--org-unit, --ou TEXT: OrganisationUnit UID (usually the parent boundary). Repeat for multi. [required]--ou-level INTEGER: OU hierarchy level(s) to render (e.g. 2 for provinces). Repeat for multi. [required]--description TEXT--uid TEXT: Explicit UID (11 chars). Auto-generates when omitted.--longitude FLOAT: [default: 15.0]--latitude FLOAT: [default: 0.0]--zoom INTEGER: [default: 4]--basemap TEXT: [default: openStreetMap]--classes INTEGER: Number of color classes on the choropleth. [default: 5]--color-low TEXT: Choropleth low-value colour (#hex). [default: #fef0d9]--color-high TEXT: Choropleth high-value colour (#hex). [default: #b30000]--help: Show this message and exit.
dhis2 metadata map clone¶
Clone an existing Map with a fresh UID + new name.
Usage:
Arguments:
SOURCE_UID: Source Map UID. [required]
Options:
--new-name TEXT: Display name for the cloned Map. [required]--new-uid TEXT: Explicit UID for the clone.--new-description TEXT--help: Show this message and exit.
dhis2 metadata map delete¶
Delete a Map.
Usage:
Arguments:
MAP_UID: Map UID to delete. [required]
Options:
-y, --yes: Skip the confirmation prompt.--help: Show this message and exit.
dhis2 metadata data-elements¶
DataElement authoring (list / show / create / rename / delete + legend-sets).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List DataElements with type + aggregation...list: List DataElements with type + aggregation...get: Show one DataElement with its references...create: Create a DataElement (defaults aggregate +...rename: Partial-update the label fields on a...set-legend-sets: Replace the legend-set refs on one...delete: Delete a DataElement — DHIS2 rejects...
dhis2 metadata data-elements ls¶
List DataElements with type + aggregation columns.
Usage:
Options:
--domain-type TEXT: Filter to AGGREGATE or TRACKER.--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata data-elements list¶
List DataElements with type + aggregation columns.
Usage:
Options:
--domain-type TEXT: Filter to AGGREGATE or TRACKER.--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata data-elements get¶
Show one DataElement with its references resolved inline.
Usage:
Arguments:
UID: DataElement UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata data-elements create¶
Create a DataElement (defaults aggregate + SUM + instance default categoryCombo).
Usage:
Options:
--name TEXT: Full name (<=230 chars). [required]--short-name TEXT: Short name (<=50 chars). [required]--value-type TEXT: DHIS2 ValueType, e.g. NUMBER / TEXT / INTEGER_POSITIVE. [required]--domain-type TEXT: AGGREGATE or TRACKER. [default: AGGREGATE]--aggregation-type TEXT: Default SUM. [default: SUM]--category-combo TEXT: CategoryCombo UID (defaults to the instance default).--option-set TEXT: OptionSet UID.--legend-set TEXT: LegendSet UID. Repeat for multiple.--code TEXT: Business code.--form-name TEXT: Form name override.--description TEXT: Free text.--uid TEXT: Explicit 11-char UID.--zero-significant / --no-zero-significant: Treat 0 as data, not absence. [default: no-zero-significant]--help: Show this message and exit.
dhis2 metadata data-elements rename¶
Partial-update the label fields on a DataElement (read, mutate, PUT).
Usage:
Arguments:
UID: DataElement UID. [required]
Options:
--name TEXT: New name.--short-name TEXT: New short name.--form-name TEXT: New form name.--description TEXT: New description.--help: Show this message and exit.
dhis2 metadata data-elements set-legend-sets¶
Replace the legend-set refs on one DataElement.
Usage:
Arguments:
UID: DataElement UID. [required]
Options:
--legend-set TEXT: LegendSet UID to attach. Repeat for multiple. Empty list clears. [required]--help: Show this message and exit.
dhis2 metadata data-elements delete¶
Delete a DataElement — DHIS2 rejects deletes on DEs with saved values.
Usage:
Arguments:
UID: DataElement UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata data-element-groups¶
DataElementGroup workflows (list / show / members / create / add-members / remove-members / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every DataElementGroup with member...list: List every DataElementGroup with member...get: Show one group with its member refs and...members: Page through DataElements inside one group.create: Create an empty DataElementGroup.add-members: Add--data-elementmembers via the...remove-members: Drop--data-elementmembers via the...delete: Delete the grouping row — member DEs stay.
dhis2 metadata data-element-groups ls¶
List every DataElementGroup with member counts.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata data-element-groups list¶
List every DataElementGroup with member counts.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata data-element-groups get¶
Show one group with its member refs and group-sets it belongs to.
Usage:
Arguments:
UID: DataElementGroup UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata data-element-groups members¶
Page through DataElements inside one group.
Usage:
Arguments:
UID: DataElementGroup UID. [required]
Options:
--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata data-element-groups create¶
Create an empty DataElementGroup.
Usage:
Options:
--name TEXT: Full name. [required]--short-name TEXT: Short name. [required]--uid TEXT: Explicit 11-char UID.--code TEXT: Business code.--description TEXT: Free text.--help: Show this message and exit.
dhis2 metadata data-element-groups add-members¶
Add --data-element members via the per-item POST shortcut.
Usage:
Arguments:
UID: DataElementGroup UID. [required]
Options:
-e, --data-element TEXT: DataElement UID to add. Repeat for multiple. [required]--help: Show this message and exit.
dhis2 metadata data-element-groups remove-members¶
Drop --data-element members via the per-item DELETE shortcut.
Usage:
Arguments:
UID: DataElementGroup UID. [required]
Options:
-e, --data-element TEXT: DataElement UID to drop. Repeat for multiple. [required]--help: Show this message and exit.
dhis2 metadata data-element-groups delete¶
Delete the grouping row — member DEs stay.
Usage:
Arguments:
UID: DataElementGroup UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata data-element-group-sets¶
DataElementGroupSet workflows (list / show / create / add-groups / remove-groups / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every DataElementGroupSet with group...list: List every DataElementGroupSet with group...get: Show one group set with its groups.create: Create an empty DataElementGroupSet.add-groups: Add--groupmembers to a group set.remove-groups: Drop--groupmembers from a group set.delete: Delete a DataElementGroupSet — member...
dhis2 metadata data-element-group-sets ls¶
List every DataElementGroupSet with group counts.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata data-element-group-sets list¶
List every DataElementGroupSet with group counts.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata data-element-group-sets get¶
Show one group set with its groups.
Usage:
Arguments:
UID: DataElementGroupSet UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata data-element-group-sets create¶
Create an empty DataElementGroupSet.
Usage:
Options:
--name TEXT: Full name. [required]--short-name TEXT: Short name. [required]--uid TEXT: Explicit 11-char UID.--code TEXT: Business code.--description TEXT: Free text.--compulsory / --not-compulsory: Require DEs to land in exactly one member group. [default: not-compulsory]--data-dimension / --no-data-dimension: Expose as analytics axis. [default: data-dimension]--help: Show this message and exit.
dhis2 metadata data-element-group-sets add-groups¶
Add --group members to a group set.
Usage:
Arguments:
UID: DataElementGroupSet UID. [required]
Options:
--group TEXT: DataElementGroup UID to add. Repeat for multiple. [required]--help: Show this message and exit.
dhis2 metadata data-element-group-sets remove-groups¶
Drop --group members from a group set.
Usage:
Arguments:
UID: DataElementGroupSet UID. [required]
Options:
--group TEXT: DataElementGroup UID to drop. Repeat for multiple. [required]--help: Show this message and exit.
dhis2 metadata data-element-group-sets delete¶
Delete a DataElementGroupSet — member groups stay.
Usage:
Arguments:
UID: DataElementGroupSet UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata indicators¶
Indicator authoring (list / show / create / rename / validate-expression / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List Indicators with type + expression...list: List Indicators with type + expression...get: Show one Indicator with expression pair +...create: Create an Indicator from a numerator /...rename: Partial-update label fields on an Indicator.validate-expression: Parse-check one indicator expression —...set-legend-sets: Replace the legend-set refs on one Indicator.delete: Delete an Indicator — DHIS2 rejects...
dhis2 metadata indicators ls¶
List Indicators with type + expression summary columns.
Usage:
Options:
--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata indicators list¶
List Indicators with type + expression summary columns.
Usage:
Options:
--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata indicators get¶
Show one Indicator with expression pair + indicatorType resolved inline.
Usage:
Arguments:
UID: Indicator UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata indicators create¶
Create an Indicator from a numerator / denominator expression pair.
Usage:
Options:
--name TEXT: Full name (<=230 chars). [required]--short-name TEXT: Short name (<=50 chars). [required]--indicator-type TEXT: IndicatorType UID (pins the output scale). [required]--numerator TEXT: DHIS2 numerator expression, e.g. '#{deUid}'. [required]--denominator TEXT: DHIS2 denominator expression. [required]--numerator-desc TEXT: Human label for the numerator.--denominator-desc TEXT: Human label for the denominator.--legend-set TEXT: LegendSet UID. Repeat for multiple.--annualized / --not-annualized: Multiply by 365 / period days on aggregation. [default: not-annualized]--decimals INTEGER: Rendered decimal places.--code TEXT: Business code.--description TEXT: Free text.--uid TEXT: Explicit 11-char UID.--help: Show this message and exit.
dhis2 metadata indicators rename¶
Partial-update label fields on an Indicator.
Usage:
Arguments:
UID: Indicator UID. [required]
Options:
--name TEXT: New name.--short-name TEXT: New short name.--description TEXT: New description.--help: Show this message and exit.
dhis2 metadata indicators validate-expression¶
Parse-check one indicator expression — fast pre-flight before create.
Usage:
Arguments:
EXPRESSION: Numerator / denominator expression to validate. [required]
Options:
--help: Show this message and exit.
dhis2 metadata indicators set-legend-sets¶
Replace the legend-set refs on one Indicator.
Usage:
Arguments:
UID: Indicator UID. [required]
Options:
--legend-set TEXT: LegendSet UID to attach. Empty list clears. [required]--help: Show this message and exit.
dhis2 metadata indicators delete¶
Delete an Indicator — DHIS2 rejects deletes on indicators used in viz/dashboards.
Usage:
Arguments:
UID: Indicator UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata indicator-groups¶
IndicatorGroup workflows (list / show / members / create / add-members / remove-members / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every IndicatorGroup with member counts.list: List every IndicatorGroup with member counts.get: Show one group with its member refs.members: Page through Indicators inside one group.create: Create an empty IndicatorGroup.add-members: Add--indicatormembers via the per-item...remove-members: Drop--indicatormembers via the...delete: Delete the grouping row — member...
dhis2 metadata indicator-groups ls¶
List every IndicatorGroup with member counts.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata indicator-groups list¶
List every IndicatorGroup with member counts.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata indicator-groups get¶
Show one group with its member refs.
Usage:
Arguments:
UID: IndicatorGroup UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata indicator-groups members¶
Page through Indicators inside one group.
Usage:
Arguments:
UID: IndicatorGroup UID. [required]
Options:
--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata indicator-groups create¶
Create an empty IndicatorGroup.
Usage:
Options:
--name TEXT: Full name. [required]--short-name TEXT: Short name. [required]--uid TEXT: Explicit 11-char UID.--code TEXT: Business code.--description TEXT: Free text.--help: Show this message and exit.
dhis2 metadata indicator-groups add-members¶
Add --indicator members via the per-item POST shortcut.
Usage:
Arguments:
UID: IndicatorGroup UID. [required]
Options:
-i, --indicator TEXT: Indicator UID to add. Repeat for multiple. [required]--help: Show this message and exit.
dhis2 metadata indicator-groups remove-members¶
Drop --indicator members via the per-item DELETE shortcut.
Usage:
Arguments:
UID: IndicatorGroup UID. [required]
Options:
-i, --indicator TEXT: Indicator UID to drop. Repeat for multiple. [required]--help: Show this message and exit.
dhis2 metadata indicator-groups delete¶
Delete the grouping row — member indicators stay.
Usage:
Arguments:
UID: IndicatorGroup UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata indicator-group-sets¶
IndicatorGroupSet workflows (list / show / create / add-groups / remove-groups / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every IndicatorGroupSet with group...list: List every IndicatorGroupSet with group...get: Show one group set with its groups.create: Create an empty IndicatorGroupSet.add-groups: Add--groupmembers to a group set.remove-groups: Drop--groupmembers from a group set.delete: Delete an IndicatorGroupSet — member...
dhis2 metadata indicator-group-sets ls¶
List every IndicatorGroupSet with group counts.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata indicator-group-sets list¶
List every IndicatorGroupSet with group counts.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata indicator-group-sets get¶
Show one group set with its groups.
Usage:
Arguments:
UID: IndicatorGroupSet UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata indicator-group-sets create¶
Create an empty IndicatorGroupSet.
Usage:
Options:
--name TEXT: Full name. [required]--short-name TEXT: Short name. [required]--uid TEXT: Explicit 11-char UID.--code TEXT: Business code.--description TEXT: Free text.--compulsory / --not-compulsory: Require indicators to land in exactly one member group. [default: not-compulsory]--help: Show this message and exit.
dhis2 metadata indicator-group-sets add-groups¶
Add --group members to a group set.
Usage:
Arguments:
UID: IndicatorGroupSet UID. [required]
Options:
--group TEXT: IndicatorGroup UID to add. Repeat for multiple. [required]--help: Show this message and exit.
dhis2 metadata indicator-group-sets remove-groups¶
Drop --group members from a group set.
Usage:
Arguments:
UID: IndicatorGroupSet UID. [required]
Options:
--group TEXT: IndicatorGroup UID to drop. Repeat for multiple. [required]--help: Show this message and exit.
dhis2 metadata indicator-group-sets delete¶
Delete an IndicatorGroupSet — member groups stay.
Usage:
Arguments:
UID: IndicatorGroupSet UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata program-indicators¶
ProgramIndicator authoring (list / show / create / rename / validate-expression / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List ProgramIndicators with their program...list: List ProgramIndicators with their program...get: Show one ProgramIndicator with its...create: Create a ProgramIndicator for a given...rename: Partial-update label fields on a...validate-expression: Parse-check one program-indicator...set-legend-sets: Replace the legend-set refs on one...delete: Delete a ProgramIndicator — DHIS2 rejects...
dhis2 metadata program-indicators ls¶
List ProgramIndicators with their program + analytics-type columns.
Usage:
Options:
-p, --program TEXT: Scope to one program's PIs.--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata program-indicators list¶
List ProgramIndicators with their program + analytics-type columns.
Usage:
Options:
-p, --program TEXT: Scope to one program's PIs.--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata program-indicators get¶
Show one ProgramIndicator with its expression + filter resolved inline.
Usage:
Arguments:
UID: ProgramIndicator UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata program-indicators create¶
Create a ProgramIndicator for a given program.
Usage:
Options:
--name TEXT: Full name (<=230 chars). [required]--short-name TEXT: Short name (<=50 chars). [required]--program TEXT: Program UID — required. [required]--expression TEXT: DHIS2 expression (e.g. '#{deUid}'). [required]--analytics-type TEXT: EVENT (default) or ENROLLMENT. [default: EVENT]--filter TEXT: Boolean filter expression narrowing the rows.--description TEXT: Free text.--aggregation-type TEXT: Override the default SUM.--decimals INTEGER: Rendered decimal places.--legend-set TEXT: LegendSet UID. Repeat for multiple.--code TEXT: Business code.--uid TEXT: Explicit 11-char UID.--help: Show this message and exit.
dhis2 metadata program-indicators rename¶
Partial-update label fields on a ProgramIndicator.
Usage:
Arguments:
UID: ProgramIndicator UID. [required]
Options:
--name TEXT: New name.--short-name TEXT: New short name.--description TEXT: New description.--help: Show this message and exit.
dhis2 metadata program-indicators validate-expression¶
Parse-check one program-indicator expression — fast pre-flight before create.
Usage:
Arguments:
EXPRESSION: Program-indicator expression to validate. [required]
Options:
--help: Show this message and exit.
dhis2 metadata program-indicators set-legend-sets¶
Replace the legend-set refs on one ProgramIndicator.
Usage:
Arguments:
UID: ProgramIndicator UID. [required]
Options:
--legend-set TEXT: LegendSet UID to attach. Empty list clears. [required]--help: Show this message and exit.
dhis2 metadata program-indicators delete¶
Delete a ProgramIndicator — DHIS2 rejects deletes on PIs used in viz / dashboards.
Usage:
Arguments:
UID: ProgramIndicator UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata program-indicator-groups¶
ProgramIndicatorGroup workflows (list / show / members / create / add-members / remove-members / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every ProgramIndicatorGroup with...list: List every ProgramIndicatorGroup with...get: Show one group with its member refs.members: Page through ProgramIndicators inside one...create: Create an empty ProgramIndicatorGroup.add-members: Add--program-indicatormembers via the...remove-members: Drop--program-indicatormembers via the...delete: Delete the grouping row — member program...
dhis2 metadata program-indicator-groups ls¶
List every ProgramIndicatorGroup with member counts.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata program-indicator-groups list¶
List every ProgramIndicatorGroup with member counts.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata program-indicator-groups get¶
Show one group with its member refs.
Usage:
Arguments:
UID: ProgramIndicatorGroup UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata program-indicator-groups members¶
Page through ProgramIndicators inside one group.
Usage:
Arguments:
UID: ProgramIndicatorGroup UID. [required]
Options:
--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata program-indicator-groups create¶
Create an empty ProgramIndicatorGroup.
Usage:
Options:
--name TEXT: Full name. [required]--short-name TEXT: Short name. [required]--uid TEXT: Explicit 11-char UID.--code TEXT: Business code.--description TEXT: Free text.--help: Show this message and exit.
dhis2 metadata program-indicator-groups add-members¶
Add --program-indicator members via the per-item POST shortcut.
Usage:
Arguments:
UID: ProgramIndicatorGroup UID. [required]
Options:
-i, --program-indicator TEXT: ProgramIndicator UID to add. Repeat for multiple. [required]--help: Show this message and exit.
dhis2 metadata program-indicator-groups remove-members¶
Drop --program-indicator members via the per-item DELETE shortcut.
Usage:
Arguments:
UID: ProgramIndicatorGroup UID. [required]
Options:
-i, --program-indicator TEXT: ProgramIndicator UID to drop. Repeat for multiple. [required]--help: Show this message and exit.
dhis2 metadata program-indicator-groups delete¶
Delete the grouping row — member program indicators stay.
Usage:
Arguments:
UID: ProgramIndicatorGroup UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata category-options¶
CategoryOption authoring (list / show / create / rename / set-validity / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List CategoryOptions with their validity...list: List CategoryOptions with their validity...get: Show one CategoryOption with its...create: Create a CategoryOption.rename: Partial-update the label fields on a...set-validity: Set thestartDate/endDatevalidity...delete: Delete a CategoryOption — DHIS2 rejects...
dhis2 metadata category-options ls¶
List CategoryOptions with their validity window columns.
Usage:
Options:
--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata category-options list¶
List CategoryOptions with their validity window columns.
Usage:
Options:
--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata category-options get¶
Show one CategoryOption with its categories + groups inline.
Usage:
Arguments:
UID: CategoryOption UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata category-options create¶
Create a CategoryOption. Omit --start-date/--end-date for an always-valid option.
Usage:
Options:
--name TEXT: Full name (<=230 chars). [required]--short-name TEXT: Short name (<=50 chars). [required]--code TEXT: Business code.--description TEXT: Free text.--form-name TEXT: Form name override.--start-date TEXT: ISO-8601 date — beginning of validity window.--end-date TEXT: ISO-8601 date — end of validity window.--uid TEXT: Explicit 11-char UID.--help: Show this message and exit.
dhis2 metadata category-options rename¶
Partial-update the label fields on a CategoryOption.
Usage:
Arguments:
UID: CategoryOption UID. [required]
Options:
--name TEXT: New name.--short-name TEXT: New short name.--form-name TEXT: New form name.--description TEXT: New description.--help: Show this message and exit.
dhis2 metadata category-options set-validity¶
Set the startDate / endDate validity window on a CategoryOption.
Usage:
Arguments:
UID: CategoryOption UID. [required]
Options:
--start-date TEXT: ISO-8601 date (empty to clear).--end-date TEXT: ISO-8601 date (empty to clear).--help: Show this message and exit.
dhis2 metadata category-options delete¶
Delete a CategoryOption — DHIS2 rejects deletes on options in use.
Usage:
Arguments:
UID: CategoryOption UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata category-option-groups¶
CategoryOptionGroup workflows (list / show / members / create / add-members / remove-members / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every CategoryOptionGroup with member...list: List every CategoryOptionGroup with member...get: Show one group with its member + group-set...members: Page through CategoryOptions inside one...create: Create an empty CategoryOptionGroup.add-members: Add--category-optionmembers via the...remove-members: Drop--category-optionmembers via the...delete: Delete the grouping row — member category...
dhis2 metadata category-option-groups ls¶
List every CategoryOptionGroup with member counts.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata category-option-groups list¶
List every CategoryOptionGroup with member counts.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata category-option-groups get¶
Show one group with its member + group-set refs.
Usage:
Arguments:
UID: CategoryOptionGroup UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata category-option-groups members¶
Page through CategoryOptions inside one group.
Usage:
Arguments:
UID: CategoryOptionGroup UID. [required]
Options:
--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata category-option-groups create¶
Create an empty CategoryOptionGroup.
Usage:
Options:
--name TEXT: Full name. [required]--short-name TEXT: Short name. [required]--data-dimension-type TEXT: DISAGGREGATION (default) or ATTRIBUTE. [default: DISAGGREGATION]--uid TEXT: Explicit 11-char UID.--code TEXT: Business code.--description TEXT: Free text.--help: Show this message and exit.
dhis2 metadata category-option-groups add-members¶
Add --category-option members via the per-item POST shortcut.
Usage:
Arguments:
UID: CategoryOptionGroup UID. [required]
Options:
-c, --category-option TEXT: CategoryOption UID to add. Repeat for multiple. [required]--help: Show this message and exit.
dhis2 metadata category-option-groups remove-members¶
Drop --category-option members via the per-item DELETE shortcut.
Usage:
Arguments:
UID: CategoryOptionGroup UID. [required]
Options:
-c, --category-option TEXT: CategoryOption UID to drop. Repeat for multiple. [required]--help: Show this message and exit.
dhis2 metadata category-option-groups delete¶
Delete the grouping row — member category options stay.
Usage:
Arguments:
UID: CategoryOptionGroup UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata category-option-group-sets¶
CategoryOptionGroupSet workflows (list / show / create / add-groups / remove-groups / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every CategoryOptionGroupSet.list: List every CategoryOptionGroupSet.get: Show one group set with its groups.create: Create an empty CategoryOptionGroupSet.add-groups: Add--groupmembers to a group set.remove-groups: Drop--groupmembers from a group set.delete: Delete a CategoryOptionGroupSet — member...
dhis2 metadata category-option-group-sets ls¶
List every CategoryOptionGroupSet.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata category-option-group-sets list¶
List every CategoryOptionGroupSet.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata category-option-group-sets get¶
Show one group set with its groups.
Usage:
Arguments:
UID: CategoryOptionGroupSet UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata category-option-group-sets create¶
Create an empty CategoryOptionGroupSet.
Usage:
Options:
--name TEXT: Full name. [required]--short-name TEXT: Short name. [required]--data-dimension-type TEXT: DISAGGREGATION (default) or ATTRIBUTE. [default: DISAGGREGATION]--data-dimension / --no-data-dimension: Expose as analytics axis. [default: data-dimension]--uid TEXT: Explicit 11-char UID.--code TEXT: Business code.--description TEXT: Free text.--help: Show this message and exit.
dhis2 metadata category-option-group-sets add-groups¶
Add --group members to a group set.
Usage:
Arguments:
UID: CategoryOptionGroupSet UID. [required]
Options:
--group TEXT: CategoryOptionGroup UID to add. Repeat for multiple. [required]--help: Show this message and exit.
dhis2 metadata category-option-group-sets remove-groups¶
Drop --group members from a group set.
Usage:
Arguments:
UID: CategoryOptionGroupSet UID. [required]
Options:
--group TEXT: CategoryOptionGroup UID to drop. Repeat for multiple. [required]--help: Show this message and exit.
dhis2 metadata category-option-group-sets delete¶
Delete a CategoryOptionGroupSet — member groups stay.
Usage:
Arguments:
UID: CategoryOptionGroupSet UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata categories¶
Category authoring (list / show / create / rename / add-option / remove-option / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List Categories with their option counts.list: List Categories with their option counts.get: Show one Category with its options inline.create: Create a Category, optionally wiring...rename: Partial-update the label fields on a...add-option: Append a CategoryOption to this Category's...remove-option: Remove a CategoryOption from this...delete: Delete a Category — DHIS2 rejects deletes...
dhis2 metadata categories ls¶
List Categories with their option counts.
Usage:
Options:
--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata categories list¶
List Categories with their option counts.
Usage:
Options:
--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata categories get¶
Show one Category with its options inline.
Usage:
Arguments:
UID: Category UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata categories create¶
Create a Category, optionally wiring CategoryOption members on create.
Usage:
Options:
--name TEXT: Full name (<=230 chars). [required]--short-name TEXT: Short name (<=50 chars). [required]--code TEXT: Business code.--description TEXT: Free text.--type TEXT: DISAGGREGATION (default) or ATTRIBUTE. [default: DISAGGREGATION]--option TEXT: CategoryOption UID to wire on create. Repeatable; order is preserved on save.--uid TEXT: Explicit 11-char UID.--help: Show this message and exit.
dhis2 metadata categories rename¶
Partial-update the label fields on a Category.
Usage:
Arguments:
UID: Category UID. [required]
Options:
--name TEXT: New name.--short-name TEXT: New short name.--description TEXT: New description.--help: Show this message and exit.
dhis2 metadata categories add-option¶
Append a CategoryOption to this Category's ordered membership.
Usage:
Arguments:
UID: Category UID. [required]OPTION_UID: CategoryOption UID to append. [required]
Options:
--help: Show this message and exit.
dhis2 metadata categories remove-option¶
Remove a CategoryOption from this Category's membership.
Usage:
Arguments:
UID: Category UID. [required]OPTION_UID: CategoryOption UID to remove. [required]
Options:
--help: Show this message and exit.
dhis2 metadata categories delete¶
Delete a Category — DHIS2 rejects deletes on categories referenced by a CategoryCombo.
Usage:
Arguments:
UID: Category UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata category-combos¶
CategoryCombo authoring (list / show / create / rename / add-category / remove-category / wait-for-cocs / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List CategoryCombos with their category +...list: List CategoryCombos with their category +...get: Show one CategoryCombo with its category +...create: Create a CategoryCombo with an ordered...rename: Partial-update label fields on a...add-category: Append a Category to this combo's ordered...remove-category: Remove a Category from this combo's...wait-for-cocs: Block until the COC matrix on this combo...delete: Delete a CategoryCombo — DHIS2 rejects the...build: One-pass create-or-reuse for the full...
dhis2 metadata category-combos ls¶
List CategoryCombos with their category + materialised-COC counts.
Usage:
Options:
--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata category-combos list¶
List CategoryCombos with their category + materialised-COC counts.
Usage:
Options:
--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata category-combos get¶
Show one CategoryCombo with its category + COC refs inline.
Usage:
Arguments:
UID: CategoryCombo UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata category-combos create¶
Create a CategoryCombo with an ordered list of Category UIDs.
Usage:
Options:
--name TEXT: Full name (<=230 chars). [required]--category TEXT: Category UID. Repeatable; order is preserved on save and shapes the COC matrix. [required]--code TEXT: Business code.--type TEXT: DISAGGREGATION (default) or ATTRIBUTE. [default: DISAGGREGATION]--skip-total / --with-total: Omit the total aggregation row downstream tables draw from this combo. [default: with-total]--uid TEXT: Explicit 11-char UID.--help: Show this message and exit.
dhis2 metadata category-combos rename¶
Partial-update label fields on a CategoryCombo.
Usage:
Arguments:
UID: CategoryCombo UID. [required]
Options:
--name TEXT: New name.--code TEXT: New code.--help: Show this message and exit.
dhis2 metadata category-combos add-category¶
Append a Category to this combo's ordered membership.
DHIS2 regenerates the COC matrix server-side. Re-fetch the combo + use
wait-for-cocs if you need to block until the new matrix lands.
Usage:
Arguments:
UID: CategoryCombo UID. [required]CATEGORY_UID: Category UID to append. [required]
Options:
--help: Show this message and exit.
dhis2 metadata category-combos remove-category¶
Remove a Category from this combo's membership.
Usage:
Arguments:
UID: CategoryCombo UID. [required]CATEGORY_UID: Category UID to remove. [required]
Options:
--help: Show this message and exit.
dhis2 metadata category-combos wait-for-cocs¶
Block until the COC matrix on this combo reaches --expected.
Cold-start regen of a large combo can take tens of seconds, especially
under arm64 emulation. Use after create or add-category when the
next step depends on the matrix being ready.
Usage:
Arguments:
UID: CategoryCombo UID. [required]
Options:
--expected INTEGER: Expected total of CategoryOptionCombos materialised by this combo. [required]--timeout FLOAT: Seconds to wait before giving up (default 60). [default: 60.0]--poll FLOAT: Seconds between polls (default 1). [default: 1.0]--help: Show this message and exit.
dhis2 metadata category-combos delete¶
Delete a CategoryCombo — DHIS2 rejects the default combo + combos in use.
Usage:
Arguments:
UID: CategoryCombo UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata category-combos build¶
One-pass create-or-reuse for the full Category dimension stack.
Walks a declarative CategoryComboBuildSpec, ensuring every
CategoryOption -> Category -> CategoryCombo referenced exists
on the target. Idempotent — re-running the same spec is a no-op
modulo new options getting wired into existing categories. Polls
the COC matrix until the cross-product count lands.
Lookup is by name (DHIS2 enforces unique names on each layer).
Existing entries are reused; only missing entries get created.
Usage:
Options:
--spec TEXT: Path to a JSON CategoryComboBuildSpec, or-to read from stdin. Shape:{name, categories: [{name, options: [{name, ...}, ...]}, ...]}. [required]--timeout FLOAT: Seconds to wait for the COC matrix to settle (default 120). [default: 120.0]--poll FLOAT: Seconds between matrix polls (default 1). [default: 1.0]--help: Show this message and exit.
dhis2 metadata category-option-combos¶
CategoryOptionCombo read access (list / show / list-for-combo). DHIS2 owns writes.
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: Page through every CategoryOptionCombo...list: Page through every CategoryOptionCombo...get: Show one CategoryOptionCombo with its...list-for-combo: List every CategoryOptionCombo...
dhis2 metadata category-option-combos ls¶
Page through every CategoryOptionCombo across every CategoryCombo.
Usage:
Options:
--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata category-option-combos list¶
Page through every CategoryOptionCombo across every CategoryCombo.
Usage:
Options:
--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata category-option-combos get¶
Show one CategoryOptionCombo with its parent combo + option refs.
Usage:
Arguments:
UID: CategoryOptionCombo UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata category-option-combos list-for-combo¶
List every CategoryOptionCombo materialised by one CategoryCombo.
Usage:
Arguments:
COMBO_UID: CategoryCombo UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata data-sets¶
DataSet authoring (list / show / create / rename / add-element / remove-element / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List DataSets with period type + member...list: List DataSets with period type + member...get: Show one DataSet with its DSE + section +...create: Create a DataSet.rename: Partial-update the label fields on a DataSet.add-element: Attach a DataElement to the DataSet...remove-element: Detach a DataElement from the DataSet.delete: Delete a DataSet — DHIS2 rejects deletes...
dhis2 metadata data-sets ls¶
List DataSets with period type + member counts.
Usage:
Options:
--period-type TEXT: Filter by period type (Monthly / Weekly / Daily / …).--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata data-sets list¶
List DataSets with period type + member counts.
Usage:
Options:
--period-type TEXT: Filter by period type (Monthly / Weekly / Daily / …).--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata data-sets get¶
Show one DataSet with its DSE + section + OU counts inline.
Usage:
Arguments:
UID: DataSet UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata data-sets create¶
Create a DataSet.
Usage:
Options:
--name TEXT: Full name (<=230 chars). [required]--short-name TEXT: Short name (<=50 chars). [required]--period-type TEXT: Period type (Monthly, Weekly, Daily, Quarterly, Yearly, …). [required]-cc, --category-combo TEXT: CategoryCombo UID (defaults to the instance default).--code TEXT: Business code.--form-name TEXT: Form-name override.--description TEXT: Free text.--open-future-periods INTEGER: Number of future periods open for entry.--expiry-days INTEGER: Days after period-end that entry remains open.--timely-days INTEGER: Days after period-start considered on-time.--uid TEXT: Explicit 11-char UID.--help: Show this message and exit.
dhis2 metadata data-sets rename¶
Partial-update the label fields on a DataSet.
Usage:
Arguments:
UID: DataSet UID. [required]
Options:
--name TEXT: New name.--short-name TEXT: New short name.--form-name TEXT: New form name.--description TEXT: New description.--help: Show this message and exit.
dhis2 metadata data-sets add-element¶
Attach a DataElement to the DataSet (optionally with a per-set CategoryCombo override).
Usage:
Arguments:
DATA_SET_UID: DataSet UID. [required]DATA_ELEMENT_UID: DataElement UID to attach. [required]
Options:
-cc, --category-combo TEXT: CategoryCombo UID override for this DSE.--help: Show this message and exit.
dhis2 metadata data-sets remove-element¶
Detach a DataElement from the DataSet.
Usage:
Arguments:
DATA_SET_UID: DataSet UID. [required]DATA_ELEMENT_UID: DataElement UID to detach. [required]
Options:
--help: Show this message and exit.
dhis2 metadata data-sets delete¶
Delete a DataSet — DHIS2 rejects deletes on DataSets with saved values.
Usage:
Arguments:
UID: DataSet UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata sections¶
Section authoring (list / show / create / rename / add-element / remove-element / reorder / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List Sections, optionally scoped to a...list: List Sections, optionally scoped to a...get: Show one Section with its ordered DE list...create: Create a Section attached to a DataSet.rename: Partial-update the label / sort-order...add-element: Append (or insert at--position) a...remove-element: Remove a DataElement from the Section...reorder: Replace the Section'sdataElementswith...delete: Delete a Section — DEs stay on the parent...
dhis2 metadata sections ls¶
List Sections, optionally scoped to a single DataSet.
Usage:
Options:
-ds, --data-set TEXT: Narrow to sections in one DataSet.--page INTEGER: 1-based page number (ignored with --data-set). [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata sections list¶
List Sections, optionally scoped to a single DataSet.
Usage:
Options:
-ds, --data-set TEXT: Narrow to sections in one DataSet.--page INTEGER: 1-based page number (ignored with --data-set). [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata sections get¶
Show one Section with its ordered DE list inline.
Usage:
Arguments:
UID: Section UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata sections create¶
Create a Section attached to a DataSet. Repeat --data-element to seed the ordered DE list.
Usage:
Options:
--name TEXT: Section name (<=230 chars). [required]-ds, --data-set TEXT: Parent DataSet UID. [required]--sort-order INTEGER: Ordering within the DataSet (ascending).--description TEXT: Free text.--code TEXT: Business code.-de, --data-element TEXT: DataElement UID (repeatable, order preserved).-i, --indicator TEXT: Indicator UID to show in the side pane (repeatable).--show-column-totals / --no-show-column-totals: Render column totals.--show-row-totals / --no-show-row-totals: Render row totals.--uid TEXT: Explicit 11-char UID.--help: Show this message and exit.
dhis2 metadata sections rename¶
Partial-update the label / sort-order fields on a Section.
Usage:
Arguments:
UID: Section UID. [required]
Options:
--name TEXT: New name.--description TEXT: New description.--sort-order INTEGER: New sort order.--help: Show this message and exit.
dhis2 metadata sections add-element¶
Append (or insert at --position) a DataElement to the Section.
Usage:
Arguments:
SECTION_UID: Section UID. [required]DATA_ELEMENT_UID: DataElement UID. [required]
Options:
--position INTEGER: 0-indexed insertion position. Omit to append.--help: Show this message and exit.
dhis2 metadata sections remove-element¶
Remove a DataElement from the Section (stays on the parent DataSet).
Usage:
Arguments:
SECTION_UID: Section UID. [required]DATA_ELEMENT_UID: DataElement UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata sections reorder¶
Replace the Section's dataElements with exactly the given UIDs in order.
Usage:
Arguments:
SECTION_UID: Section UID. [required]DATA_ELEMENT_UIDS...: DataElement UIDs in the desired order. [required]
Options:
--help: Show this message and exit.
dhis2 metadata sections delete¶
Delete a Section — DEs stay on the parent DataSet.
Usage:
Arguments:
UID: Section UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata validation-rules¶
ValidationRule authoring (list / show / create / rename / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List ValidationRules with their operator +...list: List ValidationRules with their operator +...get: Show one ValidationRule with both...create: Create a ValidationRule.rename: Partial-update the label fields on a...delete: Delete a ValidationRule — any outstanding...
dhis2 metadata validation-rules ls¶
List ValidationRules with their operator + importance columns.
Usage:
Options:
--period-type TEXT: Filter by period type (Monthly / Weekly / …).--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata validation-rules list¶
List ValidationRules with their operator + importance columns.
Usage:
Options:
--period-type TEXT: Filter by period type (Monthly / Weekly / …).--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata validation-rules get¶
Show one ValidationRule with both expression sides inline.
Usage:
Arguments:
UID: ValidationRule UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata validation-rules create¶
Create a ValidationRule.
Usage:
Options:
--name TEXT: Rule name (<=230 chars). [required]--short-name TEXT: Short name (<=50 chars). [required]--left TEXT: Left-side expression (e.g. #{deUid}). [required]--operator TEXT: Comparison operator. [required]--right TEXT: Right-side expression. [required]--period-type TEXT: Period type. [default: Monthly]--importance TEXT: LOW / MEDIUM / HIGH. [default: MEDIUM]--missing-value-strategy TEXT: How to treat absent operands. [default: SKIP_IF_ALL_VALUES_MISSING]--description TEXT: Free-text description.--code TEXT: Business code.--ou-level INTEGER: OU depth (repeatable). E.g.--ou-level 4for facilities.--uid TEXT: Explicit 11-char UID.--help: Show this message and exit.
dhis2 metadata validation-rules rename¶
Partial-update the label fields on a ValidationRule.
Usage:
Arguments:
UID: ValidationRule UID. [required]
Options:
--name TEXT: New name.--short-name TEXT: New short name.--description TEXT: New description.--help: Show this message and exit.
dhis2 metadata validation-rules delete¶
Delete a ValidationRule — any outstanding results are purged.
Usage:
Arguments:
UID: ValidationRule UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata validation-rule-groups¶
ValidationRuleGroup workflows (list / show / members / create / add-members / remove-members / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every ValidationRuleGroup with member...list: List every ValidationRuleGroup with member...get: Show one group with its rule refs.members: Page through ValidationRules inside a group.create: Create an empty ValidationRuleGroup.add-members: Attach ValidationRules to a group.remove-members: Detach ValidationRules from a group.delete: Delete a ValidationRuleGroup — member...
dhis2 metadata validation-rule-groups ls¶
List every ValidationRuleGroup with member counts.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata validation-rule-groups list¶
List every ValidationRuleGroup with member counts.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata validation-rule-groups get¶
Show one group with its rule refs.
Usage:
Arguments:
UID: ValidationRuleGroup UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata validation-rule-groups members¶
Page through ValidationRules inside a group.
Usage:
Arguments:
UID: ValidationRuleGroup UID. [required]
Options:
--page INTEGER: 1-based page. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata validation-rule-groups create¶
Create an empty ValidationRuleGroup.
Usage:
Options:
--name TEXT: Group name. [required]--short-name TEXT: Short name.--code TEXT: Business code.--description TEXT: Free text.--uid TEXT: Explicit 11-char UID.--help: Show this message and exit.
dhis2 metadata validation-rule-groups add-members¶
Attach ValidationRules to a group.
Usage:
Arguments:
UID: ValidationRuleGroup UID. [required]
Options:
-r, --rule TEXT: ValidationRule UID (repeatable). [required]--help: Show this message and exit.
dhis2 metadata validation-rule-groups remove-members¶
Detach ValidationRules from a group.
Usage:
Arguments:
UID: ValidationRuleGroup UID. [required]
Options:
-r, --rule TEXT: ValidationRule UID (repeatable). [required]--help: Show this message and exit.
dhis2 metadata validation-rule-groups delete¶
Delete a ValidationRuleGroup — member rules stay.
Usage:
Arguments:
UID: ValidationRuleGroup UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata predictors¶
Predictor authoring (list / show / create / rename / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List Predictors with their output DE +...list: List Predictors with their output DE +...get: Show one Predictor with generator + output...create: Create a Predictor.rename: Partial-update the label fields on a...delete: Delete a Predictor.
dhis2 metadata predictors ls¶
List Predictors with their output DE + period columns.
Usage:
Options:
--period-type TEXT: Filter by period type.--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata predictors list¶
List Predictors with their output DE + period columns.
Usage:
Options:
--period-type TEXT: Filter by period type.--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata predictors get¶
Show one Predictor with generator + output inline.
Usage:
Arguments:
UID: Predictor UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata predictors create¶
Create a Predictor.
Usage:
Options:
--name TEXT: Predictor name. [required]--short-name TEXT: Short name. [required]--expression TEXT: Generator expression (e.g. #{deUid}). [required]-o, --output TEXT: Output DataElement UID. [required]--period-type TEXT: Period type. [default: Monthly]--sequential INTEGER: Sequential sample count (e.g. 3 for 3-month rolling). [default: 3]--annual INTEGER: Annual sample count. [default: 0]--ou-level TEXT: OrganisationUnitLevel UID (repeatable).--output-combo TEXT: Output CategoryOptionCombo UID.--description TEXT: Free text.--code TEXT: Business code.--uid TEXT: Explicit 11-char UID.--help: Show this message and exit.
dhis2 metadata predictors rename¶
Partial-update the label fields on a Predictor.
Usage:
Arguments:
UID: Predictor UID. [required]
Options:
--name TEXT: New name.--short-name TEXT: New short name.--description TEXT: New description.--help: Show this message and exit.
dhis2 metadata predictors delete¶
Delete a Predictor. DHIS2 keeps any data values it has already written.
Usage:
Arguments:
UID: Predictor UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata predictor-groups¶
PredictorGroup workflows (list / show / members / create / add-members / remove-members / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every PredictorGroup.list: List every PredictorGroup.get: Show one group with its predictor refs.members: Page through Predictors in a group.create: Create an empty PredictorGroup.add-members: Attach Predictors to a group.remove-members: Detach Predictors from a group.delete: Delete a PredictorGroup — member...
dhis2 metadata predictor-groups ls¶
List every PredictorGroup.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata predictor-groups list¶
List every PredictorGroup.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata predictor-groups get¶
Show one group with its predictor refs.
Usage:
Arguments:
UID: PredictorGroup UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata predictor-groups members¶
Page through Predictors in a group.
Usage:
Arguments:
UID: PredictorGroup UID. [required]
Options:
--page INTEGER: 1-based page. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata predictor-groups create¶
Create an empty PredictorGroup.
Usage:
Options:
--name TEXT: Group name. [required]--short-name TEXT: Short name.--code TEXT: Business code.--description TEXT: Free text.--uid TEXT: Explicit 11-char UID.--help: Show this message and exit.
dhis2 metadata predictor-groups add-members¶
Attach Predictors to a group.
Usage:
Arguments:
UID: PredictorGroup UID. [required]
Options:
-p, --predictor TEXT: Predictor UID (repeatable). [required]--help: Show this message and exit.
dhis2 metadata predictor-groups remove-members¶
Detach Predictors from a group.
Usage:
Arguments:
UID: PredictorGroup UID. [required]
Options:
-p, --predictor TEXT: Predictor UID (repeatable). [required]--help: Show this message and exit.
dhis2 metadata predictor-groups delete¶
Delete a PredictorGroup — member predictors stay.
Usage:
Arguments:
UID: PredictorGroup UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata tracked-entity-attributes¶
TrackedEntityAttribute authoring (list / show / create / rename / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List TrackedEntityAttributes with their...list: List TrackedEntityAttributes with their...get: Show one TrackedEntityAttribute with its...create: Create a TrackedEntityAttribute.rename: Partial-update the label fields on a...delete: Delete a TrackedEntityAttribute — DHIS2...
dhis2 metadata tracked-entity-attributes ls¶
List TrackedEntityAttributes with their valueType + unique/generated toggles.
Usage:
Options:
--value-type TEXT: Filter by valueType (TEXT / NUMBER / DATE / …).--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata tracked-entity-attributes list¶
List TrackedEntityAttributes with their valueType + unique/generated toggles.
Usage:
Options:
--value-type TEXT: Filter by valueType (TEXT / NUMBER / DATE / …).--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata tracked-entity-attributes get¶
Show one TrackedEntityAttribute with its toggles inline.
Usage:
Arguments:
UID: TrackedEntityAttribute UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata tracked-entity-attributes create¶
Create a TrackedEntityAttribute.
Usage:
Options:
--name TEXT: Attribute name (<=230 chars). [required]--short-name TEXT: Short name (<=50 chars). [required]--value-type TEXT: TEXT / NUMBER / DATE / … [default: TEXT]--aggregation-type TEXT: DHIS2 aggregation type. [default: NONE]--option-set TEXT: Constraining OptionSet UID.--legend-set TEXT: LegendSet UID (repeatable).--unique / --no-unique: Unique across the instance. [default: no-unique]--generated / --no-generated: Auto-generate via --pattern on TEI register. [default: no-generated]--confidential / --no-confidential: Sensitive. [default: no-confidential]--inherit / --no-inherit: Inherit on parent/child TEI link. [default: no-inherit]--display-in-list-no-program / --no-display-in-list-no-program: Show in the list when no program is selected. [default: no-display-in-list-no-program]--orgunit-scope / --no-orgunit-scope: Scope values to the capturing OU. [default: no-orgunit-scope]--pattern TEXT: Generator pattern (with --generated).--field-mask TEXT: Input mask for the data-entry field.--code TEXT: Business code.--form-name TEXT: Form-name override.--description TEXT: Free text.--uid TEXT: Explicit 11-char UID.--help: Show this message and exit.
dhis2 metadata tracked-entity-attributes rename¶
Partial-update the label fields on a TrackedEntityAttribute.
Usage:
Arguments:
UID: TrackedEntityAttribute UID. [required]
Options:
--name TEXT: New name.--short-name TEXT: New short name.--form-name TEXT: New form name.--description TEXT: New description.--help: Show this message and exit.
dhis2 metadata tracked-entity-attributes delete¶
Delete a TrackedEntityAttribute — DHIS2 rejects deletes on TEAs wired into a TET or program.
Usage:
Arguments:
UID: TrackedEntityAttribute UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata tracked-entity-types¶
TrackedEntityType authoring (list / show / create / rename / add-attribute / remove-attribute / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List TrackedEntityTypes with...list: List TrackedEntityTypes with...get: Show one TrackedEntityType with its...create: Create a TrackedEntityType.rename: Partial-update the label fields on a...add-attribute: Attach a TrackedEntityAttribute to a...remove-attribute: Detach a TrackedEntityAttribute from a...delete: Delete a TrackedEntityType — DHIS2 rejects...
dhis2 metadata tracked-entity-types ls¶
List TrackedEntityTypes with attribute-count column.
Usage:
Options:
--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata tracked-entity-types list¶
List TrackedEntityTypes with attribute-count column.
Usage:
Options:
--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata tracked-entity-types get¶
Show one TrackedEntityType with its attribute link-table counts.
Usage:
Arguments:
UID: TrackedEntityType UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata tracked-entity-types create¶
Create a TrackedEntityType.
Usage:
Options:
--name TEXT: TET name (<=230 chars). [required]--short-name TEXT: Short name (<=50 chars). [required]--description TEXT: Free text.--code TEXT: Business code.--form-name TEXT: Form-name override.--allow-audit-log / --no-allow-audit-log: Enable the per-TEI audit trail.--feature-type TEXT: NONE / POINT / POLYGON — geometry captured per TEI.--min-attrs INTEGER: Min attributes required to search TEIs.--max-tei INTEGER: Max TEI count to return per search.--uid TEXT: Explicit 11-char UID.--help: Show this message and exit.
dhis2 metadata tracked-entity-types rename¶
Partial-update the label fields on a TrackedEntityType.
Usage:
Arguments:
UID: TrackedEntityType UID. [required]
Options:
--name TEXT: New name.--short-name TEXT: New short name.--form-name TEXT: New form name.--description TEXT: New description.--help: Show this message and exit.
dhis2 metadata tracked-entity-types add-attribute¶
Attach a TrackedEntityAttribute to a TrackedEntityType.
Usage:
Arguments:
TET_UID: TrackedEntityType UID. [required]ATTRIBUTE_UID: TrackedEntityAttribute UID to wire in. [required]
Options:
--mandatory / --no-mandatory: Require on enrollment. [default: no-mandatory]--searchable / --no-searchable: Include in TEI search. [default: no-searchable]--display-in-list / --no-display-in-list: Show in the enrolled-TEI list. [default: display-in-list]--help: Show this message and exit.
dhis2 metadata tracked-entity-types remove-attribute¶
Detach a TrackedEntityAttribute from a TrackedEntityType.
Usage:
Arguments:
TET_UID: TrackedEntityType UID. [required]ATTRIBUTE_UID: TrackedEntityAttribute UID to detach. [required]
Options:
--help: Show this message and exit.
dhis2 metadata tracked-entity-types delete¶
Delete a TrackedEntityType — DHIS2 rejects deletes on TETs in use by enrolled TEIs.
Usage:
Arguments:
UID: TrackedEntityType UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata programs¶
Program authoring (list / show / create / rename / add-attribute / remove-attribute / add-to-ou / remove-from-ou / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List Programs with their programType +...list: List Programs with their programType +...get: Show one Program with counts inline.create: Create a Program.rename: Partial-update the label fields on a Program.add-attribute: Attach a TrackedEntityAttribute to the...remove-attribute: Detach a TrackedEntityAttribute from the...add-to-ou: Scope the Program to another...remove-from-ou: Drop an OrganisationUnit from the...delete: Delete a Program — DHIS2 rejects deletes...
dhis2 metadata programs ls¶
List Programs with their programType + stage counts.
Usage:
Options:
--program-type TEXT: Filter by WITH_REGISTRATION or WITHOUT_REGISTRATION.--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata programs list¶
List Programs with their programType + stage counts.
Usage:
Options:
--program-type TEXT: Filter by WITH_REGISTRATION or WITHOUT_REGISTRATION.--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata programs get¶
Show one Program with counts inline.
Usage:
Arguments:
UID: Program UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata programs create¶
Create a Program. --program-type WITH_REGISTRATION requires --tracked-entity-type.
Usage:
Options:
--name TEXT: Program name (<=230 chars). [required]--short-name TEXT: Short name (<=50 chars). [required]--program-type TEXT: WITH_REGISTRATION (tracker) or WITHOUT_REGISTRATION (event). [default: WITH_REGISTRATION]-tet, --tracked-entity-type TEXT: TET UID. Required for WITH_REGISTRATION.-cc, --category-combo TEXT: CategoryCombo UID (defaults to the instance default).--description TEXT: Free text.--code TEXT: Business code.--form-name TEXT: Form-name override.--display-incident-date / --no-display-incident-date: Capture an incident date.--enrollment-date-label TEXT: Custom enrollment-date label.--incident-date-label TEXT: Custom incident-date label.--feature-type TEXT: Geometry captured per enrollment (NONE / POINT / POLYGON).--only-enroll-once / --no-only-enroll-once: Block re-enrollment of the same TEI.--expiry-days INTEGER: Days after which enrollments expire for edit.--min-attrs INTEGER: Min attributes required for TEI search.--max-tei INTEGER: Max TEI count per search.--use-first-stage-during-registration / --no-use-first-stage-during-registration: Run the first ProgramStage inside the enrollment flow.--uid TEXT: Explicit 11-char UID.--help: Show this message and exit.
dhis2 metadata programs rename¶
Partial-update the label fields on a Program.
Usage:
Arguments:
UID: Program UID. [required]
Options:
--name TEXT: New name.--short-name TEXT: New short name.--form-name TEXT: New form name.--description TEXT: New description.--help: Show this message and exit.
dhis2 metadata programs add-attribute¶
Attach a TrackedEntityAttribute to the Program's enrollment form.
Usage:
Arguments:
PROGRAM_UID: Program UID. [required]ATTRIBUTE_UID: TrackedEntityAttribute UID. [required]
Options:
--mandatory / --no-mandatory: Require on enrollment. [default: no-mandatory]--searchable / --no-searchable: Include in search. [default: no-searchable]--display-in-list / --no-display-in-list: Show in enrolled-TEI list. [default: display-in-list]--sort-order INTEGER: Position on enrollment form.--allow-future-date / --no-allow-future-date: Permit dates past today. [default: no-allow-future-date]--render-options-as-radio / --no-render-options-as-radio: Render option-set choices as radios instead of a dropdown. [default: no-render-options-as-radio]--help: Show this message and exit.
dhis2 metadata programs remove-attribute¶
Detach a TrackedEntityAttribute from the Program's enrollment form.
Usage:
Arguments:
PROGRAM_UID: Program UID. [required]ATTRIBUTE_UID: TrackedEntityAttribute UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata programs add-to-ou¶
Scope the Program to another OrganisationUnit.
Usage:
Arguments:
PROGRAM_UID: Program UID. [required]ORGANISATION_UNIT_UID: OrganisationUnit UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata programs remove-from-ou¶
Drop an OrganisationUnit from the Program's scope.
Usage:
Arguments:
PROGRAM_UID: Program UID. [required]ORGANISATION_UNIT_UID: OrganisationUnit UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata programs delete¶
Delete a Program — DHIS2 rejects deletes on programs with enrollments or events.
Usage:
Arguments:
UID: Program UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata program-stages¶
ProgramStage authoring (list / show / create / rename / add-element / remove-element / reorder / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List ProgramStages with sort-order +...list: List ProgramStages with sort-order +...get: Show one ProgramStage with its PSDE list...create: Create a ProgramStage under--program.rename: Partial-update the label fields on a...add-element: Attach a DataElement to the ProgramStage.remove-element: Detach a DataElement from the ProgramStage.reorder: Replace the ProgramStage's PSDE list with...delete: Delete a ProgramStage — DHIS2 rejects...
dhis2 metadata program-stages ls¶
List ProgramStages with sort-order + PSDE-count columns.
Usage:
Options:
-p, --program TEXT: Filter to stages belonging to one Program UID.--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata program-stages list¶
List ProgramStages with sort-order + PSDE-count columns.
Usage:
Options:
-p, --program TEXT: Filter to stages belonging to one Program UID.--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata program-stages get¶
Show one ProgramStage with its PSDE list summary inline.
Usage:
Arguments:
UID: ProgramStage UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata program-stages create¶
Create a ProgramStage under --program.
Usage:
Options:
--name TEXT: ProgramStage name (<=230 chars). [required]-p, --program TEXT: Parent Program UID. [required]--short-name TEXT: Short name.--description TEXT: Free text.--code TEXT: Business code.--sort-order INTEGER: Stage order inside the Program.--repeatable / --no-repeatable: Allow the stage to reoccur within one enrollment.--auto-generate-event / --no-auto-generate-event: Auto-create an event when the enrollment starts.--generated-by-enrollment-date / --no-generated-by-enrollment-date: Base due-date math on enrollment date (vs incident date).--feature-type TEXT: Geometry captured per event (NONE / POINT / POLYGON).--period-type TEXT: Period type for scheduled events.--validation-strategy TEXT: ON_COMPLETE / ON_UPDATE_AND_INSERT.--min-days INTEGER: Minimum days from enrollment start before the stage opens.--standard-interval INTEGER: Default days between scheduled repeats.--uid TEXT: Explicit 11-char UID.--help: Show this message and exit.
dhis2 metadata program-stages rename¶
Partial-update the label fields on a ProgramStage.
Usage:
Arguments:
UID: ProgramStage UID. [required]
Options:
--name TEXT: New name.--short-name TEXT: New short name.--form-name TEXT: New form name.--description TEXT: New description.--help: Show this message and exit.
dhis2 metadata program-stages add-element¶
Attach a DataElement to the ProgramStage.
Usage:
Arguments:
STAGE_UID: ProgramStage UID. [required]DATA_ELEMENT_UID: DataElement UID to attach. [required]
Options:
--compulsory / --no-compulsory: Required on save. [default: no-compulsory]--allow-future-date / --no-allow-future-date: Permit dates past today. [default: no-allow-future-date]--display-in-reports / --no-display-in-reports: Show in event reports. [default: display-in-reports]--allow-provided-elsewhere / --no-allow-provided-elsewhere: Mark the value as provided by a different OU. [default: no-allow-provided-elsewhere]--render-options-as-radio / --no-render-options-as-radio: Render option-set picklists as radios. [default: no-render-options-as-radio]--sort-order INTEGER: Position inside the stage data-entry form.--help: Show this message and exit.
dhis2 metadata program-stages remove-element¶
Detach a DataElement from the ProgramStage.
Usage:
Arguments:
STAGE_UID: ProgramStage UID. [required]DATA_ELEMENT_UID: DataElement UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata program-stages reorder¶
Replace the ProgramStage's PSDE list with exactly the given DE UIDs in order.
Usage:
Arguments:
STAGE_UID: ProgramStage UID. [required]DATA_ELEMENT_UIDS...: DataElement UIDs in the desired order. [required]
Options:
--help: Show this message and exit.
dhis2 metadata program-stages delete¶
Delete a ProgramStage — DHIS2 rejects deletes on stages with recorded events.
Usage:
Arguments:
UID: ProgramStage UID. [required]
Options:
-y, --yes: Skip confirmation.--help: Show this message and exit.
dhis2 metadata organisation-units¶
OrganisationUnit hierarchy workflows (list / show / tree / create / move / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List organisation units with parent +...list: List organisation units with parent +...get: Show one OU with parent + core hierarchy...tree: Render a bounded-depth subtree indented by...create: Create a child OU underparent_uid.move: Reparent an OU.delete: Delete an OU.
dhis2 metadata organisation-units ls¶
List organisation units with parent + hierarchy columns.
Server-side paged so large trees don't stream into memory at once.
Combine with --level N to sweep a single rung ("every district",
"every facility").
Usage:
Options:
--level INTEGER: Filter by hierarchy level (1 = roots).--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata organisation-units list¶
List organisation units with parent + hierarchy columns.
Server-side paged so large trees don't stream into memory at once.
Combine with --level N to sweep a single rung ("every district",
"every facility").
Usage:
Options:
--level INTEGER: Filter by hierarchy level (1 = roots).--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata organisation-units get¶
Show one OU with parent + core hierarchy fields.
Usage:
Arguments:
UID: OrganisationUnit UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata organisation-units tree¶
Render a bounded-depth subtree indented by hierarchy level.
Usage:
Arguments:
ROOT_UID: Root OU UID — render this + descendants. [required]
Options:
--max-depth INTEGER: Depth of descendants to include (0 = just the root). [default: 3]--help: Show this message and exit.
dhis2 metadata organisation-units create¶
Create a child OU under parent_uid.
Usage:
Arguments:
PARENT_UID: Parent OU UID to create under. [required]
Options:
--name TEXT: Full name (<=230 chars). [required]--short-name TEXT: Short name (<=50 chars). [required]--opening-date TEXT: ISO-8601 date, e.g. 2024-01-01. [required]--uid TEXT: Explicit 11-char UID (generated when omitted).--code TEXT: Business code.--description TEXT: Free-text description.--help: Show this message and exit.
dhis2 metadata organisation-units move¶
Reparent an OU. DHIS2 recomputes path + hierarchyLevel.
Usage:
Arguments:
UID: OU UID to reparent. [required]NEW_PARENT_UID: New parent OU UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata organisation-units delete¶
Delete an OU. DHIS2 rejects deletes on units with children or data.
Usage:
Arguments:
UID: OU UID to delete. [required]
Options:
-y, --yes: Skip the confirmation prompt.--help: Show this message and exit.
dhis2 metadata organisation-unit-groups¶
OrganisationUnitGroup workflows (list / show / members / create / add-members / remove-members / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every OrganisationUnitGroup with...list: List every OrganisationUnitGroup with...get: Show one group with its member refs and...members: Page through the OUs inside one group.create: Create an empty OrganisationUnitGroup.add-members: Add--oumembers to a group via the...remove-members: Drop--oumembers from a group via the...delete: Delete an OrganisationUnitGroup — members...
dhis2 metadata organisation-unit-groups ls¶
List every OrganisationUnitGroup with member counts.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata organisation-unit-groups list¶
List every OrganisationUnitGroup with member counts.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata organisation-unit-groups get¶
Show one group with its member refs and the group-sets it belongs to.
Usage:
Arguments:
UID: OrganisationUnitGroup UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata organisation-unit-groups members¶
Page through the OUs inside one group.
Usage:
Arguments:
UID: OrganisationUnitGroup UID. [required]
Options:
--page INTEGER: 1-based page number. [default: 1]--page-size INTEGER: Rows per page. [default: 50]--help: Show this message and exit.
dhis2 metadata organisation-unit-groups create¶
Create an empty OrganisationUnitGroup.
Usage:
Options:
--name TEXT: Full name (<=230 chars, unique). [required]--short-name TEXT: Short name (<=50 chars, unique). [required]--uid TEXT: Explicit 11-char UID (generated when omitted).--code TEXT: Business code.--description TEXT: Free-text description.--color TEXT: Hex colour (#RRGGBB).--help: Show this message and exit.
dhis2 metadata organisation-unit-groups add-members¶
Add --ou members to a group via the per-item POST shortcut.
Usage:
Arguments:
UID: OrganisationUnitGroup UID. [required]
Options:
--ou TEXT: OU UID to add. Repeat for multiple. [required]--help: Show this message and exit.
dhis2 metadata organisation-unit-groups remove-members¶
Drop --ou members from a group via the per-item DELETE shortcut.
Usage:
Arguments:
UID: OrganisationUnitGroup UID. [required]
Options:
--ou TEXT: OU UID to remove. Repeat for multiple. [required]--help: Show this message and exit.
dhis2 metadata organisation-unit-groups delete¶
Delete an OrganisationUnitGroup — members stay.
Usage:
Arguments:
UID: OrganisationUnitGroup UID to delete. [required]
Options:
-y, --yes: Skip the confirmation prompt.--help: Show this message and exit.
dhis2 metadata organisation-unit-group-sets¶
OrganisationUnitGroupSet workflows (list / show / create / add-groups / remove-groups / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every OrganisationUnitGroupSet with...list: List every OrganisationUnitGroupSet with...get: Show one group set with its groups +...create: Create an empty OrganisationUnitGroupSet.add-groups: Add--groupmembers to a group set.remove-groups: Drop--groupmembers from a group set.delete: Delete an OrganisationUnitGroupSet —...
dhis2 metadata organisation-unit-group-sets ls¶
List every OrganisationUnitGroupSet with group counts.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata organisation-unit-group-sets list¶
List every OrganisationUnitGroupSet with group counts.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata organisation-unit-group-sets get¶
Show one group set with its groups + per-group member counts.
Usage:
Arguments:
UID: OrganisationUnitGroupSet UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata organisation-unit-group-sets create¶
Create an empty OrganisationUnitGroupSet.
Usage:
Options:
--name TEXT: Full name (<=230 chars, unique). [required]--short-name TEXT: Short name (<=50 chars, unique). [required]--uid TEXT: Explicit 11-char UID (generated when omitted).--code TEXT: Business code.--description TEXT: Free-text description.--compulsory / --not-compulsory: Require OUs to land in exactly one group of this set. [default: not-compulsory]--data-dimension / --no-data-dimension: Expose as a pivot/visualisation axis. [default: data-dimension]--help: Show this message and exit.
dhis2 metadata organisation-unit-group-sets add-groups¶
Add --group members to a group set.
Usage:
Arguments:
UID: OrganisationUnitGroupSet UID. [required]
Options:
--group TEXT: OrganisationUnitGroup UID to add. Repeat for multiple. [required]--help: Show this message and exit.
dhis2 metadata organisation-unit-group-sets remove-groups¶
Drop --group members from a group set.
Usage:
Arguments:
UID: OrganisationUnitGroupSet UID. [required]
Options:
--group TEXT: OrganisationUnitGroup UID to drop. Repeat for multiple. [required]--help: Show this message and exit.
dhis2 metadata organisation-unit-group-sets delete¶
Delete an OrganisationUnitGroupSet — groups stay.
Usage:
Arguments:
UID: OrganisationUnitGroupSet UID to delete. [required]
Options:
-y, --yes: Skip the confirmation prompt.--help: Show this message and exit.
dhis2 metadata organisation-unit-levels¶
OrganisationUnitLevel naming (list / show / rename).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every OrganisationUnitLevel sorted by...list: List every OrganisationUnitLevel sorted by...get: Show one level row — by UID (default) or...rename: Give a level a human label — turns 'level...
dhis2 metadata organisation-unit-levels ls¶
List every OrganisationUnitLevel sorted by depth (roots first).
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata organisation-unit-levels list¶
List every OrganisationUnitLevel sorted by depth (roots first).
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata organisation-unit-levels get¶
Show one level row — by UID (default) or by numeric depth.
Usage:
Arguments:
UID: OrganisationUnitLevel UID (or pass --by-level). [required]
Options:
--by-level: Treat UID as the numeric level (1 = roots).--help: Show this message and exit.
dhis2 metadata organisation-unit-levels rename¶
Give a level a human label — turns 'level 2' into 'Province'.
Usage:
Arguments:
UID: OrganisationUnitLevel UID (or the numeric level with --by-level). [required]
Options:
--name TEXT: New human label (e.g. 'Country', 'District', 'Facility'). [required]--by-level: Treat UID as the numeric level (1 = roots).--code TEXT: Optionally update the business code.--offline-levels INTEGER: How many levels to cache offline from this one.--help: Show this message and exit.
dhis2 metadata legend-sets¶
LegendSet authoring (list / show / create / clone / delete).
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every LegendSet with its legend count.list: List every LegendSet with its legend count.get: Show one LegendSet with its ordered...create: Create a LegendSet with ordered...clone: Duplicate an existing LegendSet with the...delete: Delete a LegendSet.
dhis2 metadata legend-sets ls¶
List every LegendSet with its legend count.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata legend-sets list¶
List every LegendSet with its legend count.
Usage:
Options:
--help: Show this message and exit.
dhis2 metadata legend-sets get¶
Show one LegendSet with its ordered legends (colour ranges).
Usage:
Arguments:
UID: LegendSet UID. [required]
Options:
--help: Show this message and exit.
dhis2 metadata legend-sets create¶
Create a LegendSet with ordered colour-range legends.
Each --legend start🔚color[:name] defines one entry — start
must be strictly less than end, color is a #RRGGBB /
#RRGGBBAA hex string, name is optional (auto-generated from the
numeric range when omitted). At least one --legend is required.
Posts through /api/metadata so the LegendSet + its child Legends
land atomically. Returns the freshly-fetched record so DHIS2's
computed fields are populated.
Usage:
Options:
--name TEXT: Display name for the new LegendSet. [required]--legend TEXT: One legend (colour range) instart🔚color[:name]form. Repeatable, at least one required. Example:--legend 0:1000:#d73027:Low --legend 1000:5000:#1a9850:High. [required]--code TEXT: Business code (unique).--uid TEXT: Fixed 11-char UID. Omit to let the client generate one.--help: Show this message and exit.
dhis2 metadata legend-sets clone¶
Duplicate an existing LegendSet with the same bands + fresh UIDs.
Useful for forking a base set ("Coverage 0-100") into a variant without rebuilding the bands by hand.
Usage:
Arguments:
SOURCE_UID: Source LegendSet UID to clone. [required]
Options:
--new-name TEXT: Name of the clone (default: append ' (clone)' to the source's name).--new-uid TEXT: Fixed 11-char UID for the clone. Omit for auto-generated.--new-code TEXT: Business code on the clone.--help: Show this message and exit.
dhis2 metadata legend-sets delete¶
Delete a LegendSet.
Usage:
Arguments:
UID: LegendSet UID to delete. [required]
Options:
-y, --yes: Skip the confirmation prompt.--help: Show this message and exit.
dhis2 profile¶
Manage DHIS2 profiles.
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List every known profile with its source...list: List every known profile with its source...verify: Verify one profile or all profiles by...show: Print one profile (secrets redacted by...default: Setdefault = <name>in the global...add: Add (or upsert) a profile.remove: Remove a profile.rename: Rename a profile in-place.login: Run the OAuth2 authorization-code flow for...logout: Clear persisted OAuth2 tokens for a profile.bootstrap: One-shot: provision a PAT or OAuth2 client...oidc-config: Populate an OAuth2 profile by discovering...
dhis2 profile ls¶
List every known profile with its source and default status.
Usage:
Options:
-a, --all: Include shadowed profiles (global entries hidden by project ones).--help: Show this message and exit.
dhis2 profile list¶
List every known profile with its source and default status.
Usage:
Options:
-a, --all: Include shadowed profiles (global entries hidden by project ones).--help: Show this message and exit.
dhis2 profile verify¶
Verify one profile or all profiles by hitting /api/system/info + /api/me.
Usage:
Arguments:
[NAME]: Profile name to verify; omit to verify all.
Options:
--help: Show this message and exit.
dhis2 profile show¶
Print one profile (secrets redacted by default).
Usage:
Arguments:
NAME: [required]
Options:
--secrets: Include sensitive values.--help: Show this message and exit.
dhis2 profile default¶
Set default = <name> in the global (default) or project profiles.toml.
When name is omitted and stdin is a TTY, the command renders the
profile list + prompts for a numbered selection. Pass --global or
--local to pick the profiles.toml to write (--global is the
default).
Usage:
Arguments:
[NAME]: Profile name to set as default. Omit to pick interactively from a list.
Options:
--global: Write to ~/.config/dhis2/profiles.toml (default).--local: Write to ./.dhis2/profiles.toml instead.--verify: Probe the instance after switching.--help: Show this message and exit.
dhis2 profile add¶
Add (or upsert) a profile.
Secrets are never accepted as command-line flags (they'd leak into shell history).
Read from env (DHIS2_PAT, DHIS2_PASSWORD, DHIS2_OAUTH_CLIENT_SECRET) or
prompted interactively when missing.
Usage:
Arguments:
NAME: [required]
Options:
--url TEXT: DHIS2 base URL (also: DHIS2_URL env).--auth TEXT: pat | basic | oauth2 [default: pat]--username TEXT: Basic-auth username.--client-id TEXT: OAuth2 client_id.--scope TEXT: OAuth2 scope (DHIS2 only recognisesALL). [default: ALL]--redirect-uri TEXT: OAuth2 redirect URI (must match the registered client). [default: http://localhost:8765]--from-env: Pull OAuth2 fields from DHIS2_OAUTH_CLIENT_ID / DHIS2_OAUTH_CLIENT_SECRET / DHIS2_OAUTH_REDIRECT_URI / DHIS2_OAUTH_SCOPES env vars (seeded .env.auth).--global: Save to ~/.config/dhis2/profiles.toml (default — user-wide, applies everywhere).--local: Save to ./.dhis2/profiles.toml instead (project-scoped, overrides global).--default: Set as default after adding.--verify: Probe /api/system/info + /api/me after saving.--help: Show this message and exit.
dhis2 profile remove¶
Remove a profile. Without --global/--local, removes from whichever file holds it.
Usage:
Arguments:
NAME: [required]
Options:
--global: Remove from ~/.config/dhis2/profiles.toml specifically.--local: Remove from ./.dhis2/profiles.toml specifically.--help: Show this message and exit.
dhis2 profile rename¶
Rename a profile in-place. Preserves scope and updates default if needed.
Usage:
Arguments:
OLD_NAME: Current profile name. [required]NEW_NAME: New profile name (letters, digits, underscores). [required]
Options:
--verify: Probe the instance after renaming.--help: Show this message and exit.
dhis2 profile login¶
Run the OAuth2 authorization-code flow for a profile and persist its tokens.
Opens a browser to DHIS2's authorization endpoint, listens on the profile's
redirect_uri (local FastAPI+uvicorn), exchanges the code for tokens,
and writes them to the scope-appropriate tokens.sqlite. OAuth2 profiles only.
Pass --no-browser (or DHIS2_OAUTH_NO_BROWSER=1) to print the URL to
stderr instead of launching the system browser.
Usage:
Arguments:
[NAME]: Profile name; omit to use the default.
Options:
--no-browser: Print the DHIS2 authorization URL instead of launching the system browser. Useful over SSH, under Playwright, or when logging in via a different browser. Also accepts DHIS2_OAUTH_NO_BROWSER=1 as default.--help: Show this message and exit.
dhis2 profile logout¶
Clear persisted OAuth2 tokens for a profile.
Removes the row from the scope-appropriate tokens.sqlite. Next API call
triggers a fresh profile login flow. OAuth2 profiles only.
Usage:
Arguments:
[NAME]: Profile name; omit to use the default.
Options:
--help: Show this message and exit.
dhis2 profile bootstrap¶
One-shot: provision a PAT or OAuth2 client on DHIS2, save a profile, (for oauth2) log in.
Secrets never come in via argv. Read from env
(DHIS2_ADMIN_PAT, DHIS2_ADMIN_PASSWORD, DHIS2_OAUTH_CLIENT_SECRET)
or prompted interactively when missing. Admin creds are used once to POST
/api/apiToken (pat) or /api/oAuth2Clients (oauth2), then discarded.
Re-runs for auth=oauth2 fail at POST /api/oAuth2Clients if client_id is
taken — pass a different --client-id in that case. PAT bootstraps never
collide (DHIS2 mints a fresh server-side UID).
Usage:
Arguments:
NAME: Profile name to create. [required]
Options:
--auth TEXT: pat | oauth2 — which kind of profile to set up. [default: oauth2]--url TEXT: DHIS2 base URL (also: DHIS2_URL env).--admin-user TEXT: Admin username (for basic bootstrap).--client-id TEXT: OAuth2 client_id to register (auth=oauth2). [default: dhis2-utils-local]--redirect-uri TEXT: OAuth2 redirect URI. [default: http://localhost:8765]--scope TEXT: OAuth2 scope. [default: ALL]--pat-description TEXT: PAT description (auth=pat).--pat-expires-in-days INTEGER: PAT lifetime in days; omit for no expiry.--global: Save to ~/.config/dhis2/profiles.toml (default).--local: Save to ./.dhis2/profiles.toml instead.--login / --no-login: For auth=oauth2, runprofile loginafter saving. Ignored for auth=pat. [default: login]--help: Show this message and exit.
dhis2 profile oidc-config¶
Populate an OAuth2 profile by discovering a DHIS2 instance's OIDC endpoints.
Fetches /.well-known/openid-configuration from the given URL, validates the
response, and writes a profile with auth=oauth2 + your client credentials.
Removes the "hand-edit profiles.toml with the right issuer/auth/token URLs"
step from the OAuth2 setup walkthrough.
The URL can be either the DHIS2 base URL (discovery path is appended automatically) or the full discovery URL.
Usage:
Arguments:
URL: DHIS2 base URL or full /.well-known/openid-configuration URL. [required]
Options:
-n, --name TEXT: Profile name to save as. [required]--client-id TEXT: OAuth2 client_id (from your registration). [required]--client-secret TEXT: OAuth2 client_secret. [required]--scope TEXT: OAuth2 scope (DHIS2 only recognisesALL). [default: ALL]--redirect-uri TEXT: OAuth2 redirect URI (match your registered client — default is the CLI's loopback listener). [default: http://localhost:8765]--global: Save to ~/.config/dhis2/profiles.toml (default, user-wide).--local: Save to ./.dhis2/profiles.toml instead (project-scoped).--default: Set as default after saving.--login: Triggerdhis2 profile login <name>immediately after saving.--help: Show this message and exit.
dhis2 route¶
DHIS2 integration routes.
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List registered routes.list: List registered routes.get: Fetch one route by UID or code.create: Create a route via POST /api/routes.update: Replace a route via PUT /api/routes/{uid}.patch: Apply a JSON Patch to a route via PATCH...delete: Delete a route.run: Execute a route — DHIS2 proxies the...
dhis2 route ls¶
List registered routes.
Usage:
Options:
--fields TEXT: [default: id,code,name,url,disabled,auth]--help: Show this message and exit.
dhis2 route list¶
List registered routes.
Usage:
Options:
--fields TEXT: [default: id,code,name,url,disabled,auth]--help: Show this message and exit.
dhis2 route get¶
Fetch one route by UID or code.
Usage:
Arguments:
ROUTE: Route UID (e.g. E8OPcc45A22) or code (e.g. chap). [required]
Options:
--fields TEXT--help: Show this message and exit.
dhis2 route create¶
Create a route via POST /api/routes.
With --file: pass a full JSON spec (advanced — see BUGS.md for the DHIS2 schema).
Without --file: guided wizard. Prompts for code, name, url, then asks which
upstream auth type to use. Secrets (basic password, bearer token, header/query
value, OAuth2 client_secret) never come in via argv — they're read from env
(DHIS2_ROUTE_UPSTREAM_*) or at the hidden-input prompt.
Usage:
Options:
--file PATH: JSON file with the route definition (bypass the interactive wizard).--code TEXT--name TEXT--url TEXT: Target URL the route proxies to.--authorities TEXT: Comma-separated DHIS2 authorities allowed to run this route.--help: Show this message and exit.
dhis2 route update¶
Replace a route via PUT /api/routes/{uid}.
DHIS2 PUT expects the complete object. For partial updates use patch.
Usage:
Arguments:
ROUTE: Route UID (e.g. E8OPcc45A22) or code (e.g. chap). [required]
Options:
--file PATH: JSON file with the full route spec (PUT semantics). [required]--help: Show this message and exit.
dhis2 route patch¶
Apply a JSON Patch to a route via PATCH /api/routes/{uid}.
Usage:
Arguments:
ROUTE: Route UID (e.g. E8OPcc45A22) or code (e.g. chap). [required]
Options:
--file PATH: JSON Patch array (RFC 6902). [required]--help: Show this message and exit.
dhis2 route delete¶
Delete a route.
Usage:
Arguments:
ROUTE: Route UID (e.g. E8OPcc45A22) or code (e.g. chap). [required]
Options:
--help: Show this message and exit.
dhis2 route run¶
Execute a route — DHIS2 proxies the request to the configured target URL.
route accepts the route's UID or its code. When the route's target
URL ends in a wildcard (/**), --path SEGMENT is required: it is
what DHIS2 substitutes into the wildcard before calling upstream.
Usage:
Arguments:
ROUTE: Route UID (e.g. E8OPcc45A22) or code (e.g. chap). [required]
Options:
-X, --method TEXT: [default: GET]--body PATH: JSON body file for POST/PUT.--path TEXT: Additional path segment appended to the route's target URL.--help: Show this message and exit.
dhis2 system¶
DHIS2 system info.
Usage:
Options:
--help: Show this message and exit.
Commands:
whoami: Print the authenticated DHIS2 user for the...info: Print DHIS2 system info (version, build,...calendar: Print the active DHIS2 calendar, or change...
dhis2 system whoami¶
Print the authenticated DHIS2 user for the current environment profile.
Usage:
Options:
--help: Show this message and exit.
dhis2 system info¶
Print DHIS2 system info (version, build, analytics state, env).
Usage:
Options:
--help: Show this message and exit.
dhis2 system calendar¶
Print the active DHIS2 calendar, or change it when a value is supplied.
keyCalendar is the system-wide calendar DHIS2 uses to interpret periods.
The default is iso8601. Changing it is rare and risky — most instances
pick a calendar at deploy time and never touch it again. Switching the
calendar after data collection has started can leave existing periods
unreadable and break analytics, so this command requires interactive
confirmation (or --yes).
Usage:
$ dhis2 system calendar [OPTIONS] [VALUE]:[coptic|ethiopian|gregorian|islamic|iso8601|julian|nepali|persian|thai]
Arguments:
[VALUE]:[coptic|ethiopian|gregorian|islamic|iso8601|julian|nepali|persian|thai]: When supplied, writekeyCalendar(one of: coptic, ethiopian, gregorian, islamic, iso8601, julian, nepali, persian, thai). Omit to print the current calendar.
Options:
-y, --yes: Skip the interactive confirmation. Required for non-interactive callers (CI, scripts).--help: Show this message and exit.
dhis2 user¶
DHIS2 user administration.
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List users.list: List users.get: Fetch one user by UID or username.me: Print the authenticated user's/api/me...invite: Create a user and send the invitation email.reinvite: Re-send the invitation email for a pending...reset-password: Trigger DHIS2's password-reset email (POST...
dhis2 user ls¶
List users.
Examples: dhis2 user list dhis2 user list --filter 'disabled:eq:true' --order 'username:asc' dhis2 user list --filter 'username:like:admin'
Usage:
Options:
--fields TEXT: DHIS2 field selector. Supports plain lists ('id,username,email'), presets (':identifiable', ':nameable', ':owner', ':all'), and exclusions (':all,!password'). [default: id,username,displayName,email,disabled,lastLogin]--filter TEXT: Filter 'property:operator:value' (repeatable).--root-junction TEXT: Combine repeated --filter as AND (default) or OR. [default: AND]--order TEXT: Sort clause 'property:asc|desc' (repeatable).--page INTEGER: Server-side page number (1-based).--page-size INTEGER: Server-side page size (default 50).--help: Show this message and exit.
dhis2 user list¶
List users.
Examples: dhis2 user list dhis2 user list --filter 'disabled:eq:true' --order 'username:asc' dhis2 user list --filter 'username:like:admin'
Usage:
Options:
--fields TEXT: DHIS2 field selector. Supports plain lists ('id,username,email'), presets (':identifiable', ':nameable', ':owner', ':all'), and exclusions (':all,!password'). [default: id,username,displayName,email,disabled,lastLogin]--filter TEXT: Filter 'property:operator:value' (repeatable).--root-junction TEXT: Combine repeated --filter as AND (default) or OR. [default: AND]--order TEXT: Sort clause 'property:asc|desc' (repeatable).--page INTEGER: Server-side page number (1-based).--page-size INTEGER: Server-side page size (default 50).--help: Show this message and exit.
dhis2 user get¶
Fetch one user by UID or username. Prints a concise summary; --json for full payload.
Usage:
Arguments:
UID_OR_USERNAME: User UID (11 chars) or username. [required]
Options:
--fields TEXT: DHIS2 field selector.--help: Show this message and exit.
dhis2 user me¶
Print the authenticated user's /api/me summary. --json for full payload.
Usage:
Options:
--help: Show this message and exit.
dhis2 user invite¶
Create a user and send the invitation email.
Hits POST /api/users/invite. DHIS2's configured mailer sends the link; the new user sets their password on accept. Prints the new user's UID.
Usage:
Arguments:
EMAIL: Email address for the new user (receives the invitation link). [required]
Options:
--first-name TEXT: User's given name. [required]--surname TEXT: User's surname. [required]--username TEXT: Desired username. Omit to let DHIS2 derive from the email prefix.--user-role TEXT: User-role UID (repeatable). Grants the role on accept.--org-unit, --ou TEXT: Organisation-unit UID for capture scope (repeatable).--help: Show this message and exit.
dhis2 user reinvite¶
Re-send the invitation email for a pending user (POST /api/users/{uid}/invite).
Usage:
Arguments:
UID: UID of a user who hasn't yet completed their invite. [required]
Options:
--help: Show this message and exit.
dhis2 user reset-password¶
Trigger DHIS2's password-reset email (POST /api/users/{uid}/reset).
Usage:
Arguments:
UID: UID of the user to reset. [required]
Options:
--help: Show this message and exit.
dhis2 user-group¶
DHIS2 user-group administration.
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List user groups.list: List user groups.get: Fetch one user group by UID.add-member: Add a user to a group (POST...remove-member: Remove a user from a group (DELETE...sharing-get: Print the current sharing block for one...sharing-grant-user: Grant one user access to a group (shortcut...
dhis2 user-group ls¶
List user groups.
Usage:
Options:
--fields TEXT: DHIS2 field selector. [default: id,name,displayName,users]--filter TEXT: Filter 'property:operator:value' (repeatable).--order TEXT: Sort clause 'property:asc|desc' (repeatable).--page-size INTEGER: Server-side page size.--help: Show this message and exit.
dhis2 user-group list¶
List user groups.
Usage:
Options:
--fields TEXT: DHIS2 field selector. [default: id,name,displayName,users]--filter TEXT: Filter 'property:operator:value' (repeatable).--order TEXT: Sort clause 'property:asc|desc' (repeatable).--page-size INTEGER: Server-side page size.--help: Show this message and exit.
dhis2 user-group get¶
Fetch one user group by UID. Prints a concise summary; --json for full payload.
Usage:
Arguments:
UID: User-group UID. [required]
Options:
--fields TEXT: DHIS2 field selector.--help: Show this message and exit.
dhis2 user-group add-member¶
Add a user to a group (POST /api/userGroups/<gid>/users/<uid>).
Usage:
Arguments:
GROUP_UID: User-group UID. [required]USER_UID: User UID to add. [required]
Options:
--help: Show this message and exit.
dhis2 user-group remove-member¶
Remove a user from a group (DELETE /api/userGroups/<gid>/users/<uid>).
Usage:
Arguments:
GROUP_UID: User-group UID. [required]USER_UID: User UID to remove. [required]
Options:
--help: Show this message and exit.
dhis2 user-group sharing-get¶
Print the current sharing block for one user group. --json for full payload.
Usage:
Arguments:
UID: User-group UID. [required]
Options:
--help: Show this message and exit.
dhis2 user-group sharing-grant-user¶
Grant one user access to a group (shortcut over /api/sharing).
Preserves existing userAccesses/userGroupAccesses by fetching the current sharing block first, then appending the new grant.
Usage:
Arguments:
GROUP_UID: User-group UID. [required]USER_UID: User UID to grant. [required]
Options:
--metadata-write / --metadata-read: Grant metadata write (default) or read-only. [default: metadata-write]--help: Show this message and exit.
dhis2 user-role¶
DHIS2 user-role administration.
Usage:
Options:
--help: Show this message and exit.
Commands:
ls: List user roles.list: List user roles.get: Fetch one user role by UID.authority-list: Print the sorted authorities carried by...add-user: Grant a user a role (POST...remove-user: Revoke a role from a user (DELETE...
dhis2 user-role ls¶
List user roles.
Usage:
Options:
--fields TEXT: DHIS2 field selector. [default: id,name,displayName,authorities,users]--filter TEXT: Filter (repeatable).--order TEXT: Sort clause (repeatable).--page-size INTEGER: Server-side page size.--help: Show this message and exit.
dhis2 user-role list¶
List user roles.
Usage:
Options:
--fields TEXT: DHIS2 field selector. [default: id,name,displayName,authorities,users]--filter TEXT: Filter (repeatable).--order TEXT: Sort clause (repeatable).--page-size INTEGER: Server-side page size.--help: Show this message and exit.
dhis2 user-role get¶
Fetch one user role by UID. Prints a concise summary; --json for full payload.
Usage:
Arguments:
UID: User-role UID. [required]
Options:
--fields TEXT: DHIS2 field selector.--help: Show this message and exit.
dhis2 user-role authority-list¶
Print the sorted authorities carried by one role, one per line.
Usage:
Arguments:
UID: User-role UID. [required]
Options:
--help: Show this message and exit.
dhis2 user-role add-user¶
Grant a user a role (POST /api/userRoles/<rid>/users/<uid>).
Usage:
Arguments:
ROLE_UID: User-role UID. [required]USER_UID: User UID to grant the role to. [required]
Options:
--help: Show this message and exit.
dhis2 user-role remove-user¶
Revoke a role from a user (DELETE /api/userRoles/<rid>/users/<uid>).
Usage:
Arguments:
ROLE_UID: User-role UID. [required]USER_UID: User UID to revoke the role from. [required]
Options:
--help: Show this message and exit.