命令行界面 - CLI
如何使用命令行界面来安装包和更新服务器。
The Server provides a CLI (Command Line Interface) to help creating, updating and downloading Packages and Assets from the Vault.
它可以通过两种不同的模式工作:交互模式或在启动时直接运行命令的直接模式。
在交互模式下启动 CLI
要运行 cli,请使用 --cli 参数启动服务器,这将启动交互式 CLI:
- Windows
- Linux
./NanosWorldServer.exe --cli
./NanosWorldServer.sh --cli
启动后,如果你输入 help,就可以看到所有可用的命令:
INFO Starting nanos world CLI - Command Line Interface (beta)
nanos world cli> help
INFO Available commands:
- stop
- help
- update [package|assets] NAME1, NAME2...
- install [package|assets] NAME1, NAME2...
- add [package|assets] NAME
- check
nanos world cli>
备注
Although the help output shows commas, several names must be separated by spaces, e.g. install package sandbox battlefield-kill-ui. The upload command is also available, see the table below.
所有 CLI 命令
| 命令 | 描述 |
|---|---|
install package [PACKAGE_NAMES...] | Install Packages (and their requirements) from the Vault |
update package [PACKAGE_NAMES...] | Update Packages from the Vault |
install assets [ASSET_NAMES...] | Install Asset Packs from the Vault |
update assets [ASSET_NAMES...] | Update Asset Packs from the Vault |
add package [PACKAGE_NAME] | Creates a new local Package in an interactive way |
add assets [ASSET_NAME] | Creates a new local Asset Pack in an interactive way |
upload package [PACKAGE_NAME] | Uploads a new version of a Package to the Vault (requires a token) |
upload assets [ASSET_NAME] | Uploads a new version of an Asset Pack to the Vault (requires a token) |
check | 检查更新 |
help | 显示所有命令 |
stop | 停止 CLI |
在单行/直接模式下运行 CLI
也可以在直接模式下运行 CLI,只需在 --cli 后面直接连同命令一起运行即可。示例:
- Windows
- Linux
./NanosWorldServer.exe --cli update package sandbox
./NanosWorldServer.sh --cli update package sandbox
提示
你还可以在单个命令中安装/更新多个包/资产,只需用空格将它们隔开即可:
install package sandbox battlefield-kill-ui