Skip to main content
Engineering

Not translated yet — showing English.

Command Line Interface

playserv is the command-line tool for running your game's backend from a terminal or from CI. It scaffolds and deploys functions and game servers, reads their logs, scales them, and manages API keys and secrets. Every command works inside one signed-in project environment and can print machine-readable output for scripts.

This page covers installing, signing in and every command. Building and shipping code is on Deploying with the CLI.


Install

Download the playserv binary for your OS with Download CLI in the Backoffice, on the Functions page of a project that has none yet or in a new project's setup banner, and put it on your PATH.

It's also a .NET global tool on the PlayServ NuGet feed, which needs no credentials. Register the feed once, then install:

dotnet nuget add source https://nuget.playserv.com/v3/index.json -n playserv
dotnet tool install --global PlayServ.Platform.Cli
playserv --version

Update it with dotnet tool update --global PlayServ.Platform.Cli. Scaffolding C# projects needs the .NET 10 SDK either way.


Sign in

The CLI works inside a session opened with a server API key. The session belongs to the key's project and environment, and every later command targets them.

playserv status
playserv login <sk_your_key>
playserv logout
CommandWhat it does
playserv login <key>Opens a session. Only server keys (sk_…) are accepted; a client key (pk_…) is refused.
playserv statusPrints the platform address, organisation, project and environment of the session. Exits 1 when you are not signed in, so scripts can use it as a guard.
playserv logoutEnds the session.

Create keys in the Backoffice (API Key Management) or with playserv keys create. The session never stores the raw key.

--env checks the environment, it doesn't switch it

Most commands accept --env <env>, but passing an environment other than the session's is refused. Use it in scripts to assert where a command runs. To work in another environment, sign in with a key for it: keep one dev and one prod key and run playserv status before anything destructive.

The CLI targets the platform its build was made for. PLAYSERV_API_URL, when set, points every command at another platform address instead.


Command reference

functions can be shortened to fn. Commands that remove or replace something ask for confirmation: publish, functions delete, rollback, disable, keys revoke, keys undo-revoke, keys rotate and rooms config delete. -y / --yes skips the prompt; other commands don't take it.

Build and ship. Details and options are on Deploying with the CLI.

CommandWhat it does
playserv init <slug>Scaffolds a project with its platform.json: a game server by default, a cloud function with --kind cloud_function. --solution <Name> scaffolds a solution with shared projects instead.
playserv publishDeploys every function in the solution that has a platform.json, after showing the plan.
playserv functions deploy --slug <slug> --kind <kind>Deploys one function from source.
playserv functions declare <slug>Registers a function without deploying code, for example a game server you run yourself.
playserv image push --slug <slug>Builds and pushes a game server image for a machine pool; --roll rolls the pool onto it.
playserv rooms config get|set|delete <slug>Reads or replaces a game server's room settings.

Inspect.

CommandWhat it does
playserv functions listEvery function in the environment: slug, kind, language, status, address.
playserv functions logs <slug>Recent log lines. --tail N, --since <ISO 8601>, --level error|warn|info.
playserv functions deploys listThe environment's deploy history, with ids.
playserv functions deploys get <id>Phase, message and timings of one deploy, by the ID functions deploy printed.
playserv functions replicas <slug>Running replicas with id, region, status and start time.

Operate.

CommandWhat it does
playserv functions redeploy <slug>Restarts the function on its current build, without rebuilding.
playserv functions rollback <slug> --to <deploy-id>Sends traffic back to an earlier deploy, by its ID in deploys list.
playserv functions enable <slug> · disable <slug>Resumes or stops serving traffic. The function and its data stay.
playserv functions scale <slug> --policy manual|auto --desired N --min N --max NReplaces the scaling spec. All four flags are required.
playserv functions delete --slug <slug>Removes the function from the environment.

Keys and secrets.

