Epic Games CLI (Legendary)
Legendary 是一个免费、开源的 Epic Games 启动器命令行替代品。当用户想要在终端中管理其 Epic 游戏库——安装游戏、启动标题、同步云存档或浏览 Epic 集合时,可使用此技能。
安装
先决条件:
- Python 3.9+(64 位)
- pip 包管理器
通过 PyPI 安装(推荐):
pip install legendary-gl
如需浏览器登录支持:
pip install legendary-gl[webview]
替代方案:从源码安装
git clone https://github.com/derrod/legendary.git
cd legendary
pip install .
初始设置
身份验证
首先,使用您的 Epic Games 账户进行身份验证:
# 标准身份验证(打开浏览器进行登录)
legendary auth
# 从 Epic Games 启动器导入现有会话(会注销 EGL)
legendary auth --import
基于浏览器的身份验证将:
- 打开默认浏览器到 Epic Games 登录页面
- 提示您使用 Epic 凭证登录
- 显示一个身份验证代码
- 当您返回终端时自动保存会话
验证
验证您已登录:
legendary whoami
配置存储于 ~/.config/legendary/config.ini(Linux/macOS)或 %APPDATA%\legendary\config.ini(Windows)。
命令概览
| 命令 | 描述 |
|---|---|
legendary auth | 使用 Epic Games 进行身份验证 |
legendary list | 列出您库中的所有游戏 |
legendary list-installed | 列出已安装游戏并检查更新 |
legendary install <app> | 安装/下载游戏 |
legendary launch <app> | 启动/玩游戏 |
legendary uninstall <app> | 卸载游戏 |
legendary sync-saves | 同步云存档 |
legendary egl-sync | 与 Epic Games 启动器同步 |
常见用例
浏览游戏库
# 列出 Epic 游戏库中的所有游戏
legendary list
# 列出详细信息
legendary list --csv
# 强制刷新元数据(如果列表看起来过时,很有用)
legendary list --force-refresh
# 仅列出虚幻引擎内容
legendary list --include-ue
管理已安装游戏
# 列出已安装游戏
legendary list-installed
# 检查已安装游戏的更新
legendary list-installed --check-updates
# 更新特定游戏
legendary update <app-name>
# 更新所有已安装游戏
legendary update --skip-dlc
安装游戏
# 安装游戏(使用 list 命令中的应用名称)
legendary install Anemone
# 安装到自定义目录
legendary install <app-name> --base-path /path/to/games
# 指定平台安装
legendary install <app-name> --platform Windows
# 安装游戏及 DLC
legendary install <app-name> --include-dlc
# 安装时不进行选择性下载(获取所有组件)
legendary install <app-name> --disable-sdl
# 静默安装(无提示)
legendary install <app-name> -y
启动游戏
# 启动游戏
legendary launch "world of goo"
# 以离线模式启动
legendary launch <app-name> --offline
# 显示启动命令但不执行
legendary launch <app-name> --dry-run
# 使用自定义参数启动
legendary launch <app-name> --override- exe "path/to/exe" --working-dir "path/to/dir"
云存档管理
# 同步所有云存档(上传和下载)
legendary sync-saves
# 仅下载存档(不上传)
legendary sync-saves --skip-upload
# 即使本地更新也强制下载
legendary sync-saves --force-download
# 清理旧的云存档
legendary clean-saves
游戏信息
# 获取游戏的详细信息
legendary info <app-name>
# 列出游戏清单中的文件
legendary list-files <app-name>
# 列出游戏的可用云存档
legendary list-saves <app-name>
导入现有游戏
如果您通过 Epic Games 启动器安装了游戏:
# 从 Epic Games 启动器导入游戏
legendary import-game <app-name> "/path/to/epic/install/dir"
# 一次性同步 Epic Games 启动器
legendary egl-sync --one-shot
# 持续同步 EGL(macOS 上不可用)
legendary egl-sync
便捷别名
在 ~/.config/legendary/config.ini 中创建别名:
[Legendary.aliases]
; Alias = App Name
HITMAN 3 = Eider
gtav = 9d2d0eb64d5c44529cece33fe2a46482
然后在命令中使用别名:
legendary launch HITMAN 3
legendary install gtav
命令参考
legendary list [options]
| 选项 | 描述 |
|---|---|
--platform <p> | 按平台过滤(Windows/Mac) |
--include-ue | 包含虚幻引擎内容 |
-T | 禁用终端格式化 |
--csv | 以 CSV 格式输出 |
--tsv | 以 TSV 格式输出 |
--json | 以 JSON 格式输出 |
--force-refresh | 强制刷新所有元数据 |
legendary install <app-name> [options]
| 选项 | 描述 |
|---|---|
--base-path <path> | 自定义安装目录 |
--platform <p> | 指定平台 |
--include-dlc | 安装 DLC |
--disable-sdl | 禁用选择性下载 |
--reset-sdl | 重置选择性下载选择 |
--skip-dl | 跳过下载,仅安装 |
-y | 自动确认所有提示 |
--update | 如果已安装则更新 |
legendary launch <app-name> [options]
| 选项 | 描述 |
|---|---|
--offline | 以离线模式启动 |
--dry-run | 显示命令但不执行 |
--json | 以 JSON 格式输出启动信息 |
--override- exe <path> | 自定义可执行文件 |
--working-dir <path> | 自定义工作目录 |
legendary sync-saves [options]
| 选项 | 描述 |
|---|---|
--skip-upload | 仅下载存档 |
--force-download | 强制下载覆盖本地 |
--force-upload | 强制上传覆盖远程 |
高级功能
跨平台游戏
# 在 Linux 上通过 Proton/WINE 运行 Windows 游戏
legendary install <app-name> --platform Windows
legendary launch <app-name> --wine
# 通过 CrossOver 运行(macOS)
legendary launch <app-name> --crossover-bottle <bottle-name>
选择性下载
Legendary 支持选择性下载以节省磁盘空间:
# 启用选择性下载进行安装
legendary install <app-name>
# 重置 SDL 选择
legendary install <app-name> --reset-sdl
# 禁用 SDL(获取所有组件)
legendary install <app-name> --disable-sdl
配置
编辑 ~/.config/legendary/config.ini:
[Legendary]
max_memory = 2048 ; 最大共享内存(MB)
max_workers = 8 ; 最大工作进程数
install_dir = ~/Games ; 默认安装目录
故障排除
身份验证问题
如果身份验证失败:
# 清除现有会话
legendary auth --delete
# 重新进行身份验证
legendary auth
游戏无法启动
-
检查游戏是否需要在线身份验证:
legendary launch <app-name> -
如果 DRM 允许,尝试离线模式:
legendary launch <app-name> --offline -
使用
--dry-run查看启动命令:legendary launch <app-name> --dry-run
下载速度慢
在配置中调整最大工作进程数:
[Legendary]
max_workers = 16
max_memory = 4096
从 Epic Games 启动器导入
macOS 版本的 EGL 不支持导入。使用:
# 在 Windows/Linux 上
legendary egl-sync
资源
- 官方 GitHub:https://github.com/derrod/legendary
- 文档:https://github.com/derrod/legendary#readme
- PyPI 包:https://pypi.org/project/legendary-gl/
- 许可证:GPL-3.0
限制
- 无法购买游戏(只能下载已拥有的游戏)
- 无法领取免费游戏(必须使用网页商店或 EGL)
- macOS EGL 同步不支持(EGL 限制)
- 需要终端使用(无 GUI)
替代工具
如需 GUI 体验:
- Heroic Games Launcher:https://heroicgameslauncher.com/(Legendary 的 GUI 前端)
- Lutris:https://lutris.net/(Linux 游戏管理器,集成了 Legendary)