-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Welcome to the CUE4Parse.CLI wiki! Also see my Stalker, Supraworld, SupraTools and Subnautica wikis.
- New! check out the Python version, cross-platform and scriptable, future updates go there first: CUE4Parse-Python.
- Binary releases: https://github.com/joric/CUE4Parse.CLI/releases/
- Source code: https://github.com/joric/CUE4Parse.CLI
Neither CUE4Parse nor FModel provide CLI or RPC interfaces, which makes exporting tedious, awkward, and frustrating. I built this tool so I wouldn't have to write custom exporters for every game or rely solely on a GUI. It supports converting files from lists and wildcard patterns, exports data in parallel, and can skip existing files to speed up the process. You aren’t vendor-locked to this tool - FModel's GUI gives you the same export formats, it just doesn't support automation.
Usage:
cue4parse [options]
Options:
-i, --input <input> Input game directory
--pak <pak> Single .pak file to process (no directory scanning)
-o, --output <output> Output directory (optional for list/json/csv modes)
-p, --package <package> Package path or wildcard pattern (repeatable)
-c, --config <config> Package list (repeatable)
-g, --game <game> Game version [default: GAME_UE5_LATEST]
-k, --key <key> AES key in hex format (repeatable)
-m, --mappings <mappings> Mappings file
-f, --format <format> Output format: raw, json, csv, png [default: auto]
-l, --list List matching packages (supports csv)
-y, --yes Overwrite existing files
-v, --verbose Enable verbose output
--mesh-format <mesh-format> Mesh format: ActorX (psk), Gltf2 (glb), UEFormat (uemodel), OBJ [default: ActorX]
--anim-format <anim-format> Animation format: ActorX (psa), UEFormat (ueanim) [default: ActorX]
--texture-format <texture-format> Texture format: Png, Jpeg, Tga, Dds [default: Png]
--material-format <material-format> Material format: FirstLayer, AllLayersNoRef, AllLayers [default: AllLayersNoRef]
--lod-format <lod-format> LOD format: FirstLod, AllLods [default: AllLods]
--socket-format <socket-format> Socket format: Bone, Socket, None [default: Bone]
--nanite-format <nanite-format> Nanite format: OnlyNaniteLOD, OnlyNormalLODs, AllLayersNaniteFirst, AllLayersNaniteLast [default: AllLayersNaniteFirst]
--export-morph-targets Export morph targets [default: True]
--export-materials Export materials with meshes [default: True]
--export-hdr-as-hdr Export HDR textures as .hdr [default: True]
--compression <compression> Compression: None, GZIP, ZSTD [default: None]
--version Show version information
-?, -h, --help Show help and usage information
Examples:
List all packages:
cue4parse -i MyGame -l
Process a single .pak file (no directory needed):
cue4parse --pak MyMod.pak -o Exports -m Mappings.usmap -g GAME_UE5_1
Export a single package to stdout in json format:
cue4parse -i MyGame -p Assets/MyAsset.uasset -f json
Export with PSK meshes and PSA animations:
cue4parse -i MyGame -p */SkeletalMeshes/* -o Exports --mesh-format ActorX --anim-format ActorX
Export packages from list, overwrite existing files:
cue4parse -i MyGame -c packages.txt -o Exports -y
Game version (e.g. -g GAME_UE5_6) is required to match the game binary. There is fallback to GAME_UE5_LATEST, but it rarely helps. It would be great to have game version autodetect but it needs exe scanning as in UE4SS, and it's still unreliable.
Package lists (-c, config) contain package paths. They support wildcards (* and ?) and ini-like headers (unused for now, remained from Ue4Export). Paths without wildcards are processed faster (especially for large games with many files).
Section headers don't serve any function yet, they are just for clarity. You can dump package list with -l and use it for export.
Mapping files (-m, *.usmap) are mandatory for decoding the game content. It's easy to make with UE4SS (Dampers - Generate .usmap file). Read SupraTools wiki about UE4SS. There's also a collection of mapping files by @TheNaeem.
- Wiki: https://github.com/joric/stalker/wiki
- Scripts: https://github.com/joric/stalker/blob/main/scripts/
In Stalker 2, exporting 80,000 map segments from FModel takes around 2 hours and 70 GB, but if you know list of a few hundred referenced files, it's near-instant. The missing_files.txt is generated from WorldMap_WP.json by helper scripts.
- export_assets.cmd:
@echo off
set exe=cue4parse
set out=C:\Temp\Exports
set root=E:\Games\S.T.A.L.K.E.R. 2.Heart.of.Chornobyl.Ultimate.Editon
set mappings=%root%\Stalker2.usmap
set options=-i "%root%" -m "%mappings%" -g GAME_Stalker2 -o %out%
%exe% %options% -c assetlist.txt || exit
if exist missing_files.txt (
%exe% %options% -c missing_files.txt
)- assetlist.txt:
[Text]
Stalker2/Content/_Stalker_2/maps/_Stalker2_WorldMap/WorldMap_WP.umap
[Texture]
Stalker2/Content/GameLite/FPS_Game/UI/UIIcons/Markers/*
Stalker2/Content/GameLite/FPS_Game/UIRemaster/UITextures/Inventory/*
[Raw]
Stalker2/Content/GameLite/*GameData*/*.cfg
- Most of proprietary Stalker 2 configs are now packed into
cfg.bin(since 1.6), but you can download them from nexus. - CUE4Parse supports small virtual textures (no LFS support for 64k, see #127, use Zentools and vt_simple.py for large VT).
- Wiki: https://github.com/joric/supraworld/wiki
- Scripts: https://github.com/joric/supraworld/blob/main/scripts/
Nothing fancy, but it can export HDR images (I convert them with imagemagick) and match file version with the wildcards.
- export_assets.cmd:
@echo off
set root=E:\Games\Supraworld
set out=C:\Temp\Exports
set opt=-i "%root%" -m "%root%\Mappings.usmap" -g GAME_UE5_6 -o "%out%"
cue4parse %opt% -c assetlist.txt- assetlist.txt:
[Text]
Supraworld/Plugins/GameFeatures/Supraworld/Supraworld/Content/Maps/Supraworld.umap
[Texture]
Supraworld/Plugins/Supra/PlayerMap/Content/Textures/T_SupraworldMapV?Q?.uasset
[Text]
*ShopItem_*.uasset
*Abilities*/Inventory_*.uasset
*Abilities*/Equipment_*.uasset
*Material*.uasset
Run this command in the project directory to build a single file release (the file is copied to the publish folder):
dotnet publish -c Release
All the packaging settings are in CUE4Parse.CLI.csproj. It does the usual single-exe binary stuff but excludes CUE4Parse and Newtonsoft.Json from Trimmer. This way you can still trim the code but you don't get import errors on json conversion.
GitHub Actions supports automated builds for tags matching cli-* (e.g., cli-0.1.2). The action strips the cli- prefix and passes the version to dotnet publish -p:CliVersion=<version>. To use this workflow, create a GitHub Release with a cli-* tag. The action will build and attach the binary to the published release automatically. It is the intended way to add binaries.
- Pre-unpacked assets support.
- Multiplatform releases.
- Asset list sections.
I would like to thank Crystal Ferrai for Ue4Export as the main source of inspiration. Great tool, but lacked a few things at the moment (BCD codec, a non-overwrite feature and image paths were broken). It's better now.
Of course, I would also like to thank Fabian for the original CUE4Parse and Valentin for FModel. It's rather weird that neither CUE4Parse nor FModel dont't have an official CLI or RPC support.
Another tool I tested is UnrealExporter by luk-gg. It seems pretty advanced but has an overcomplicated config. The releases don't support new games. Haven't looked at the sources just yet.
I would also thank MountainFlash for pyUE4Parse, I used it a lot in the past but it's getting a little bit old now when most games are made in UE5.
I also would like to say a big thank you to LongerWarrior, the author of ZenTools fork that works with LFS. Without this I wouldn't be able to export large virtual textures, as CU4Parse still lacks LFS support (#127).
Also big thanks to all who forked and improved this project over the time.
- jules43 for bugfixes and localization export support.
- Corgano for more export options, pak support and stdout support.
- https://github.com/FabianFG/CUE4Parse Original CUE4Parse
- https://github.com/CrystalFerrai/Ue4Export CUE4Parse-based asset explorer
- https://github.com/luk-gg/UnrealExporter CUE4Parse-based Batch file exporter
- https://github.com/cnnrduncan/CUE4Parse CUE4Parse CLI tool for Rust integration
- https://github.com/MinshuG/pyUE4Parse CUE4Parse Python rewrite (very good, but a bit stale)
- https://github.com/covalschi/FoxholeModel CUE4Parse-based CLI Modding toolkit for Foxhole
- https://github.com/joric/maps/wiki/Tools map building tools
- https://github.com/Buckminsterfullerene02/UE-Modding-Tools/ a large (!) collection of UE links