pherwerz docs
CLI reference
The phz CLI ships with @pherwerz/cloud. Run it without installing via npx @pherwerz/cloud, or as phz once installed.
Account
| Command | Does |
|---|---|
login [--api-url <url>] [--token <phz_pat_…>] | Sign in |
logout | Sign out |
link [--backend <ref>] | Choose the backend for this folder |
whoami | Who you're signed in as |
Services
| Command | Does |
|---|---|
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
| Command | Does |
|---|---|
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
| Command | Does |
|---|---|
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 functions | Deploy every function that changed |
list functions | Functions, 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 | unset | Manage 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 . --yesFor functions, set PHZ_BACKEND instead of PHZ_SERVICE and run
deploy functions --yes.