Managing Configuration Profiles
A configuration profile is a named context that holds a complete set of service connection settings for one environment. Switching profiles changes which environment all subsequent pingcli commands target, without you needing to re-enter credentials or specify flags on every command.
When Ping CLI is first installed, a default profile is created and set as the active profile. You can use this profile if you only ever work in a single environment, but most developers benefit from creating at least one profile for each environment: for example, dev, test, and prod.
Common reasons to use multiple profiles:
-
Switching between development, test, and production environments without re-configuring credentials each time.
-
Experimenting in a sandbox and keeping those settings separate from a shared development environment.
-
Managing multiple demonstration environments independently.
-
Organising related work into named workspaces.
Before running any pingcli command, confirm which profile is active with:pingcli config get activeProfileThis prints only the active profile name (the quickest way to check your current context). |
Create a configuration profile
Use the pingcli config profiles create command to add a new profile.
Running the command without flags starts an interactive guided experience:
pingcli config profiles create
To create and immediately activate a profile in a single step, pass the name, an optional description, and the --set-active flag:
pingcli config profiles create --name dev --description "Development environment" --set-active
Confirm the profile was created with the pingcli config profiles list command:
pingcli config profiles list
View and switch the active profile
All pingcli commands use the active profile unless you override it with the --profile / -P global flag on a specific command.
The --profile / -P flag overrides the active profile for that single command only. It does not permanently change the active profile.
|
To switch the active profile, use the pingcli config profiles use command:
pingcli config profiles use test
After switching, verify the change:
pingcli config get activeProfile
| Making "switch → verify" a habit helps prevent accidentally running commands against the wrong environment. |
Set configuration values on a profile
Configuration values are stored per-profile using the pingcli config set command. When --profile / -P is not specified, the value is written to the active profile.
The following example activates the dev profile and sets its output format:
pingcli config profiles use dev
pingcli config set "outputFormat=json"
To write a value to a different profile without changing the active profile, use --profile:
pingcli config set --profile test "outputFormat=text"
To see all stored configuration for the active profile:
pingcli config profiles show
To view a specific named profile:
pingcli config profiles show prod
You can find a full list of available configuration settings in the Configuration settings reference.
Delete a configuration profile
When a profile is no longer needed, use the pingcli config profiles delete command. All configuration settings for that profile are permanently removed from the filesystem.
The default profile cannot be deleted. To remove credentials from it, use pingcli config unset to clear individual settings.
|