参考

um 命令行

十个命令组负责 Mod 中的机械性工作,免得 Agent 临场发挥。每个命令组都有带示例的 --help。

um scan

查找已安装的游戏并识别其特征:引擎、脚本运行时、反作弊、Mod 加载器、存档。只读操作。最后给出排好序的路线和该读的手册。

um scan
um scan --list                 # Steam / Epic / Xbox installs (Windows, WSL, Linux, macOS)
um scan terraria               # fuzzy name or a path
um scan "C:\Games\Foo" --json  # machine-readable, for agents

um fal

通过纯 REST 调用 fal 生成游戏素材。需要 FAL_KEY。每次调用都会写入记录清单,任何素材都可追溯和重新生成。

um fal
um fal sprite "a rusty scrap drone enemy, side view, 16-bit pixel art" --name drone
um fal image "key art: ..." --aspect 16:9
um fal edit "same drone, second animation frame" --ref assets/gen/drone.png
um fal rmbg in.png                     # background removal
um fal pixelate in.png --colors 24
um fal texture "mossy cobblestone"     # seamless tiling
um fal pbr "rusted sheet metal"        # basecolor/normal/roughness/metalness/height
um fal model3d concept.png             # image -> textured GLB (Trellis 2)
um fal rig character.glb --animate     # auto-rig a humanoid
um fal sfx "laser rifle shot" --seconds 1.5
um fal music "tense boss battle, chiptune, 140 bpm" --seconds 60
um fal voice "You dare challenge the Mothership?" --voice-id Adam
um fal video still.png "camera orbits the boss"
um fal search "image to 3d" | um fal schema fal-ai/trellis-2 | um fal price fal-ai/trellis-2

um comfy

用本地 ComfyUI 服务生成图片:不需要 API 密钥,用你自己的显卡。可运行任何用 Export (API) 导出的工作流。

um comfy
um comfy status
um comfy image "a red health potion" --sprite      # plain background, then cut out
um comfy run my_workflow.json --set 6.text="a blue mana potion" --set 3.seed:=42

um sprite

把生成的美术变成游戏需要的精确帧。

um sprite
um sprite cutout in.png out.png                 # flat background -> transparent
um sprite fit in.png out.png --size 64x26       # trim + nearest-neighbour fit
um sprite pixelate in.png out.png --size 32x32 --colors 16 --outline
um sprite palette in.png out.png --from ref.png # snap to a game's palette
um sprite sheet out.png f1.png f2.png --cols 4
um sprite slice sheet.png outdir --frame 32x32
um sprite frames in.png outdir --n 3 --kind bob # quick idle animation
um sprite team-mask in.png out.png --hue blue   # player-colour mask
um sprite seamless in.png out.png

um render3d

用 Blender 按游戏镜头把 GLB 渲染成精灵帧。预设:aoe2(16 个朝向)、iso8、trueiso、topdown、side、turntable。

um render3d
um render3d model.glb out/ --preset aoe2 --length 80 --anims idle:10:bob,walk:12:bob --shadows
um render3d model.glb out/ --preset side --canvas 128 --length 110
um render3d model.glb out/ --preset iso8 --canvas 256x256 --engine eevee

um win

让 Agent 操控 Windows 游戏(原生或通过 WSL):GPU 安全的窗口截取、只发给游戏的输入、只录游戏声音的录制。

um win
um win setup                                   # PowerShell tools + ffmpeg with gfxcapture
um win ps [name]
um win launch --steam 105600 -- -windowed
um win shot --exe AoE2DE_s.exe out.png --scale 0.33
um win drive --proc AoE2DE_s "focus" "click 640 360" "key 0x1B"
um win record --exe Game.exe --out C:\caps\take1 --seconds 30
um win kill <pid>                              # exact PID only
um win reg set KEY VALUE DATA --type REG_DWORD # backs up first

um video

用 ffmpeg 和 Pillow 做展示视频:用缩略图总表挑片段,再把 EDL(JSON)编译成带标题、按节拍剪辑并配乐的视频。

um video
um video contact clip.mp4 sheet.png --every 2
um video first-frame take.mkv
um video beats music.mp3
um video mux take.mkv take.mkv.audio.raw take.mkv.json out.mp4
um video compile edl.json out.mp4 --preview

um backup

给存档目录做快照、比较和恢复。恢复前会先给当前状态做快照,所以恢复本身也能撤销。

um backup
um backup create "C:\Users\me\Documents\My Games\Terraria" --name terraria-saves
um backup list
um backup diff terraria-saves
um backup restore terraria-saves

um publish check

分享前检查 Mod 目录。发现逐字节相同的游戏文件、泄露的密钥和 .env 文件会直接失败;发现反编译特征、大型引擎包、绝对路径和缺少致谢会给出警告。

um publish check
um publish check ./MyMod --game "C:\Program Files (x86)\Steam\steamapps\common\Terraria"

um kb

共享知识库。在仓库外也能搜索,用的是从 GitHub 同步的副本。

um kb
um kb search "unreal pak mod"
um kb search terraria --route loader-api
um kb show games/terraria/fal-arsenal.md
um kb new --game "Hades II" --title "A new boon god" --from-scan "hades"
um kb check knowledge/games/hades-ii/new-boon-god.md
um kb pr knowledge/games/hades-ii/new-boon-god.md --yes   # after your human says OK

示例改编自 um/ 中各模块自带的帮助。另外附带两个无需编译的 Windows 工具:WinDrive 输入和 ProcLoopback 只录游戏声音(内嵌 C# 的 PowerShell)。

常见问题

怎么安装 um 命令行?

插件安装和克隆仓库都会把它加入 PATH。其他情况:uv tool install git+https://github.com/rehan-remade/universal-modder(或 pipx install)。它不在 PyPI 上。见安装教程。

um 需要 AI Agent 吗?

不需要。它是普通的 Python 命令行,每条命令都可以手动运行。它的设计方便 Agent 调用,关键处支持 --json 输出。