CommandWhat it does
playserv keys listEvery key in the environment, with its type, prefix, status and last use. Secret values are never shown again.
playserv keys create --name <name> [--kind sk|pk]Creates a server (default) or client key and prints its secret once.
playserv keys rotate <id>Replaces the secret. The old one stops working immediately.
playserv keys revoke <id> · keys undo-revoke <id>Revokes a key, closing its live connections, or cancels the revoke within its undo window.
playserv secrets set <NAME>Sets or rotates a secret. The value is read from stdin or a hidden prompt, never from an argument.
playserv secrets list · secrets delete <NAME>Lists secret names and which functions use them, or deletes one.

Owner only.

CommandWhat it does
playserv org:regenerate-slug --confirmation <slug>Regenerates the organisation's public slug.
playserv project:regenerate-slug --confirmation <slug>Regenerates the project's public slug.

The old slug keeps working for --redirect-window-days (0–180, default 60). Regeneration is limited to once per 30 days and five times per resource.


Secrets

Secrets are named values kept per project and environment, never in git and never in a deploy bundle. A function lists the names it needs in platform.json and reads them as environment variables; setting an existing name rotates it, and functions that use it pick up the new value.

printf %s "$STRIPE_KEY" | playserv secrets set STRIPE_API_KEY

A secret cannot be deleted while any function still declares it (secret_in_use): remove it from the manifest, redeploy, then delete. In a fresh environment, set secrets before the first deploy; a function whose declared secret has no value stays failing until it gets one.


Scripting and CI

--json makes every command machine-readable. Success prints one JSON object or array on stdout; a failure prints {"error": {…}} on stderr with summary, detail, hint and a code. A deploy that fails or times out prints its outcome on stdout, and publish reports each function's error in its results. Prompts never wait under --json: they fail and name the flag to pass.

Exit codeMeaning
0Success, including a --detach upload that was accepted.
1General failure: bad arguments, a refused prompt, an API error, or a publish with at least one failed function.
2The platform refused the upload or couldn't be reached, or login failed.
3The build failed.
4The CLI stopped waiting, or lost contact during the upload or the build. The build may still finish.
5The session expired while waiting.

A typical CI job stores an sk_ key for the target environment as a secret and runs:

playserv login "$PLAYSERV_KEY" --json
playserv status --json
playserv publish --dry-run --json
playserv publish --yes --parallel 4 --json

Unknown flags are errors (invalid_arguments), so a typo never silently does something else.


Errors

CodeWhat to do
not_logged_inRun playserv login.
env_not_resolved--env names another environment than the session's. Sign in with a key for that environment, or drop --env.
env_not_linkedThe environment is not linked for deploys. An operator relinks it in Project settings → Environments with Re-link deploys; builds already running keep running.
invalid_argumentsUnknown or malformed flag. Check playserv <command> --help.
invalid_bundleThe bundle or platform.json is malformed. The message names the file.
invalid_manifestA manifest rule failed: a bad value, scaling out of range, a bad cron, a reserved name. The message names the rule.
duplicate_function_slugTwo manifests in the solution use the same slug.
unknown_function_filterpublish --only named a function that isn't in the solution.
upload_timeoutThe upload didn't finish in time. Nothing was deployed; retry.
function_not_found · deployment_not_foundNo such slug or deploy here. Check functions list or functions deploys list.
secret_in_use · secret_not_foundSee Secrets.
token_slug_staleThe session predates a slug change. Sign in again.
prompt_unavailableA confirmation was needed under --json or in a pipe. Pass the flag the message names.
platform_unreachable · platform_timeoutCheck the network and the address playserv status prints, then retry.
unreadable_responseThe CLI and the platform are on different versions. Update the CLI.

When a deploy fails and the reason is unclear, run playserv functions deploys get <id> for the phase and message, then playserv functions logs <slug> --level error. When a function returns 404 right after a deploy, check the environment with playserv status: a function deployed to dev doesn't exist in prod.


Next steps

Last updated on 14 Oct 2026