Skip to content

Command line interface

Ashot Barkhudaryan edited this page Jun 14, 2023 · 6 revisions

Plugin have CLI interface for performing all operations from command line.

How to use

  • Make sure 'ProjectCleaner' plugin is installed in project and enabled!
  • Open Terminal
  • Go to folder {Location_Where_Engine_Installed}/UE_4.26/Engine/Binaries/Win64
  • Run cli to fixup redirectors UE4Editor.exe <GameName or uproject> -run=ResavePackages -fixupredirects -autocheckout -projectonly -unattended

< v2.0.0

  • Run UE4Editor-Cmd.exe "{path_to_your_project}" -run=ProjectCleanerCLI {args}

v2.0.0

  • Run UE4Editor-Cmd.exe "{path_to_your_project}" -run=Pjc {args}

Example:
Engine Installed path : W:\ue4_versions\UE_4.26\Engine\Binaries\Win64
Project path : C:\dev\ue4\MyProject

./UE4Editor-Cmd.exe "C:\dev\ue4\MyProject\MyProject.uproject" -run=ProjectCleanerCLI

CLI parameters (< v2.0.0)

  • -Check
  • -ScanDevContent
  • -DeleteEmptyFolders
  • -ExcludeAssets = "/Game/Path1/Asset1.uasset , /Game/Path2/Asset2.uasset"
  • -ExcludeAssetsInPath = "/Game/Blueprint/"
  • -ExcludeAssetWithClass= "Blueprint,Material"

CLI parameters (v2.0.0)

    • scan_only - will scan project and print result, no any cleaning operations performed
    • full_cleanup - will delete all unused assets and empty folders in project
    • delete_assets_unused - flag to delete unused assets
    • delete_folders_empty - flag to delete empty folders
    • delete_files_external - flag to delete external files
    • delete_files_corrupted - flag to delete corrupted asset files

In v2.0.0 exclude settings must be specified in editor inside ProjectCleaner plugin window.

-Check

Shows only statistics. Wont perform any delete operations.

-ScanDevContent

Scan Developer Content folder or not

-DeleteEmptyFolders

Delete empty folders after unused assets deleted or not

-ExcludeAssets

Exclude given assets.
Must be asset object path and seperated with comma if multiple assets.
-ExcludeAssets="/Game/StarterContent/Textures/T_Wood_Walnut_N.T_Wood_Walnut_N"
-ExcludeAssets="/Game/StarterContent/Textures/T_Wood_Walnut_N.T_Wood_Walnut_N,/Game/StarterContent/Props/SM_Statue.SM_Statue"

-ExcludeAssetsInPath

Exclude all assets in given paths
-ExcludeAssetsInPath="/Game/Blueprints,/Game/Materials"

-ExcludeAssetWithClass

Exclude assets with given class
-ExcludeAssetsWithClass="Material"
-ExcludeAssetsWithClass="Material,Texture2D"

If no arguments given, then default settings will be used, which are

  • ScanDevContent = false
  • DeleteEmptyFolders = true
  • No excluded assets

Common errors

If you see this type of error in terminal


That means that plugin disabled in project.
You must enable it and try again.