Power Platform CLI

What is Power Platform CLI?

Microsoft Power Platform CLI is a command-line tool for the developers, administrators, and software vendors who work with Power Platform. The executable is called pac.

It groups commands for authentication, environments, Dataverse, solutions, Power Pages, connectors, code components, and other development tasks. Which commands you have depends on the version, the operating system, and how you installed the tool.

The CLI is built for repeatable work and pipelines. The maker portals stay useful for visual design and one-off configuration, and the two are meant to complement each other rather than replace one another.

Installing and versioning

Microsoft provides three ways to install it: a Visual Studio Code extension, a .NET tool, and a Windows MSI. The Visual Studio Code extension and the .NET tool run on Windows, Linux, and macOS; the MSI is Windows only. A few commands, such as pac data, depend on the .NET Framework and run on Windows only.

Check the active version by running pac on its own, which prints the version, and read help with pac help or a group's own help such as pac solution help. Pin or record versions in build environments when reproducibility matters, because commands and parameters can change or be marked as preview between releases.

Authentication profiles

Most commands need a connection to a tenant and environment. pac auth create makes a local profile, pac auth list shows your profiles, and pac auth select chooses the active one.

pac auth create --name dev --environment https://contoso-dev.crm.dynamics.com
pac auth list
pac auth select --name dev
pac org who

Always confirm the tenant, environment, and identity before you change anything. The wrong active profile will happily run a correct command against the wrong environment.

Working with solutions

The solution command group covers export, import, pack, unpack, and dependency checks. Unpack turns a solution file into individual files that fit source control far better than a single compressed archive.

pac solution export --name CaseManagement --path ./out/CaseManagement.zip --managed false
pac solution unpack --zipfile ./out/CaseManagement.zip --folder ./src/CaseManagement

Pack and unpack do not make changes conflict-free on their own. Complex components such as canvas apps and forms still need a team strategy and careful review, because they do not merge cleanly as text.

Code components and other work

You can scaffold a Power Apps component framework project with pac pcf init and add it to a solution project. Other command groups handle Power Pages, connectors, plug-ins, and Dataverse data. Use the help output of the version you actually installed as your parameter reference, and do not paste old examples blindly into scripts.

Using it in CI/CD

A pipeline can build a solution, run checks, and deploy it to a target environment. Non-interactive authentication should use a suitable application identity rather than a personal profile, and it should hold only the rights the task needs.

Keep secrets in the secret store of your CI/CD platform and never write them to logs. Make scripts idempotent where you can, stop on failed checks, and check exit codes. A pipeline that ignores errors does not produce a reliable deployment.

CLI versus the maker portal

The CLI is strong at automation, bulk work, and reproducible workflows. A portal is stronger for visual app building, inspection, and a one-time change. Both act on the same platform artefacts, so a change made in the portal still has to be captured through the agreed solution and source-control route.

Safe daily use

Give profiles recognisable names for the tenant and stage, have scripts print the target environment, and require an explicit parameter for production. Test destructive or wide-reaching commands in an isolated environment first, and export or back up where recovery depends on it. Record the CLI version, parameters, and output alongside each release so a deployment stays repeatable and you can later check which artefacts were really applied.

Last Updated: July 18, 2026 Back to Dictionary
Keywords
Power Platform CLI pac Power Platform Microsoft Dataverse solution Power Platform ALM CI/CD deployment pipeline Git low-code and no-code