|
| 1 | +--- |
| 2 | +title: "Private Values Commands" |
| 3 | +url: /refguide10/mx-command-line-tool/private-values/ |
| 4 | +weight: 10 |
| 5 | +description: "Describes the commands related to private values for the mx command-line tool." |
| 6 | +--- |
| 7 | + |
| 8 | +## Introduction |
| 9 | + |
| 10 | +The commands in this group are related to showing and deleting private values. |
| 11 | + |
| 12 | +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: |
| 13 | + |
| 14 | +* The path of the `.mpr` file of the app |
| 15 | +* The version of Studio Pro |
| 16 | +* A key, such as `StudioPro.Settings.Configuration.ConstantValue.MyFirstModule.MyConstant` for the configured constant value for constant `MyFirstModule.MyConstant` |
| 17 | + |
| 18 | +Make sure to exit all instances of Studio Pro before using these commands, as Studio Pro keeps a cache of private values. |
| 19 | + |
| 20 | +## mx show-private-values Command {#show-private-values} |
| 21 | + |
| 22 | +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. |
| 23 | + |
| 24 | +### Usage |
| 25 | + |
| 26 | +Use the following command pattern: `mx show-private-values` |
| 27 | + |
| 28 | +The tool will output one line for each private value, with the path, version, and key, separated by the `tab` character. |
| 29 | + |
| 30 | +### Examples |
| 31 | + |
| 32 | +The output might look something like this: |
| 33 | + |
| 34 | +``` |
| 35 | +C:\Users\John.Doe\Mendix\MyProductApp\MyProductApp-main.mpr 10.12.0 StudioPro.Settings.Configuration.ConstantValue.MyFirstModule.MyConstant |
| 36 | +C:\Users\John.Doe\Mendix\MyProductApp\MyProductApp-main.mpr 10.18.0 StudioPro.Settings.Configuration.ConstantValue.MyFirstModule.MyConstant |
| 37 | +C:\Users\John.Doe\Mendix\MyBikesApp\MyBikesApp-main.mpr 10.12.0 StudioPro.Settings.Configuration.ConstantValue.MyFirstModule.OtherConstant |
| 38 | +``` |
| 39 | + |
| 40 | +### Return Codes |
| 41 | + |
| 42 | +These are the return codes: |
| 43 | + |
| 44 | +| Return Code | Description | |
| 45 | +| --- | --- | |
| 46 | +| `0` | The command ran successfully. | |
| 47 | + |
| 48 | +## mx delete-private-values Command {#delete-private-values} |
| 49 | + |
| 50 | +The `mx delete-private-values` command deletes private values from the current user's local app data. |
| 51 | + |
| 52 | +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. |
| 53 | + |
| 54 | +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. |
| 55 | + |
| 56 | +### Usage |
| 57 | + |
| 58 | +Use the following command pattern: `mx delete-private-values [-n|-f] [OPTIONS]` |
| 59 | + |
| 60 | +These are the required parameters: |
| 61 | + |
| 62 | +| Option | Shortcut | Result | |
| 63 | +| --- | --- | --- | |
| 64 | +| `--dry-run` | `-n` | Shows which private values would be deleted, but does not actually delete anything. | |
| 65 | +| `--force` | `-f` | Deletes private values. | |
| 66 | + |
| 67 | +Either `-n` or `-f` must be specified. |
| 68 | + |
| 69 | +These are the `OPTIONS`: |
| 70 | + |
| 71 | +When used without options, the command deletes all private values. The options filter the list of private values to be deleted. |
| 72 | + |
| 73 | +| Option | Result | |
| 74 | +| --- | --- | |
| 75 | +| `--not-on-disk` | Deletes only private values whose path cannot be found on disk. | |
| 76 | +| `--path` | Deletes only private values for the given path. | |
| 77 | +| `--version` | Deletes only private values of the given Studio Pro version. | |
| 78 | +| `--key` | Deletes only private values with the given key. | |
| 79 | +| `--item` | Specifies the path, version, and key, separated by whitespace, of a specific private value to be deleted. | |
| 80 | + |
| 81 | +### Examples |
| 82 | + |
| 83 | +| Example | Result | |
| 84 | +| --- | --- | |
| 85 | +| `mx delete-private-values -n` | Shows all private values, but does not delete them (Same as `mx show-private-values`). | |
| 86 | +| `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. | |
| 87 | +| `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. | |
| 88 | +| `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. | |
| 89 | +| `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=`). | |
| 90 | + |
| 91 | +### Return Codes |
| 92 | + |
| 93 | +These are the return codes: |
| 94 | + |
| 95 | +| Return Code | Description | |
| 96 | +| --- | --- | |
| 97 | +| `0` | The command ran successfully. | |
| 98 | +| `2` | There is something wrong with the command-line options. | |
0 commit comments