Skip to content

Add Private Values Commands to Mx10 #9323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ These are the available [merging and diffing commands](/refguide/mx-command-line
| [diff](/refguide/mx-command-line-tool/merge/#diff) | Shows the diff of the *.mpr* files. |
| [dump-mpr](/refguide/mx-command-line-tool/dump-mpr/) | Create a JSON description of the model of a Mendix App |

### Private Values Commands

These are the available [private values commands](/refguide/mx-command-line-tool/private-values/):

| Command | Description |
| --- | --- |
| [show-private-values](/refguide/mx-command-line-tool/private-values/#show-private-values) | Shows private values. |
| [delete-private-values](/refguide/mx-command-line-tool/private-values/#delete-private-values) | Deletes private values. |

## Undocumented Options

The mx tool contains options that are not described in this document. These options are for internal Mendix usage and are not officially supported. This might change in the future, but these options are used at your own risk.
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
title: "Private Values Commands"
url: /refguide/mx-command-line-tool/private-values/
weight: 10
description: "Describes the commands related to private values for the mx command-line tool."
---

## Introduction

The commands in this group are related to showing and deleting private values.

Studio Pro stores private values, such as values for [private constants](/refguide/configuration/#constants), in an encrypted way in the user's local app data. These private values are defined by:

* The path of the `.mpr` file of the app
* The version of Studio Pro
* A key, such as `StudioPro.Settings.Configuration.ConstantValue.MyFirstModule.MyConstant` for the configured constant value for constant `MyFirstModule.MyConstant`

Make sure to exit all instances of Studio Pro before using these commands, as Studio Pro keeps a cache of private values.

{{% alert color="info" %}}
This feature was introduced in [Studio Pro 10.22](/releasenotes/studio-pro/10.22/).
{{% /alert %}}

## mx show-private-values Command {#show-private-values}

The `mx show-private-values` command produces a list of paths, versions, and keys of all private values stored in the current user's local app data. It does not show the (encrypted) value.

### Usage

Use the following command pattern: `mx show-private-values`

The tool will output one line for each private value, with the path, version, and key, separated by the `tab` character.

### Examples

The output might look something like this:

```
C:\Users\John.Doe\Mendix\MyProductApp\MyProductApp-main.mpr 10.12.0 StudioPro.Settings.Configuration.ConstantValue.MyFirstModule.MyConstant
C:\Users\John.Doe\Mendix\MyProductApp\MyProductApp-main.mpr 10.18.0 StudioPro.Settings.Configuration.ConstantValue.MyFirstModule.MyConstant
C:\Users\John.Doe\Mendix\MyBikesApp\MyBikesApp-main.mpr 10.12.0 StudioPro.Settings.Configuration.ConstantValue.MyFirstModule.OtherConstant
```

### Return Codes

These are the return codes:

| Return Code | Description |
| --- | --- |
| `0` | The command ran successfully. |

## mx delete-private-values Command {#delete-private-values}

The `mx delete-private-values` command deletes private values from the current user's local app data.

When used with `-f` (`--force`), it deletes private values and displays the number of private values it has deleted. When used with `-n` (`--dry-run`), it shows which private values would be deleted, but does not actually delete anything.

When you delete a private value that is needed by an app, the next time you open that app in Studio Pro, it will produce a consistency error indicating that you have to type the value again.

### Usage

Use the following command pattern: `mx delete-private-values [-n|-f] [OPTIONS]`

These are the required parameters:

| Option | Shortcut | Result |
| --- | --- | --- |
| `--dry-run` | `-n` | Shows which private values would be deleted, but does not actually delete anything. |
| `--force` | `-f` | Deletes private values. |

Either `-n` or `-f` must be specified.

These are the `OPTIONS`:

When used without options, the command deletes all private values. The options filter the list of private values to be deleted.

| Option | Result |
| --- | --- |
| `--not-on-disk` | Deletes only private values whose path cannot be found on disk. |
| `--path` | Deletes only private values for the given path. |
| `--version` | Deletes only private values of the given Studio Pro version. |
| `--key` | Deletes only private values with the given key. |
| `--item` | Specifies the path, version, and key, separated by whitespace, of a specific private value to be deleted. |

### Examples

| Example | Result |
| --- | --- |
| `mx delete-private-values -n` | Shows all private values, but does not delete them (Same as `mx show-private-values`). |
| `mx delete-private-values -f --not-on-disk` | Deletes all private values for which the path cannot be found on disk. This is useful when you have deleted one or more apps from your disk. |
| `mx delete-private-values -f --path="C:\Users\John.Doe\Mendix\MyBikesApp\MyBikesApp-main.mpr" --version=10.12.0` | Deletes private values that were stored for the app `MyBikesApp-main.mpr` for Studio Pro version 10.12.0. This is useful after you have upgraded that app to a later version. |
| `mx delete-private-values -f --version=10.12.0` | Deletes private values for Studio Pro version 10.21.0. This is useful after you have upgraded all your apps to later versions. |
| `mx delete-private-values -f --item="C:\Users\John.Doe\Mendix\MyProductApp\MyProductApp-main.mpr 10.12.0 StudioPro.Settings.Configuration.ConstantValue.MyFirstModule.MyConstant"` | Deletes a specific private value (Same as specifying `--path=`, `version=` and `key=`). |

### Return Codes

These are the return codes:

| Return Code | Description |
| --- | --- |
| `0` | The command ran successfully. |
| `2` | There is something wrong with the command-line options. |