pacx project init - neronotte/Greg.Xrm.Command GitHub Wiki

Initializes a new PACX project

Usage

The problem

By default PACX commands execute in a global context. The authentication profile to be used to connect to a Dataverse instance, or the solution to work with, are defined in a global PACX settings file.

It's the same approach used by PAC CLI, and it's really helpful when scripting, because you can autenticate once, define once the solution to work with, and all the subsequent commands will inherit that configuration.

Sometimes, however, it may became cumbersome when working on multiple projects, or when working with a segmented solution approach on a given project, because it requires you to switch configuration often.

The solution

The project init command allows you to create a local configuration file in the current directory, that will override the global settings for all the subsequent commands that will run from the current folder, or one of its children.

You can simply type:

pacx project init
 -- or --
pacx project init --conn <auth profile name> --solution <default solution unique name>

This will create a .pacxproj file in the current directory, that will store the authentication profile and default solution name to be used by commands that will run in the context of the current project. Both arguments are optional. If not specified, the current global values will be used. A folder containing a .pacxproj file is called a PACX project folder.

To show the details of the current project, you can use the info command:

pacx project info

Suspend / Resume default settings override

Running a command inside a PACX project folder overrides the default auth. profile and default solution. If you need to temporary suspend this override, without deleting the .pacxproj file, you can do it via:

pacx project suspend

Once you suspended the project, all subsequent commands will run against the global, default, auth profile and solution.

To resume the override, you can use the resume command:

pacx project resume

Arguments

Long Name Short Name Required? Description Default value Valid values
conn c N The name of the authentication profile that allows to connect to the environment associated to the current command. It overrides the default auth profile set via pacx auth select. If not provided, the current default auth profile is used. - String
solution s N The default solution to use to store the customizations for the current project. It overrides any solution set via pacx solution setDefault. If not provided, the default solution for the selected auth profile is used. - String