Skip to main content

CLI reference

Every command, its aliases and its flags. Run nwm <command> --help for the same information in your terminal.

Commands that work on a server take its name as an argument or through -s/--server. Without a name nwm uses the server whose folder you are in, or the only server you have.

Aliases​

CommandAliases
nwm servers, servers, srv
nwm packagep, packages, pkg
nwm assetsa, asset
nwm nanossharpn, ns, sharp, cs
nwm reciper, recipes
nwm servicesvc, services
nwm secretsec, secrets
nwm self-updatesu, upgrade

nwm server​

server create​

nwm server create <name> [flags]
FlagDescription
-b, --branch <branch>Steam branch: public or bleeding-edge (default public, or the recipe's branch)
-d, --dir <path>Installation folder (default ~/.nwm/servers/<name>)
--display-name <name>Server name shown in the server list
--forceInstall into a folder that is not empty
--game-mode <package>Game mode package
--map <package>Map package
--max-players <n>Maximum players
--nanossharpInstall NanosSharp right after the server
--port <port>Game port
--query-port <port>Query port
-r, --recipe <source>Set the server up from a recipe
--var <name=value>Recipe variable, repeatable
--secret <name=value>Recipe secret, repeatable
--no-servicesDo not start the recipe's services
--no-hooksDo not run the recipe's hooks
-y, --yesRun hooks of remote recipes without asking
--refreshRefresh the registry index first

server import​

nwm server import <name> <directory> [-b public|bleeding-edge]

Registers an existing installation.

server update​

nwm server update [name] [-b branch] [--no-validate]

Installs the newest build of the server's branch, or switches branch with -b.

server list, info​

nwm server list
nwm server info [name]

Alias of list: ls.

server start​

nwm server start [name] [-- server arguments] [flags]
FlagDescription
-d, --detachRun in the background and write output to the log file
--no-servicesDo not start the server's Docker services
--allow-unsafe-libsApprove --enable_unsafe_libs from the recipe without asking

server stop​

nwm server stop [name] [--timeout 15s] [--services]
FlagDescription
--timeout <duration>Time to wait before killing the server (default 15s)
--servicesAlso stop the server's Docker services

server restart​

nwm server restart [name] [-- server arguments] [--timeout 15s] [--allow-unsafe-libs]

Stops the server if needed and starts it in the background.

server logs​

nwm server logs [name] [-f] [-n 50]
FlagDescription
-f, --followKeep printing new output
-n, --lines <n>Number of lines to show, 0 for all (default 50)

server config​

nwm server config [-s name]
nwm server config get <key> [-s name]
nwm server config set <key> <value> [-s name]

Shows the whole Config.toml, prints one value or sets one. Values are TOML; plain words are strings.

server trust​

nwm server trust [name] [--revoke] [--global]

Shows, grants or withdraws the approval for --enable_unsafe_libs. See C modules.

server remove​

nwm server remove <name> [--delete-files]

Alias: rm. Unregisters the server and removes its containers. --delete-files also deletes its folder, volumes and secrets.

nwm package and nwm assets​

nwm package manages packages, nwm assets asset packs. Both take -s/--server.

CommandAliasesDescription
install <name>... [-e, --enable]add, iInstall from the vault, optionally enable
update [name]...upgradeUpdate the given or all installed resources
listlsList installed resources
enable <name>...Load on server start via Config.toml
disable <name>...Stop loading on server start
remove <name>...rm, uninstallDisable and delete

nwm nanossharp​

nwm nanossharp install [server]
nwm nanossharp update [server]
nwm nanossharp uninstall [server]

nwm recipe​

CommandDescription
init [directory | file] [--name @you/name] [--toml]Create a recipe from a template
edit [directory | file] [--name @you/name] [--toml]Open the interactive editor
add [-C path] <statement>...Add a statement to a recipe
rm [-C path] <kind> <name>Remove an entry (alias remove)
show [directory | file] [--format dsl|toml]Print a recipe
convert [directory | file] --to dsl|tomlConvert between Recipefile and recipe.toml
validate [directory | file]Check a recipe for mistakes
apply <source> [-s server]Apply a recipe to an existing server
upgrade [-s server]Apply the server's recipe again with new versions
info <source> [--refresh]Show a recipe's content and versions
search [query] [--refresh]Search the registry
publish [directory] [--browser]Publish to the registry
unpublish <name> [--browser]Remove from the registry

apply and upgrade take the recipe flags --var, --secret, --no-services, --no-hooks, -y/--yes and --refresh. add and rm take -C/--dir (default .), which has to come before the statement.

nwm service​

All commands take -s/--server.

CommandDescription
listServices with image, ports and state (alias ls)
add <name> --image <image>Add a service. Flags: -p/--port, -e/--env, -v/--volume (repeatable), --start (default true)
up [service]...Start services (alias start)
down [service]...Stop services (alias stop)
logs <service> [-f] [-n 50]Show a service's output
remove <service>... [--volumes]Remove services and their containers (alias rm)

nwm secret​

All commands take -s/--server.

CommandDescription
listSecret names and lengths (alias ls)
get <name>Print a value
set <name> [value]Set a value, asks when not given
rotate <name> [--length 24]Replace with a new random value
remove <name>Delete a secret (alias rm)

nwm self-update​

nwm self-update [--force]

Updates nwm to the latest release after verifying its checksum. --force reinstalls the current version, and is required for development builds.

nwm version​

Prints the version, platform and Go version.

nwm completion​

nwm completion bash|zsh|fish|powershell

Prints a shell completion script, see Installation.