~/docs/cli

Dashboard

pherwerz docs

CLI reference

The phz CLI ships with @pherwerz/cloud. Run it without installing via npx @pherwerz/cloud, or as phz once installed.

Updated

2026-12-02

Source

apps/web/docs/cli.mdx

Account

CommandDoes
login [--api-url <url>] [--token <phz_pat_…>]Sign in
logoutSign out
link [--backend <ref>]Choose the backend for this folder
whoamiWho you're signed in as

Services

CommandDoes
deploy service [folder|archive]Upload and deploy a web service, static site or cron job
cron run <name|id>Start a run, follow its log, exit with its code

deploy service takes --service <id>, --environment <id> --name <n>, --static, --cron "<schedule>", --command "<cmd>", --timezone <zone> and --detach.

Databases

CommandDoes
db tunnel <name|id>Open localhost:<port> to a database
db migration new <name>Create phz/migrations/<timestamp>_<name>.sql
db push <name|id> [--dry-run]Apply migrations the database hasn't seen
gen types --db-url <url> [--out <file>]Print the Database type

Functions

CommandDoes
new function <name>Create phz/functions/<name>/index.ts
serve [--port 54321]Run functions locally with hot reload
deploy function <file|folder|name>Deploy one function
deploy functionsDeploy every function that changed
list functionsFunctions, versions and URLs
logs function [name] [--follow]Recent log lines
rollback function <name> <version>Make an earlier version live
delete function <name>Delete a function and its versions
secrets list | set | unsetManage function secrets

In CI

terminal

export PHZ_API_URL=https://api.pherwerz.app
export PHZ_ACCESS_TOKEN=phz_pat_…
export PHZ_SERVICE=<service id>
npx @pherwerz/cloud deploy service . --yes

For functions, set PHZ_BACKEND instead of PHZ_SERVICE and run deploy functions --yes.