Not translated yet — showing English.
Command Line Interface
Last updated: 6 August 2026
playserv is the operator CLI for the platform. From your machine you authenticate against your project, deploy and manage Functions (cloud functions and game servers), manage per-environment secrets, and rotate public slugs.
It's a thin client: you ship only your handler source — the platform synthesizes the Dockerfile and build files, builds the image, and rolls it out. No Dockerfile, no container registry, and no git commit on your side.
Install
The CLI is a .NET 10 global tool named playserv.
dotnet tool install --global PlayServ.Platform.Cli
playserv status # verify it's on your PATHUpdate later with dotnet tool update --global PlayServ.Platform.Cli.
dotnet pack src/PlayServ.Platform.Cli # → artifacts/nupkg/*.nupkg
dotnet tool install --global PlayServ.Platform.Cli --add-source artifacts/nupkg
# or run without installing:
dotnet run --project src/PlayServ.Platform.Cli -- functions listNote
The platform API endpoint is built into the CLI and isn't user-configurable. Local state (session + resolved identity) lives in ~/.playserv/config.json, written atomically on login.
Authenticate
Get a Platform API key
Create a Platform API key for your project in the Backoffice — a publishable pk_* or secret sk_* key. Each key is bound to one project and one environment (dev or prod). See API Key Management.
Log in
playserv login <key> # or: playserv login (hidden prompt)This exchanges the key at the platform for an operator session and stores the access + refresh tokens plus the resolved org / project / env. The raw key is never saved. Sessions refresh automatically (30-day window), including after a slug rename, so you're not re-prompted mid-workflow.
Confirm and manage the session
playserv status shows the active project/org/env with a live probe; playserv logout clears the session.
Every project-scoped command sends Authorization: Bearer <session>, X-Project-Slug, and X-Env. --env is optional and defaults to the session's env; a conflicting value is rejected locally.
Deploy a function
functions deploy (alias fn deploy) is the core workflow: it bundles your local source, uploads it, and has the platform build and roll out the service — polling to completion.
playserv fn deploy --slug <slug> --kind <game_server|cloud_function> --src <path> \
[--language <csharp|node|python|go>] [--env <dev|prod>] [--poll-timeout <seconds>]
| Option | Required | Description |
|---|---|---|
--slug | Yes | Public name of the function. Must be a valid Cloud Run name — lowercase letters, digits, dashes, 3–50 chars. Validated locally before upload. |
--kind | Yes | cloud_function (HTTP function) or game_server (long-running service). |
--src | Yes | A single source file or a directory. bin/, obj/, .git/, and node_modules/ are excluded from the bundle. |
--language | No | csharp, node, python, or go. Auto-detected from --src when omitted (see below). |
--env | No | Target environment; defaults to the session env. |
--poll-timeout | No | How long to wait for the build/rollout before giving up. |
What happens on deploy: the CLI bundles --src into a .tar.gz, uploads it (forwarding the platform.json bindings — env vars, secrets, scaling, triggers), and polls the deployment through queued → uploading → building → deploying → deployed. The platform synthesizes the Dockerfile and build files and runs the build; you don't provide any of that.
Languages
The CLI is multi-language. What's supported depends on the kind:
| Kind | csharp | node | python | go |
|---|---|---|---|---|
cloud_function | ✓ | ✓ | ✓ | ✓ |
game_server | ✓ | ✓ | — | — |
python and go game servers are rejected today — they have no runtime story yet. Cloud functions support all four.
Auto-detection (when --language is omitted):
- by file extension —
.cs→csharp,.js/.mjs/.cjs→node,.py→python,.go→go; - by directory marker — a
.csproj→csharp,package.json→node,go.mod→go,requirements.txtormain.py→python; - falls back to
csharpif nothing matches.
playserv fn deploy --slug match-maker --kind game_server --src ./server --language csharpplayserv fn deploy --slug leaderboard --kind cloud_function --src ./fn --language node--language node accepts raw TypeScript — point --src at a folder with package.json + tsconfig.json + src/**, no pre-built index.js. The platform transpiles the entry (src/index.ts by default, or the entry field in platform.json) with esbuild at build time. It's transpile-only — run typechecking in your CI. node_modules/** and any .env* file are never uploaded; npm packages install during the build and resolve at runtime.
playserv fn deploy --slug webhook --kind cloud_function --src ./fn --language pythonPython is available for cloud_function only.
playserv fn deploy --slug webhook --kind cloud_function --src ./fn --language goGo is available for cloud_function only.
platform.json
A platform.json next to your source is authoritative for env vars, secrets, scaling, and triggers — deploy forwards those bindings. Secret values are set separately with secrets set; the manifest only declares which secret names the function uses.
Monorepo dependencies
For node, a local file: dependency whose source lives outside --src (e.g. "@scope/shared": "file:../shared") is vendored into the bundle at deploy time and aliased for the platform's esbuild step — so a server that imports ../shared still deploys from --src ./server with no local build. Registry dependencies stay external.
Deploy caveats
- Copied environments are gated. An env created as a copy of another carries no deploy link:
fn deployinto it fails with409 env_not_linkeduntil an operator re-links it (Environments tab → Re-link deploys). Builds already running there are unaffected. - Recreating a slug that previously existed can fail the build — if so,
fn deleteit, then deploy fresh. - A freshly deployed
game_servermay return401on the internal uplink until its compute service account is granted the right run roles (org policy can drop the unauthenticated binding).
Manage functions
playserv fn list [--env <env>]
playserv fn invoke --slug <slug> (--json '<json>' | --body <file>)
playserv fn delete --slug <slug> [-y]
list— table of provisioned functions: slug, kind, language, status, public URL, and id.invoke— call acloud_functionthrough thePOST /fn/<slug>gateway with an inline JSON body (--json) or a file (--body).delete— tear down the Cloud Run service and the platform record (-yskips the confirmation).
Secrets
Per-environment function secrets. Values are read from stdin only — never from an argument — so they don't land in shell history.
printf '%s' "$MY_VALUE" | playserv secrets set STRIPE_KEY --env prod
playserv secrets list [--env <env>]
playserv secrets delete STRIPE_KEY [--env <env>]
setcreates or rotates a secret and rolling-restarts the functions that use it.listshows names withlast_set_atandin_use_by— never the values.deleteis refused with409 in_usewhile a function still declares the secret.
Functions declare which secret names they need in platform.json; secrets set supplies the values.
Public slugs
Owner-only rotation of the public org/project slugs. Rate-limited (once per 30 days, 5 lifetime); the old slug redirects for a window, then returns 404.
playserv org:regenerate-slug --confirmation <current-slug> [--redirect-window-days <N>]
playserv project:regenerate-slug --confirmation <current-slug> [--redirect-window-days <N>]
Command reference
| Command | Purpose |
|---|---|
playserv login [token] | Exchange a pk_*/sk_* key for an operator session. |
playserv logout | Clear the local session. |
playserv status | Show login state with a live session probe. |
playserv fn list [--env] | List provisioned functions. |
playserv fn deploy --slug --kind --src [--language] [--env] [--poll-timeout] | Bundle, upload, build, and roll out a function. |
playserv fn invoke --slug (--json | --body) | Invoke a cloud function. |
playserv fn delete --slug [-y] | Delete a function. |
playserv secrets set <NAME> [--env] | Create/rotate a secret (value via stdin). |
playserv secrets list [--env] | List secret names. |
playserv secrets delete <NAME> [--env] | Delete a secret. |
playserv org:regenerate-slug --confirmation <slug> | Rotate the org public slug. |
playserv project:regenerate-slug --confirmation <slug> | Rotate the project public slug. |
fn is an alias for functions. Exit code is 0 on success; deploy uses distinct non-zero codes for different failure classes.
Next steps
- Functions — what cloud functions and game servers are and how they run
- API Key Management — the keys you log in with
Last updated on 6 Aug 2026