What is Microsoft Power Apps CLI?

Microsoft Power Apps CLI is a simple, single-stop developer command-line interface that empowers developers and app makers to create code components.

Power Apps CLI tooling is the first step toward a comprehensive application life-cycle management (ALM) story where the enterprise developers and ISVs can create, build, debug, and publish their extensions and customizations quickly and efficiently.

Install Power Apps CLI

To get Power Apps CLI, do the following:

  1. Install Npm (comes with Node.js) or Node.js (comes with npm). We recommend LTS (Long Term Support) version 10.15.3 or higher.

  2. Install .NET Framework 4.6.2 Developer Pack.

  3. If you don’t already have Visual Studio 2017 or later, follow one of these options:

  4. Install Power Apps CLI.

  5. To take advantage of all the latest capabilities, update the Power Apps CLI tooling to the latest version using this command:

    pac install latest
    

Note

Currently, Power Apps CLI is supported only on Windows 10.

Common commands

This table lists some common commands used in the CLI:

Command Description Examples
pcf Commands for working with Power Apps component framework. It has the following parameters:
- init: Initializes the code component project. It has the following parameters
- namespace: Namespace of the code component.
- name: Name of the code component.
- template: Field or dataset
- push: Pushes the code component to the Common Data Service instance with all the latest changes. It has the following parameter:
- publisher-prefix: Publisher prefix of the organization.
- Version: Updates the component manifest file with the specified patch version. It has the following parameters:
- patchversion: Patch version of the code component. patchversion will only take value of the third part of the version tuple: Major.Minor.Patch.
- path: Absolute or relative path of the component manifest file.
- allmanifests: Updates the patch version for all the component manifest files.
pac pcf init --namespace <specify your namespace here> --name <Name of the code component> --template <component type>

pac pcf push --publisher-prefix <your publisher prefix>

pac pcf version --patchversion <number> --path <Absolute or relative path to component manifest file --allmanifests
solution Commands for working with Common Data Service solution projects. It has the following parameters:
- init: Initializes the solution project. It has the following parameters:
- publisher-name: Publisher name of the organization.
- publisher-prefix: Publisher prefix of the organization.
- add-reference: Sets the reference path to the component project folder by passing the path parameter.
- clone: Creates a solution project based up on the existing solution project by passing the following parameters:
-name: The name of the solution to be exported.
-targetversion: The version that the exported solution supports.
-include: Settings that should be included in the solution being exported.
-Export: Exports a Common Data Service solution project from the current organization. It has the following parameters:
-path: Place where the exported solution zip file will be saved.
- name: Name oft he solution that needs to be exported.
- managed: Defines whether the solution should be exported as a managed solution or not.
-targetversion: The version that the exported solution supports.
-include: Settings that should be included in the solution being exported.
pac solution init --publisher-name <enter your publisher name> --publisher-prefix <enter your publisher prefix>

pac solution add-reference --path <path to your Power Apps component framework project>

pac solution clone –name<name of the solution to be exported> --version <version of your solution> --include <settings that should be included>
auth Commands to authenticate to Common Data Service. It has the following parameters:
- create: Creates the authentication profile for your organization by passing the url parameter. Pass the organization url for the url parameter.
- list: Provides the list of authentication profiles.
- select: Provides a way to switch between previously created authentication profiles by passing the index parameter.
delete: Deletes the authentication profile created by passing the index parameter.
pac auth create --url <your Common Data Service org’s url>

pac auth list

Pac auth select --index <index of the active profile>
telemetry Manages the telemetry settings. It has the following parameters:
- enable: Enables the telemetry option.
- disable: Disables the telemetry option.
- status: Returns whether the telemetry is enabled or disabled.
pac telemetry enable

pac telemetry disable
org Command to work with Common Data Service. pac org who
plugin Manages to create a plug-in project pac plugin init

Uninstall Power Apps CLI

To uninstall the Power Apps CLI tooling, run the MSI from here.

If you are a Private Preview participant and have an older version of CLI, follow these steps:

  1. To find out where the Power Apps CLI is installed, open a command prompt and type where pac.

  2. Delete the PowerAppsCLI folder.

  3. Open the Environment Variables tool by running the command rundll32 sysdm.cpl,EditEnvironmentVariables in the command prompt.

  4. Double-click Path under the User variable for... section.

  5. Select the row containing the PowerAppsCLI path and select the Delete button on the right-hand side.

  6. Select OK twice.

See also

Power Apps component framework