Action Commands

## CDCD

Form English: Command Copy Directory (To Mods)

Copy the folder to the mods folder of the game folder, all standard SMAPI mods use this command.

### Format

```
CDCD

```

```
[parameter 1: the folder to be copied, the relative path from the current location]

```

### Do not place multiple layers of folders

Keep the folder you put in directly where the manifest.json file is located.

### An item's content cannot contain the item's dependencies

* The definition of an item in SMUI is a complete mod, don't put the dependencies of this mod in it for convenience.
* Internal mechanism automatically checks that all objects are members of this item itself.
* Interferes with other computations in the assembly, causing various unexpected situations.
* For example, there are cases where the dependency requirements cannot be read, the items cannot be scanned, etc.

### Example

Content Patcher

```
CDCD

```

```
ContentPatcher

```

Stardew Valley Expanded 1.14.X

```
CDCD

```

```
StardewValleyExpanded

```

```
CDCD

```

```
[CP] Stardew Valley Expanded

```

```
CDCD

```

```
[FTM] Stardew Valley Expanded

```

```
CDCD

```

```
[JA] Stardew Valley Expanded

```

```
CDCD

```

```
[SAAT] Stardew Valley Expanded

```

```
CDCD

```

```
[STF] Stardew Valley Expanded

```

### Priority

* Each action command has its own installation status display in SMUI.
* The CDCD command has the highest priority, no matter what other action commands you have before and after, the program will use the CDCD command to display the installation status.
* If there is no CDCD command, the first action command is used to display the installation status.
* In addition, the first CDCD command has the highest priority, and the order of execution is according to the commands you write.

### config.json automatic retention mechanism

* This function is turned on by default in the fifth generation, and there is no option to turn it off. This function is integrated in the core component.
* Automatically copy the config.json file under the folder using the CDCD command to the .config folder under the item location when performing an uninstall.
* And automatically restore on next install, thus achieving config retention.
* If you want to turn this feature off for an individual item, see the related commands on the Control Commands page.

## CDGCD

Form English: Command Global Copy Directory

Copy the folder to anywhere in the game folder.

### Format

```
CDGCD

```

```
[parameter 1: the folder to be copied, the relative path from the current location]

```

```
[parameter 2: target folder location, relative path from the game directory]

```

## CDMAD

Form English: Command Mods Addition Directory

Overwrite an existing folder in Mods, the program will automatically check if the folder exists.

* The installation status will be displayed as a purple [Additional Content]. Uninstallation is not supported. Please uninstall the original mod.
* Often used for translation file coverage, resource coverage by other authors, etc.

### Format

```
CDMAD

```

```
[parameter 1: The folder to be overwritten in Mods, the relative path from the current location, which is also the relative path from the Mods folder]

```

### Example

Stardew Valley Expanded - Chinese 1.14.X

```
CDMAD

```

```
[CP] Stardew Valley Expanded

```

```
CDMAD

```

```
[JA] Stardew Valley Expanded

```

```
CDMAD

```

```
[STF] Stardew Valley Expanded

```

## CDGRF

Form English: Command Global Replace File

Replace any single file of the entire game and calculate the SHA256 check value to determine if it is installed.

* If the file is large, it will take more time to calculate, you can consider using the CDF command (at the cost of no installation judgment)
* Renaming can additionally be implemented during this process.

### Format

```
CDGRF

```

```
[parameter 1: the file to be copied, the relative path from the current location]

```

```
[parameter 2: target file location, relative path from the game directory]

```

### Warning

* This command is designed to overwrite files that are native to the game.
* When uninstalling, the program will look for files in the same location in the backup folder.
* If found, restore the file, otherwise delete the target file !

## CDGCF (-SHA) (-[byte])

Form English: Command Global Copy File

Copy the file anywhere in the game.

* Renaming can additionally be implemented during this process.

### Format

```
CDGCF

```

```
[parameter 1: the file to be copied, the relative path from the current location]

```

```
[parameter 2: target file location, relative path from the game directory]

```

As long as the target file exists, it is determined to be installed, and no checksum is calculated.

```
CDGCF-SHA (-[byte])

```

```
[parameter 1: the file to be copied, the relative path from the current location]

```

```
[parameter 2: target file location, relative path from the game directory]

```

It is supported from version 5.1.16. Calculate the SHA256 value of the file to determine whether it is installed. If it is installed, it will be displayed as [File copied + verified], if it is not installed, it will be displayed as [File not copied]. It is optional to specify the calculation The number of bytes to save performance and time, the unit is byte, not bit, 1KB=1024 bytes, 1MB=1048576 bytes, if the number of bytes is not included, the entire file is calculated.

### Warning

* This command is designed to work with files that the game doesn't have originally.
* Don't use it for the files in the game itself, delete the target file directly when uninstalling, and won't go to the backup to find it.

## CDF

Form English: Command File

Copy the file to anywhere in the game.

* Use this if you want to replace large files that the game itself has or if you just don't want the program to figure out if the file is installed.
* Renaming can additionally be implemented during this process.

### Format

```
CDF

```

```
[parameter 1: the file to be copied, the relative path from the current location]

```

```
[parameter 2: target file location, relative path from the game directory]

```

## CDCC\CDVD

Form ???, I forgot. \*=\*

* Overwrite Content folder. This is for XNB mods, the kind that replace a bunch of XNB files.
* First create a `Content` folder and place your files according to the structure of the game Content folder.

### Format

```
CDVD

```

### Warning

* When uninstalling, the program automatically finds backups in the backup folder according to the file layout of your Content folder.
* If not found, the game files will be deleted !