cli-anything-unrealinsights
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecli-anything-unrealinsights
cli-anything-unrealinsights
Use this CLI when you need agent-friendly access to Unreal Insights trace capture
and exporter workflows on Windows.
当你需要在Windows系统上通过Agent友好的方式访问Unreal Insights追踪捕获与导出工作流时,可以使用此CLI工具。
Prerequisites
前提条件
- Windows
- Unreal Engine tools installed with
UnrealInsights.exe - Verified with UE 5.5; headless timing exporters include compatibility handling for UE 5.3-style command parsing where possible
- Optional explicit env vars:
UNREALINSIGHTS_EXEUNREAL_TRACE_SERVER_EXEUNREALINSIGHTS_TRACE
- Windows系统
- 已安装包含的Unreal Engine工具
UnrealInsights.exe - 已在UE 5.5版本下验证;无头时序导出器尽可能兼容UE 5.3风格的命令解析
- 可选的显式环境变量:
UNREALINSIGHTS_EXEUNREAL_TRACE_SERVER_EXEUNREALINSIGHTS_TRACE
Core Commands
核心命令
Backend discovery
后端发现
powershell
cli-anything-unrealinsights --json backend infoTo use a source-built engine's matching :
UnrealInsights.exepowershell
cli-anything-unrealinsights --json backend ensure-insights `
--engine-root 'D:\code\D5\d5render-ue5_3'This first looks for under the
specified engine root, then builds it with that engine's if needed.
Engine\Binaries\Win64\UnrealInsights.exeBuild.batpowershell
cli-anything-unrealinsights --json backend info要使用源码构建引擎对应的:
UnrealInsights.exepowershell
cli-anything-unrealinsights --json backend ensure-insights `
--engine-root 'D:\code\D5\d5render-ue5_3'该命令会先在指定引擎根目录下查找,如果不存在,则使用该引擎的进行构建。
Engine\Binaries\Win64\UnrealInsights.exeBuild.batTrace session state
追踪会话状态
powershell
cli-anything-unrealinsights trace set D:\captures\session.utrace
cli-anything-unrealinsights --json trace infopowershell
cli-anything-unrealinsights trace set D:\captures\session.utrace
cli-anything-unrealinsights --json trace infoTrace Store discovery
Trace Store发现
powershell
cli-anything-unrealinsights --json store info
cli-anything-unrealinsights --json store list --live-only
cli-anything-unrealinsights --json store latest --set-currentpowershell
cli-anything-unrealinsights --json store info
cli-anything-unrealinsights --json store list --live-only
cli-anything-unrealinsights --json store latest --set-currentCapture orchestration
捕获编排
powershell
cli-anything-unrealinsights --json capture run `
--project 'D:\Projects\MyGame\MyGame.uproject' `
--engine-root 'D:\Program Files\Epic Games\UE_5.5' `
--output-trace D:\captures\boot.utrace `
--channels "default,bookmark" `
--exec-cmd "Trace.Bookmark BootStart" `
--wait --timeout 300You can also keep using the explicit form:
powershell
cli-anything-unrealinsights --json capture run `
'D:\Program Files\Epic Games\UE_5.5\Engine\Binaries\Win64\UnrealEditor.exe' `
--target-arg 'D:\Projects\MyGame\MyGame.uproject'powershell
cli-anything-unrealinsights --json capture run `
--project 'D:\Projects\MyGame\MyGame.uproject' `
--engine-root 'D:\Program Files\Epic Games\UE_5.5' `
--output-trace D:\captures\boot.utrace `
--channels "default,bookmark" `
--exec-cmd "Trace.Bookmark BootStart" `
--wait --timeout 300你也可以使用显式形式:
powershell
cli-anything-unrealinsights --json capture run `
'D:\Program Files\Epic Games\UE_5.5\Engine\Binaries\Win64\UnrealEditor.exe' `
--target-arg 'D:\Projects\MyGame\MyGame.uproject'Continuous capture session control
持续捕获会话控制
powershell
cli-anything-unrealinsights --json capture start `
--project 'D:\Projects\MyGame\MyGame.uproject' `
--engine-root 'D:\Program Files\Epic Games\UE_5.5' `
--output-trace D:\captures\live_session.utrace
cli-anything-unrealinsights --json capture status
cli-anything-unrealinsights --json capture snapshot D:\captures\live_snapshot.utrace
cli-anything-unrealinsights --json capture stopThis is the preferred flow when an agent needs to start profiling now and stop
or snapshot later in a follow-up turn.
If a tracked capture session is still running, now requires
so the previous process is stopped before a new one is launched.
capture start--replacepowershell
cli-anything-unrealinsights --json capture start `
--project 'D:\Projects\MyGame\MyGame.uproject' `
--engine-root 'D:\Program Files\Epic Games\UE_5.5' `
--output-trace D:\captures\live_session.utrace
cli-anything-unrealinsights --json capture status
cli-anything-unrealinsights --json capture snapshot D:\captures\live_snapshot.utrace
cli-anything-unrealinsights --json capture stop当Agent需要立即开始性能分析,并在后续步骤中停止或生成快照时,此流程为首选方案。
如果已追踪的捕获会话仍在运行,命令现在需要添加参数,以便在启动新进程前终止之前的进程。
capture start--replaceLive trace control backend
实时追踪控制后端
powershell
$env:UNREALINSIGHTS_LIVE_EXEC='ushell-wrapper --pid {pid} --cmd "{cmd}"'
cli-anything-unrealinsights --json live processes
cli-anything-unrealinsights --json live trace-status --pid 1234
cli-anything-unrealinsights --json live bookmark --pid 1234 "BeforeExport"
cli-anything-unrealinsights --json live stop-trace --pid 1234Live command delivery requires or .
If no backend is configured, live commands return a JSON error and do not claim
success. stops trace collection without killing the UE process;
still terminates the harness-launched process tree.
UNREALINSIGHTS_LIVE_EXEC--backend-commandlive stop-tracecapture stoppowershell
$env:UNREALINSIGHTS_LIVE_EXEC='ushell-wrapper --pid {pid} --cmd "{cmd}"'
cli-anything-unrealinsights --json live processes
cli-anything-unrealinsights --json live trace-status --pid 1234
cli-anything-unrealinsights --json live bookmark --pid 1234 "BeforeExport"
cli-anything-unrealinsights --json live stop-trace --pid 1234实时命令交付需要配置或。如果未配置后端,实时命令会返回JSON格式的错误,不会返回成功状态。会停止追踪数据收集但不会终止UE进程;仍会终止由启动器启动的进程树。
UNREALINSIGHTS_LIVE_EXEC--backend-commandlive stop-tracecapture stopGUI co-pilot
GUI辅助工具
powershell
cli-anything-unrealinsights --json gui status
cli-anything-unrealinsights --json gui open --trace D:\captures\session.utrace
cli-anything-unrealinsights --json gui open-latestGUI commands omit and so Unreal Insights remains open.
-NoUI-AutoQuitpowershell
cli-anything-unrealinsights --json gui status
cli-anything-unrealinsights --json gui open --trace D:\captures\session.utrace
cli-anything-unrealinsights --json gui open-latestGUI命令会省略和参数,以保持Unreal Insights处于打开状态。
-NoUI-AutoQuitOffline exporters
离线导出器
powershell
cli-anything-unrealinsights --json -t D:\captures\session.utrace export threads D:\out\threads.csv
cli-anything-unrealinsights --json -t D:\captures\session.utrace export timer-stats D:\out\stats.csv --region=EXPORT_CAPTURE
cli-anything-unrealinsights --json -t D:\captures\session.utrace export counter-values D:\out\counter_values.csv --counter=*Prefer equals-form wildcard filters such as and .
The harness passes simple values to UnrealInsights without inner quotes so
wildcards remain usable inside .
--timers=*--counter=*-ExecOnAnalysisCompleteCmdpowershell
cli-anything-unrealinsights --json -t D:\captures\session.utrace export threads D:\out\threads.csv
cli-anything-unrealinsights --json -t D:\captures\session.utrace export timer-stats D:\out\stats.csv --region=EXPORT_CAPTURE
cli-anything-unrealinsights --json -t D:\captures\session.utrace export counter-values D:\out\counter_values.csv --counter=*建议使用等号形式的通配符过滤器,例如和。启动器会将简单值传递给UnrealInsights,不会添加内部引号,因此通配符在中仍可正常使用。
--timers=*--counter=*-ExecOnAnalysisCompleteCmdBatch response files
批量响应文件
powershell
cli-anything-unrealinsights --json -t D:\captures\session.utrace batch run-rsp D:\out\exports.rsppowershell
cli-anything-unrealinsights --json -t D:\captures\session.utrace batch run-rsp D:\out\exports.rspAnalyze summaries
分析汇总
powershell
cli-anything-unrealinsights --json -t D:\captures\session.utrace analyze summary --out D:\out\summary
cli-anything-unrealinsights --json analyze summary --skip-export --out D:\out\summaryThe summary reports top timers, focused GameThread/RenderThread/RHIThread
hotspots, wait/task-related timers, counter peaks, and uncovered domains for
future Memory/Network/Slate/Asset/Cooking analysis.
analyze summaryexport_statussummary.diagnostics.export_status_countspowershell
cli-anything-unrealinsights --json -t D:\captures\session.utrace analyze summary --out D:\out\summary
cli-anything-unrealinsights --json analyze summary --skip-export --out D:\out\summary汇总报告包含顶级计时器、重点GameThread/RenderThread/RHIThread热点、等待/任务相关计时器、计数器峰值,以及未来可进行Memory/Network/Slate/Asset/Cooking分析的未覆盖领域。
analyze summaryexport_statussummary.diagnostics.export_status_countsJSON Output Guidance
JSON输出指南
- Prefer for agent workflows.
--json - Export commands return:
trace_pathexec_commandoutput_filesoutput_statusstatus_messagelog_pathexit_codewarningserrorssucceeded
- Capture returns:
commandtrace_pathtrace_existstrace_size- or
pidexit_code
- Continuous capture status returns:
pidrunningtarget_exeproject_pathtrace_pathtrace_sizestarted_at
- Trace Store commands return:
store_dirtrace_counttraceslatest
- Live commands return:
pidlive_commandbackendexit_codesucceeded
- Analyze summary returns:
exportsexport_statussummary.top_timerssummary.focus_threadssummary.wait_timerssummary.counter_peakssummary.diagnosticssummary.uncovered_domains
Treat as a materialized export. Treat
as an empty trace/filter result, not a backend
crash. Use , , and for retry or
debugging decisions.
output_status == "ok"output_status == "no_output"exporter_errorprocess_failedtimed_out- Agent工作流建议使用参数。
--json - 导出命令返回以下内容:
trace_pathexec_commandoutput_filesoutput_statusstatus_messagelog_pathexit_codewarningserrorssucceeded
- 捕获命令返回以下内容:
commandtrace_pathtrace_existstrace_size- 或
pidexit_code
- 持续捕获状态返回以下内容:
pidrunningtarget_exeproject_pathtrace_pathtrace_sizestarted_at
- Trace Store命令返回以下内容:
store_dirtrace_counttraceslatest
- 实时命令返回以下内容:
pidlive_commandbackendexit_codesucceeded
- 分析汇总返回以下内容:
exportsexport_statussummary.top_timerssummary.focus_threadssummary.wait_timerssummary.counter_peakssummary.diagnosticssummary.uncovered_domains
将视为已完成的导出。将视为空追踪/过滤结果,而非后端崩溃。使用、和来决定是否重试或进行调试。
output_status == "ok"output_status == "no_output"exporter_errorprocess_failedtimed_outNotes
注意事项
- v1 is Windows-first.
- v1 includes Trace Store browsing, GUI open/status, pluggable live command delivery, and timing/counter summaries.
- is a best-effort stop of the harness-launched process tree.
capture stop - is a best-effort filesystem snapshot of the active trace.
capture snapshot - Regression tests auto-discover the UE sample when present; the binary trace is not vendored.
example_trace.decomp.utrace
- v1版本优先支持Windows系统。
- v1版本包含Trace Store浏览、GUI打开/状态查询、可插拔实时命令交付,以及时序/计数器汇总功能。
- 会尽力终止由启动器启动的进程树。
capture stop - 会尽力对活跃追踪数据进行文件系统快照。
capture snapshot - 当存在UE示例追踪文件时,回归测试会自动发现该文件;二进制追踪文件未被包含在内。
example_trace.decomp.utrace