Skip to main content

Installation

This page collects the prerequisites and installation options for @pagopa/dx-cli.

Requirements

The following tools must be installed on your machine:

ToolVersion
Node.js>= 22.0.0
Terraform or tfenvlatest
GitHub CLIlatest
Azure CLIlatest (required for Azure environments only)

Before running any command that interacts with GitHub or a cloud provider, ensure you are logged in:

gh auth login
az login
GitHub authentication is mandatory

Every command except --version and --help requires GitHub authentication. The CLI resolves credentials in this order: the GH_TOKEN environment variable, the GITHUB_TOKEN environment variable, then the GitHub CLI (gh auth login). If none is available, the command exits with an error asking you to log in.

Telemetry is collected only for members of the pagopa GitHub organization; everyone else can use the CLI normally with telemetry disabled.

Azure session expiry

Within PagoPA, az login sessions expire every 12 hours. If a command fails with an authentication error, run az login again before retrying.

Installation

You can invoke the CLI directly via npx without installing globally:

npx @pagopa/dx-cli --help

When installed locally in a monorepo you can also run:

pnpm dx --help

The binary name is dx.