Command-line interface for Unreal Engine 4
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Command-line interface for Unreal Engine 4

This package implements a command-line tool called ue4 that provides a simplified interface to various functionality of the build system for Epic Games' Unreal Engine 4. The primary goals of this tool are as follows:

  • Abstract away the platform-specific details of the various batch files and shell scripts scattered throughout the Engine's source tree.
  • Provide the ability to easily generate IDE project files under Linux, where no shell integration currently exists to perform this task from outside the Editor.
  • Determine the compiler flags required to build third-party libraries for use within Engine modules. This is particularly important under macOS and Linux where symbol interposition can cause clashes between external libraries and those bundled in the ThirdParty directory of the Engine source tree, and under Linux where libraries need to build against the Engine's bundled version of libc++.

This package requires Unreal Engine 4.19 or newer (since 4.19 is the first release to include the necessary patches to UnrealBuildTool.) The package also requires Python 3.5 or newer.



To install, simply run:

pip3 install ue4cli

Under macOS, the old version of Mono that comes bundled with the Unreal Engine breaks when compiling .NET projects that have spaces in their paths, so you will need to install the latest version of Mono using Homebrew:

brew install mono

Configuration-related commands

These commands control the configuration of ue4cli:

  • ue4 setroot <ROOTDIR> - Sets an engine root path override that supercedes auto-detect
  • ue4 clearroot - Removes any previously-specified engine root path override
  • ue4 clearcache - Clears any cached data that ue4cli has stored

Engine-related commands

These commands relate to the Unreal Engine itself:

  • ue4 root - Print the path to the root directory of the Unreal Engine
  • ue4 version [major|minor|patch|full|short] - Print the version string of the Unreal Engine (default format is "full")
  • ue4 editor [EXTRA ARGS] - Run the editor without an Unreal project (useful for creating new projects)

Project-related commands

These commands relate to an individual Unreal project, and will look for a .uproject file located in the current working directory:

  • ue4 run [--debug] - Run the editor for the Unreal project
  • ue4 gen [EXTRA ARGS] - Generate IDE project files for the Unreal project
  • ue4 build [CONFIGURATION] - Build the editor for the Unreal project
  • ue4 clean - Clean the Unreal project
  • ue4 test [--list] [--all] [--filter FILTER] TEST1 TEST2 TESTN - Run automation tests for the Unreal project

Library-related commands

These commands are for developers compiling modules that need to build against UE4-bundled third-party libraries for purposes of interoperability with the engine:

  • ue4 libs - List the supported third-party libs
  • ue4 cxxflags [--multiline] [--nodefaults] [LIBS] - Print compiler flags for building against libs
  • ue4 ldflags [--multiline] [--flagsonly] [--nodefaults] [LIBS] - Print linker flags for building against libs
  • ue4 cmakeflags [--multiline] [--nodefaults] [LIBS] - Print CMake flags for building against libs
  • ue4 includedirs [--nodefaults] [LIBS] - Print include directories for building against libs
  • ue4 libfiles [--nodefaults] [LIBS] - Print library files for building against libs
  • ue4 defines [--nodefaults] [LIBS] - Print preprocessor definitions for building against libs

Automation-related commands

These commands relate to Unreal's automation system. Unless explicitly specified, the platform and project file path arguments will be automatically generated when invoking RunUAT:

  • ue4 uat [ARGS] - Invoke RunUAT with the specified arguments
  • ue4 package [CONFIGURATION] [EXTRA UAT ARGS] - Package a build of the Unreal project in the current directory using common packaging options, storing the result in a subdirectory named "dist". Default configuration is Shipping.

Engine location detection


The default engine installation directory is searched:

%PROGRAMFILES%\Epic Games\UE_4.*


The default engine installation directory is searched:

/Users/Shared/Epic Games/UE_4.*


Under Debian-based distributions, the Engine's shell integration is utilised to locate the root directory, by parsing the shortcut file:


If this file doesn't exist, then the command UE4Editor needs to be in the system PATH.