CLI命令
Command 结构
所有命令遵循模式:unraid-api <command> [options]
🚀 服务管理
开始
unraid-api start [--log-level <level>]
Starts the Unraid API service.
选项:
--log-level:设置日志记录级别(trace|debug|info|warn|error|fatal)
替代:您也可以使用 LOG_LEVEL 环境变量设置日志级别:
LOG_LEVEL=trace unraid-api start
停止
unraid-api stop [--delete]
Stops the Unraid API service.
--delete: 可选。删除PM2主目录
重启
unraid-api restart [--log-level <level>]
重新启动 Unraid API 服务。
选项:
--log-level:设置日志记录级别(trace|debug|info|warn|error|fatal)
替代:您也可以使用 LOG_LEVEL 环境变量设置日志级别:
LOG_LEVEL=trace unraid-api restart
日志
unraid-api logs [-l <lines>]
查看API日志。
-l, --lines: 可选。要尾部的行数(默认: 100)
⚙️ 配置命令
配置
unraid-api config
显示当前配置值。
切换环境
unraid-api switch-env [-e <environment>]
在生产和测试环境间切换。
-e, --environment: 可选。目标环境(生产|暂存)
开发者模式
Web GUI管理
您也可以通过Web GUI管理开发者选项,路径为 设置 → 管理访问 → 开发者选项
unraid-api developer # Interactive prompt for tools
unraid-api developer --sandbox true # Enable GraphQL sandbox
unraid-api developer --sandbox false # Disable GraphQL sandbox
unraid-api developer --enable-modal # Enable modal testing tool
unraid-api developer --disable-modal # Disable modal testing tool
配置API的开发人员功能:
- GraphQL沙箱:启用/禁用Apollo GraphQL沙箱位于
/graphql - 模态测试工具:在 Unraid 菜单中启用/禁用用户界面模态测试
API密钥管理
Web GUI管理
您也可以通过Web GUI管理API密钥,路径为 设置 → 管理访问 → API密钥