WOR Hostdocumentation v1.0.6 Home Downloads

Command reference

Every wor command, its flags, what it does, and the output you should expect.

Exit code is 0 on success and 1 on any error, unless a section says otherwise. wor help prints a flag summary.

Example outputs on this page come from real runs of wor on macOS. Machine-specific values (tool versions, disk sizes, dates, file names) have been replaced with typical ones and long paths shortened, so your numbers will differ. On Linux, paths and a few platform-specific checks differ.

All commands

GroupCommands
Generalversion upgrade setup doctor env clean reset create
Domaindomain add domain remove
Serviceservice add remove start stop restart reload status logs chown
Runrun
Hosthost add remove list test reload logs
Databasedatabase add remove backup
Sourcesource clone pull backup
Deploydeploy rollback
SSLssl issue redirect sync renew status remove install
Inspectinfo health diagnose
Navigatepath shell-init goto
Global flags--json --non-interactive

General

wor version / --version --json

Prints the product name, version and build number. A binary built without the build stamp shows no build number. Needs no initialised workspace and no lock.

wor upgrade [--yes]

Asks the download site which release is current, shows installed against published, and installs the newer one after you confirm. Compares build numbers only when the version numbers match; a local build that is newer than the published one gets a warning before it offers to continue. Does not need an initialised workspace or the lock. Setup: Install: upgrading.

wor setup

The first-time wizard. Safe to re-run: earlier answers become the defaults. Steps and effects are in Install & first run. Always the way a workspace becomes initialised, so it is exempt from the initialised-workspace gate.

wor doctor --json

Read-only machine check: is this machine ready? A ✓ / ⚠ / ✗ checklist in four groups.

It ends with a Security section, which only ever warns and never changes the exit code: group- or other-readable .env files under WOR_HOME (with a copy-pasteable find ... -exec chmod 600); whether the web server user can traverse into WOR_HOME and into every static/php service's public/ (full check on Debian family with exact setfacl commands; other Linux families get a broad warning to also check SELinux; skipped on macOS); a WOR_HOME owned by root while you are not (this blocks ssl sync); and Let's Encrypt certificates with no renewal schedule on the machine (no systemd timer, launchd job or cron entry). It reports and shows the command; it never installs a schedule.

Exit code 1 when something required is missing: a core runtime, a configured-but-absent host provider, or an uninitialised workspace. It takes the workspace lock because it can refresh the default vhost.

The Environment block also shows the operator account, where that setting came from, and whether this account can use sudo without a password.

On a host the installer set up from nothing there is also a Readiness section, with a repair command for each finding:

LevelExamplesA first wor setup
Must fix firstRunning as the wrong account; WOR_HOME not writable or holding root-owned entries; sudo missing or refused; the web server's config test already failingStops and lists them
RiskNo PM2, PHP, Node.js, Go or Python; a firewall in the way; port 80 held by another program; sudo that needs a passwordContinues and says so
Setup will do thisWorkspace not initialised; another default site; certbot not installedContinues

A new host with nothing to fix exits 0 and says it is ready for wor setup. Doctor does not take the lock on such a host, and keeps its latest findings in $WOR_HOME/.doctor-last.json so setup can say what has changed since.

Abridged output:

$ wor doctor
WOR Doctor
==========

Environment
  OS            : macOS
  WOR_ENV       : development
  WOR_HOME      : ~/wor
  Config        : ~/.wor/config
  Host Provider : nginx
  ✓ Workspace initialized

Runtimes
  ✓ Nginx (active) nginx/1.24.0
  ✓ PHP 8.3.6 (cli) (NTS)
  ✓ PHP-FPM per-service pools available: 8.3, 8.2
  ✓ Node.js v20.11.1
  ✓ Python 3.12.3

Database
  ✓ MySQL Client /usr/bin/mysql  Ver 8.0.36
  ⚠ MariaDB not installed
  ✓ SQLite 3.45.1

Security
  ✓ Service tree is owned by a single account (you)
  ✓ No world-readable .env files found under WOR_HOME

wor env

Prints the configuration values in effect (WOR_ENV, WOR_HOME, config file and the resolved settings).

wor clean

Removes orphans: host configs, PM2 processes, systemd units and /etc/hosts entries that no domain or service references any more. Never touches anything still tied to a registered service.

wor reset

Wipes everything wor created back to a clean state: PM2 processes prefixed wor_, units wor_*.service, vhosts wor__*.conf, wor's /etc/hosts block, and the domains, backups, logs and ssl folders. Host configs that are not wor's are left alone. You must type RESET; there is no flag that skips this.

Output:

$ wor env
WOR Environment
---------------
OS                 : macOS
WOR_ENV            : development
CONFIG_FILE        : ~/.wor/config
WOR_HOME           : ~/wor
WOR_DOMAINS        : ~/wor/domains
WOR_BACKUPS        : ~/wor/backups
HOST_PROVIDER      : nginx
NGINX_BIN          : /usr/local/bin/nginx
NGINX_AVAILABLE    : /opt/homebrew/etc/nginx/servers
NGINX_ENABLED      : /opt/homebrew/etc/nginx/servers
NGINX_LOG_DIR      : /opt/homebrew/var/log/nginx
PHP_FPM_ENDPOINT   : not configured

wor create [host]

Interactive only. Accepts the optional positional host and no flags (any --flag is a usage error pointing at the automation surface). Walks through service type, domain id override, domain type (local or public) and the hosts-file entry, then creates the domain, service, scaffold, vhost, and optionally the certificate. For automation use domain add, service add and host add.

If it stops partway, the service stays recorded so it can be cleared, and wor prints the command: wor service remove <domain>/<service> --cascade.

On a host the installer set up from nothing, wor create asks about SSL only when answering yes can work. With SSL off, or a provider that is not ready (no certbot account, say), or a name that does not yet resolve or pass a local challenge test, it stays on HTTP, says why and gives the next command. If a certificate cannot be issued, the site still comes up on HTTP and wor states that the certificate is pending, the reason, and the one command to retry.

Domain

wor domain add <domain-id>
wor domain remove <domain-id>

add creates the domain's folders and config files, including its backup and log folders.

remove has no --cascade or force flag. It blocks at once if the domain still has any service, even a stopped one, and lists the exact wor service remove commands to run first. When none remain it asks, in this order, with [Y/n] defaulting to yes: Backups, Logs, Web Data. The first two only record the decision and say whether they will keep or delete. Web Data, asked last, is the confirmation for the whole set: "n" cancels everything (nothing is deleted); "y" performs all three as chosen.

Output:

$ wor domain add com-example
[OK] Domain ready: com-example

Service

wor service add <domain>/<service> [--host=<host>] [--port=<port>] [--entry=<entry-point>]
                [--service-type=static|node|go|python|php]
                [--php-version=<version>] [--no-php-pool] [--no-start]
wor service remove  <domain>/<service> [--cascade] [--yes]
wor service start|stop|restart|reload <domain>/<service>
wor service status
wor service logs    <domain>/<service> [--lines=100]
wor service chown   <domain>/<service> [<user>]

service add

FlagMeaning
--service-type=static, node, go, python or php. (Renamed from --template=.)
--host=Hostname to bind. Optional.
--port=Port for node, go and python. When omitted, wor picks a free one starting at 3000 by trying to listen on it.
--entry=Entry point file or binary name, overriding the default (app.js, app, app.py, public/index.php).
--php-version=Pick the PHP-FPM version when several are installed.
--no-php-poolUse the host-wide PHP_FPM_ENDPOINT instead of a dedicated pool.
--no-startDo not start node/go/python after creation. Use it to set up env or secrets first.

Output (a static service; node, go and python also report their port and start the service):

$ wor service add com-example/myapp --service-type=static --host=myapp.example.com --no-start
[OK] Service ready: com-example/myapp (static)

service remove

Blocks if any host still references the service, unless --cascade (which also deletes those host configs). Deletes the service's whole directory, so run wor source backup first. --yes skips the confirmation. With --cascade it also deletes the hosts' SSL records and wor's copies of their certificates; for a Let's Encrypt host it then prints sudo certbot delete --cert-name <host> (see SSL: removing a host).

start / stop / restart / logs

Route to the right provider (PM2, systemd, or nothing). They fail immediately if the domain or service does not exist; they no longer fall back to a no-op static service. start and restart then wait for the service to answer, the same way a deploy does (the readiness gate), and fail if it does not. They never revert anything. logs reads through pm2 logs or journalctl, can follow indefinitely, and therefore takes no lock.

service reload

For a php service with its own pool only. Re-renders the pool from .wor/php.ini and .wor/php-fpm.ini, validates it with php-fpm -t, reloads php-fpm, and prints the settings now in force. Configuration only: restarting a process is service restart, re-rendering a vhost is host reload. Unlike deploy it never skips an unchanged pool, because someone who typed it means it. It is also the only way to apply those files when the source is not a git repository. A service with no pool gets an error naming the command that does apply, not a silent no-op.

service status

Every service from every domain (disabled ones too), grouped by real provider: PM2 (node), SYSTEMD (go/python), PHP-FPM (php), STATIC (no process). One pm2 jlist and one batched systemctl sample serve the whole group. Columns: status, pid, uptime, CPU, memory.

The icon is config state, not healthBlue ✓ means enabled, red ✗ means disabled. There is deliberately no green dot: after an incident where the list was all green and the site was down, green was judged to read as "the site is fine", which this command never checks. The last column is process state; an enabled service whose process is not running shows that state in red. The output ends with a pointer to wor health.

Output:

$ wor service status
STATIC (no process)
  [on]   com-example/myapp   n/a      served by web server
  [on]   default/web         n/a      served by web server

(process status only -- for end-to-end health: wor health)

--json prints the list as one document instead, for a program choosing a service (wor target init asks a remote host for it): each service's domain, name, type, whether it is enabled, its port, whether it is a push service and whether it is a git clone. It does not say whether each one is running. service status only reads, so it does not wait for another wor command to finish.

$ wor service status --json
{
  "schema": 1,
  "services": [
    {
      "domain": "com-example",
      "service": "myapp",
      "type": "static",
      "enabled": true,
      "push_service": false,
      "git_clone": true
    }
  ]
}

service chown <domain>/<service> [<user>]

Hands the service's files to the operator account, or to <user>. Needs elevation. It changes the owner only, never the group, and re-grants the php-fpm pool afterwards from the group recorded for that pool (so a src/.env at 0640 keeps the group the pool user was granted against). It repairs; it does not record. Nothing is written to services.config.json, and there is deliberately no per-service owner: a service owned by someone else would be swept back by the next wor setup. Use it for a tree left behind by a root-run command, a CI rsync, or an admin who is not the operator.

Run

wor run

Brings the machine to the desired state: every enabled service, plus the runtimes and web server it needs, running. Named run rather than start or up because it is one-way, like terraform apply; there is no wor down.

  1. Once, before the loop. Start the active web server if it is not running. Start the PM2 daemon if any service needs it. If pm2 startup was never registered (nothing in wor ever did, so PM2 services never came back after a reboot), offer to register it. wor runs pm2 startup to obtain the suggested command, always shows you the full command first, then runs it through the same confirm-once sudo gate.
  2. For each enabled service. Start the runtime it needs (php-fpm for a pooled php service), then the service itself if it is not running.

A failed service is skipped; the command carries on and ends with a one-line count of successes and failures.

Host

wor host add <host> [--target=<domain>/<service>] [--server=nginx|apache] [--replace]
             [--domain-type=local|public] [--add-hosts|--no-hosts]
wor host remove <host> [--yes]
wor host list
wor host test
wor host reload
wor host logs <host> [access|error] [--lines=100]

Output of host add and host list:

$ wor host add myapp.example.com --target=com-example/myapp --domain-type=public --no-hosts
[INFO] Public domain selected. Make sure DNS points to this server.
[OK] Host ready: myapp.example.com -> com-example/myapp
Domain Type: public
DNS Note    : Make sure DNS points to this server.
$ wor host list
WOR Hosts nginx (nginx/1.24.0)

  [on]   api.example.com     -> com-example/api     :3100   -
  [on]   myapp.example.com   -> com-example/myapp   n/a     ssl
Every vhost write is validated before anything reloadshost add, create and every wor ssl write follow one sequence: snapshot the current files, write, make sure the host is enabled, run the server's config test, and reload only if it passes. A configuration the server rejects is rolled back and never reloaded. This matters because nginx -t and apachectl configtest validate the whole machine: one bad vhost fails the test for every site, and reloading anyway would take them all down. The worst case is now "this one host did not change".

Database

wor database add <domain>/<profile> [--label="Label"]
wor database remove <domain>/<profile>
wor database backup <domain>/<profile>[/database]

Backup only. There is no restore, drop or migrate, deliberately and as in v1. Engines: mysql, mariadb, postgresql, sqlserver, sqlite. A profile is a KEY=value file at $WOR_HOME/configs/database/<profile>.env (engine, host, port, name, user, password, charset, plus engine-specific keys such as SQLite path, PostgreSQL sslmode, SQL Server encrypt). Dumps are compressed with Go's own gzip and written to backups/<domain>/database/<profile>/<yyyymmdd>/.

Output of database backup (a SQLite profile):

$ wor database backup com-example/main
[INFO] Backing up sqlite database: shop
[OK] ~/wor/backups/com-example/database/main/20260101/shop_120000.sqlite.gz

Source

wor source clone  <domain>[/<service>] <git-url> [--branch=<name>] [--depth=<n>]
                  [--ssh-key=<file>] [--ca-cert=<file>] [--env=...] [--wor=...] [--yes]
wor source pull   <domain>[/<service>] [--stash]
wor source status <domain>[/<service>] [--fetch]
wor source backup <domain>[/<service>] [--gitignore=enable|disable]

wor works with any git remote. It does not care whether the server is a hosted service or one you run yourself: a hosted service, a self-hosted Gitea or Forgejo, GitLab on your own network, a bare repository on another machine, or a directory on the same disk are all just an address and a way to prove who you are.

source clone

AddressExample
httpshttps://git.example.com/org/myapp.git
sshssh://git@git.example.com:2222/org/myapp.git or git@git.example.com:org/myapp.git
git, file, local pathgit://git.example.com/org/myapp.git, file:///srv/git/myapp.git, /srv/git/myapp.git

Anything else is refused, including addresses that start with - and git's helper::address forms, because those make git run something other than a clone.

FlagMeaning
--branch=<name>Clone this branch or tag instead of the remote's default.
--depth=<n>Shallow clone of the last n commits. Smaller and faster; older commits are not available locally, so rollback --to cannot reach them. (Git ignores it for a plain local path; use file://.)
--ssh-key=<file>The private key of an SSH deploy key. It is the only identity offered, and it is recorded in the clone, so source pull, deploy and plain git in that folder keep using it. The file must not be readable by other accounts (chmod 600). ssh addresses only.
--ca-cert=<file>A CA certificate for a server whose TLS certificate is signed by a private CA, which is common for a self-hosted server. Recorded in the clone the same way. https addresses only. wor has no switch to turn certificate verification off, deliberately.
--env=keep-both|overwrite|replace
--wor=keep|delete
The answers to the two questions below. replace and delete also need --yes.

Proving who you are

For a private repository, use one of these. None of them needs a password typed into wor.

When git fails, wor adds advice based on what git said (a refused key, an untrusted certificate, a name that does not resolve, a branch that does not exist), the same whichever server answered. Under --non-interactive git is told never to ask for a username, password or passphrase, and ssh runs in batch mode, so a missing credential is an error instead of a hang:

$ wor source clone com-example/myapp https://git.example.invalid/o/r.git
[INFO] Cloning https://git.example.invalid/o/r.git
fatal: unable to access 'https://git.example.invalid/o/r.git/': Could not resolve host: git.example.invalid
[INFO] The server's name does not resolve from this machine. Check the address and this machine's DNS.
ERROR: git clone failed: exit status 128

When the target already has source

It is always backed up with source backup and replaced; no --replace flag (an old script that still passes it is ignored, not rejected). The old tree is moved aside first and only discarded after the new tree is in place; if the move fails the old tree is moved back.

Replacing the tree would also take .env and .wor with it, and the backup zip may not contain them because it filters by .gitignore. So it asks, or you answer with the flags:

FileChoices
.env--env=keep-both (default when asked: the old one stays in use, the repo's copy becomes .env.new), --env=overwrite (old stays, repo copy discarded), or --env=replace (use the repo's, discard the old; needs --yes).
.wor--wor=keep (default when asked: the current one carries into the new tree, the repo's becomes .wor.new) or --wor=delete (take the repo's copy, or none; needs --yes). wor cannot know which of two hand-written configs is wanted, so it never picks silently.

Without a terminal both flags are required when the target has that file, and wor says so before it touches the network. Afterwards, for a registered service it asks whether to deploy now (deploy --no-pull --force), since a fresh clone has no node_modules, build output or Go binary; without a terminal that question is skipped and the clone still succeeds.

Output:

$ wor source clone com-example/myapp https://git.example.com/org/myapp.git --env=keep-both --wor=keep
[INFO] Cloning https://git.example.com/org/myapp.git
[INFO] .wor in ~/wor/domains/com-example/myapp kept (--wor=keep).
[OK] Cloned: com-example/myapp
[INFO] A fresh clone has no installed dependencies or build output (node_modules, go binary, ...).
Deploy com-example/myapp now (install deps + build + restart)? [y/N]:
(no answer -- skipped)
[INFO] Skipped. Run `wor deploy com-example/myapp --no-pull --force` before starting the service.

source pull

Fast-forward only. wor never makes a merge commit on a server: when the tree has commits the remote does not (or the remote's history was rewritten), the pull fails, says so, and points at wor rollback to discard the local commits. --stash sets uncommitted changes aside for the pull and restores them afterwards; a failed pull leaves the stash in place rather than layering a conflict on a conflict.

source status

Read-only. Where the tree came from and where it stands: the remote (credentials hidden), branch, last commit, how far ahead or behind its remote, uncommitted changes, stashes, and whether the clone is shallow or uses a recorded SSH key or CA certificate. It makes no network call unless you pass --fetch, so without it "behind" means behind as of the last fetch. It takes no workspace lock.

$ wor source status com-example/myapp --fetch
WOR Source
----------
Target  : com-example/myapp
Path    : ~/wor/domains/com-example/myapp
Remote  : origin  https://git.example.com/org/myapp.git
Branch  : main
Commit  : a1b2c3d  Fix cache headers  (2 days ago)
Sync    : up to date with origin/main
Changes : clean
Stashes : 0

source backup

Writes a .zip to backups/<domain>/source/ using archive/zip (no zip program needed). By default files are also filtered through the .gitignore at the root of that tree, in addition to the exclude list in backup.config.json. --gitignore=enable|disable overrides for one run. The matcher supports comments, blank lines, ! negation, leading or middle / anchoring, trailing / for directories, and * ? [...] **, last match winning as in git. Nested .gitignore files are not read.

Each file keeps its permissions in the zip, so a restored script is still executable. A symlink is stored as a link and never followed, so a link to a folder outside the tree (for example vendor/ links made by composer path repositories) neither fails the backup nor copies that folder in. Sockets, named pipes and devices are left out with a warning. When source.retentionDays in the domain's backup.config.json is above 0, backups of the same tree older than that many days are deleted after the new one is made and verified, and each deleted file is named; the default, 0, keeps them all.

Output of source backup:

$ wor source backup com-example/myapp
[OK] ~/wor/backups/com-example/source/com-example_myapp_20260101_120000.zip

Deploy and rollback

wor deploy <host|domain/service> [--pull-only] [--no-pull] [--no-restart] [--force] [--stash] [--no-revert] [--no-hooks]
wor deploy <domain>/<service> --from=- [--json] [--no-restart] [--force] [--no-revert] [--no-hooks]
wor deploy <domain>/<service> --plan [--examples=<file>,...] [--json]
wor push [<target>] [--check-only] [--all] [--yes]
wor target init | add | list | remove | import
wor rollback <domain>/<service> [--to=<commit|tag>] [--yes]

deploy

1validate .wor settings
→
2git pull (fast-forward only)
→
3install deps if manifest changed
→
4build
→
5re-render php pool
→
6restart
→
7health check

The readiness gate

A process manager saying "started" does not mean the service serves. After the restart, a service that has a port is not reported deployed until it accepts connections, optionally answers a URL you name, and then stays up for a few seconds (which catches the commonest failure: an app that opens its port and crashes a moment later). If it does not, the deploy fails with exit code 1, the last lines of the service's log, and a pointer to wor diagnose. It waits up to 30 seconds by default.

Tune it, or turn it off, per service in .wor/deploy.ini; see Deploy settings. wor service start and wor service restart wait the same way, and fail the same way. A deploy.ini that does not parse stops a deploy after the pull but before anything is installed, built or restarted (it is the file in the new tree that counts, so the commit that fixes a broken one can deploy), but is ignored with a warning by start and restart, so a typo can never block an emergency restart.

Static and php services have no process of their own, so they are only checked when ready.path is set, through the web server.

$ wor deploy api.example.com
...
[INFO] Waiting for com-example/api to accept connections on port 3000 (up to 30s)...
[OK] Ready: com-example/api (3.8s)
[OK] Deploy completed: com-example/api

When the app never starts listening:

[INFO] Waiting for com-example/api to accept connections on port 3000 (up to 30s)...
Last lines of the service's log:
    fatal: cannot find config
[INFO] Investigate with: wor diagnose com-example/api
[INFO] To change how long wor waits, or to turn the check off: .wor/deploy.ini (see .wor/deploy.ini.example)
ERROR: com-example/api did not become ready within 30s: nothing is accepting connections on port 3000 (connection refused)

When it opens the port and then dies:

ERROR: com-example/api answered but did not stay up: the supervisor restarted it 1 time(s) since the deploy

When it never opens the port because it keeps crashing, the supervisor's restart count gives it away, and wor stops at once instead of waiting out the timeout:

ERROR: com-example/api is crash-looping: the supervisor has restarted it 2 time(s) since the deploy and it is still not ready (nothing is accepting connections on port 3000 (connection refused))

Deploy hooks

Two optional executable files in the service's own tree carry the application's own steps, so they do not have to be built into wor:

FileRunsIf it fails
.wor/hooks/pre-restartafter dependencies and build, before the restart. The place for a database migration.The deploy stops. The running version is untouched and keeps serving.
.wor/hooks/post-deployafter the service answered its readiness check. Cache warming, a notification.A warning only. The deploy had already succeeded.

If pre-restart fails, the files on disk are already at the new commit, which the running process has not loaded. wor says so and gives the command to put the previous code back:

[INFO] Running the pre-restart hook (.wor/hooks/pre-restart)...
migration 7 failed: column already exists
[INFO] The deploy stopped before the restart: com-example/api is still running what it was running before.
[WARN] The files on disk are at a1b2c3d, though, which the running process has not loaded. To put the previous code back: wor rollback com-example/api --to=9f8e7d6
ERROR: pre-restart hook failed: exit status 1
[INFO] Running the post-deploy hook (.wor/hooks/post-deploy)...
cache server unreachable
[WARN] post-deploy hook failed: exit status 2. The deploy itself succeeded; com-example/api is running the new version.
[OK] Deploy completed: com-example/api

Automatic revert

If the service fails that check after a deploy that moved the code, wor puts the previous commit back and applies it: it resets the tree to the commit that was running before the deploy, reinstalls dependencies and rebuilds for it, restarts, and waits again. The deploy is still reported as failed (exit code 1), because the deploy you asked for did not happen, even though the service is running the previous version again. The next wor deploy will pull the same failing commit again unless it has been fixed on the remote.

It only does this when going back is safe, and says why when it is not:

It acts only on a failed readiness check. A build or install that fails stops the deploy before the restart, so the old process is still running, and that error is reported as it is. When it does not revert, the output gives the way back by hand, wor rollback <target> --to=<commit>. If reinstating the previous version fails its own check, the output says plainly that the service is probably down and points at wor diagnose.

[WARN] com-example/api did not become ready after deploying a1b2c3d "v2 crashes after listening".
[INFO] Reverting to 9f8e7d6 "v1 good", the commit that was running before this deploy...
HEAD is now at 9f8e7d6 v1 good
[INFO] Waiting for com-example/api to accept connections on port 3000 (up to 30s)...
[OK] Ready: com-example/api (3.7s)
[WARN] Reverted: com-example/api is running 9f8e7d6 again.
[INFO] The next `wor deploy` will pull a1b2c3d again unless it is fixed on the remote.
ERROR: deploy of a1b2c3d failed and was reverted to 9f8e7d6: com-example/api answered but did not stay up: the supervisor restarted it 1 time(s) since the deploy

And when it must not:

[WARN] Not reverting: the tree had uncommitted changes to tracked files, which `git reset --hard` would destroy.
[INFO] To go back by hand: wor rollback com-example/api --to=9f8e7d6

Output of deploy for a static service:

$ wor deploy myapp.example.com
Already up to date.
[INFO] static service deployed. Reloading host provider.
[OK] Deploy completed: com-example/myapp

Push deploys: --from and --plan

Some projects do not deploy by pulling. Their files are checked on a developer's machine and sent to the server, into a service that is not a git clone. These two forms are the receiving end of such a push: wor push runs them for you, and a project's own deploy tool can call them too, for example over ssh.

wor deploy <domain>/<service> --plan [--examples=<file>,...] [--json]
wor deploy <domain>/<service> --from=- [--json] [--no-restart] [--force] [--no-revert] [--no-hooks]

--plan only reads, and does not wait for the workspace lock. It says what the service holds: its type, whether it is a push service or a git clone, the last push (who, which commit, when, and its list of files with their sha1), and the wor version and push format. --examples=.env.example,config/app.ini.example adds the sha1 of each named *.example file, or null when the server has none. For each .env.example named, it also lists the names of the keys in the .env beside it, never their values, so the sender can warn that the server lacks a key the new code needs.

$ wor deploy com-example/api --plan
Target       : com-example/api (static)
Source       : push
Last push    : you pushed a1b2c3d at 2026-11-28T09:14:02Z
Files        : 42
Push format  : 1 (wor 1.0.6)

--from=- reads the push from stdin: a gzip tar that starts with manifest.json (the record the push was planned against, the branch, the commit, the sha1 of every file of the pushed tree, the files to write and the files to delete), followed by the files to write. Then, holding the workspace lock:

  1. Everything is received and checked before anything changes. Every file must match the manifest's sha1. Only regular files are accepted: no symlinks, no paths outside the service. A stream cut short changes nothing.
  2. A push planned against an older record is refused: someone else pushed in between. It says who, and which commit.
  3. A git clone is refused: a push would leave it out of step with git.
  4. Some files are never written or deleted: .git, and every .env or .env.* file at any depth (the server's own secrets), except *.example.
  5. If the push carries .wor/deploy.ini (a target with dotfiles = .wor/), that file is the one that counts, and a broken one stops the push before anything changes.
  6. A backup of the tree, as wor source backup makes it, then the files are written and deleted.
  7. From there, the same steps as a pull deploy: dependencies (only if their manifest was among the pushed files), composer, build, the PHP pool, the hooks, the restart and the readiness gate.

If a later step fails, the push is undone exactly: every file it replaced or deleted is put back as it was, including files .gitignore lists (which the backup leaves out), and every file it added is removed. Dependencies and build output are brought back in line with the old files, and the service is restarted only if the failure was the readiness gate. The same rules as the automatic revert apply: once a pre-restart hook has run, or with --no-revert or revert = no, the new files stay, and the output says where the old ones are kept.

After the first push that works, the service is marked "source": "push" in services.config.json. From then on wor deploy without --from, wor source pull and wor rollback refuse it and say why. Once the archive has arrived, a closed connection does not stop the command: it finishes or undoes the push on its own. Each run writes a log, kept until the next run, in $WOR_HOME/state/push/.

$ wor deploy com-example/api --from=- --json < push.tar.gz
[INFO] Receiving the files for com-example/api...
[OK] Backup: ~/wor/backups/com-example/source/com-example_api_20261128_091402.zip
[OK] Wrote 2 file(s), deleted 1
[INFO] static service deployed. Reloading host provider.
[OK] Push deployed: com-example/api
{
  "schema": 1,
  "target": "com-example/api",
  "result": "ok",
  "backup": "~/wor/backups/com-example/source/com-example_api_20261128_091402.zip",
  "written": 2,
  "removed": 1,
  "record": "c9557345484b8d62",
  "log": "~/wor/state/push/com-example__api.last-run.log"
}

With --json, progress goes to stderr and stdout holds only the closing document. Its result is one of ok, failed_before_changes (nothing was touched), rolled_back, rollback_failed and failed_left_in_place. A failure also carries error, and kept when old files were set aside. The exit code is 1 for any result but ok.

{
  "schema": 1,
  "target": "com-example/api",
  "result": "failed_before_changes",
  "error": "nothing was changed: the service changed since this push was planned (now: you pushed a1b2c3d at 2026-11-28T09:14:02Z). Plan again and push again",
  ...
}

The lock is held from the first byte, so a slow upload makes other wor commands on the host wait for it.

wor push

wor push                                 lists the targets of this repository
wor push <target> --check-only           plans and checks; nothing is sent
wor push <target> [--all] [--yes]

Sends a folder of your git working tree to a wor service that is not a git clone, on this machine or on a server you reach with ssh. Run it anywhere inside the repository. It ships only what changed since the last push, and the server end, wor deploy --from=-, backs up, writes, reloads and undoes the push if the service does not come up.

Targets: .wor/targets.ini

One section per target, in a file at the root of the repository, committed so the whole team shares it. wor target init writes it for you; it is also short enough to write by hand:

; .wor/targets.ini
[api-local]
source  = services/api
service = shop-local/api

[api-prod]
source   = services/api
service  = shop/api
remote   = wor-prod
operator = wor
KeyDefaultMeaning
sourcerequiredThe folder of the repository to push, relative to its root; . for the whole repository.
servicerequired<domain>/<service> on the target machine. It must exist there and not be a git clone.
intothe service's rootA folder of the service, relative to its root, that receives the source folder's files: with into = public, a source file css/app.css lands at public/css/app.css. For a folder that is only a web root, such as a site built into dist/. With into, the source folder's own .wor/ is not shipped even when dotfiles names it: it still configures the push (push.*, pre-push), and the service keeps its own .wor/ (deploy settings, php settings, hooks). push.exclude, push.protect and push.follow stay relative to the source folder. It cannot be ., leave the service, or point into .wor/ or .git. A service holds one pushed tree: changing into later deletes the files at the old place, as the summary shows before you answer.
dotfilesnonePaths that start with a dot which this target may still write and delete, as a comma list of patterns written as in .gitignore, relative to the source folder: dotfiles = .wor/, .htaccess. Without it a push leaves every dot path alone, so what the server keeps in .wor/ (deploy settings, php settings, hooks), .config/ and the like is never overwritten. List .wor/ when the deploy settings and hooks belong to the repository (pm2 cluster settings, post-deploy). *.example files are shipped without being listed. .git and .env files cannot be listed: they are never shipped. A dot path the last push wrote stays when the list stops naming it.
remotethis machineAn ssh host name or an alias from ~/.ssh/config. A login, port, key or tunnel belongs in ~/.ssh/config, never here.
operatorworThe account that runs wor on the remote. When the ssh login is that account, wor runs directly; otherwise through sudo -n -u <operator>, which must not need a password.

A server behind a tunnel is set up once per machine, in ssh's own configuration, for example with a cloud provider's tunnel command:

# ~/.ssh/config
Host wor-prod
  HostName my-vm
  User wor
  ProxyCommand <your provider's tunnel command for %h port 22>

wor runs ssh with BatchMode=yes, so a connection that would ask for a password or a new host key fails at once instead of waiting: check that ssh wor-prod true works on its own first.

What a push does

  1. Collects what git tracks or would track in the source folder (.gitignore applies, and uncommitted changes are sent as they are on disk), plus what push.follow adds and minus push.exclude. .git and every .env or .env.* file are never sent; *.example files are. Every other path with a part that starts with a dot (.wor/, .config/, .htaccess, public/.well-known/) is left alone, neither written nor deleted, unless the target's dotfiles names it; the summary lists what was held back. A symlink is an error unless push.follow or push.exclude names it, because the server accepts no links.
  2. Asks the server what it holds (wor deploy --plan), and stops if the two wor versions cannot push to each other or the service is a git clone.
  3. Compares against the last push: only changed files are written, and files deleted from the tree since then are deleted there, except paths push.protect names and dot paths the target does not list. A first push writes everything and deletes nothing, so files already in the service (a scaffold, uploads) stay. --all writes everything again.
  4. Checks, on this machine, before anything is sent: for a php service that has composer.json, that composer.lock is there and agrees with it (composer validate, when composer is installed here); php -l on the changed php files of a php service, node --check on the changed JavaScript of a node service (push.check changes this); then .wor/hooks/pre-push, if the folder has one.
  5. Shows a summary and asks. The default answer is no. --yes answers it; with --non-interactive and no --yes the push stops at the question. --check-only stops after the summary.
  6. Sends the changed files in one stream and shows the server's progress.
  7. Says what needs a person: a changed .env.example comes with the keys missing from the server's .env, and a changed vhost example with the wor host reload command to run there.
$ wor push api-prod
[INFO] Collecting services/api...
[INFO] Asking shop/api on wor-prod what it holds...
[INFO] Checking 2 file(s) with php -l...

Target       : api-prod (services/api -> shop/api, php)
Machine      : wor-prod, as wor (wor 1.0.6)
Code         : main at a1b2c3d
Last push    : you pushed 9f8e7d6 at 2026-11-27T16:02:11Z
Files        : 312 in the tree, 2 to write, 1 to delete
  write  public/index.php
  write  src/Cart.php
  delete src/OldCart.php

Push to shop/api on wor-prod? [y/N]: y
[INFO] Sending 2 file(s) to shop/api on wor-prod...
[INFO] Receiving the files for shop/api...
[OK] Backup: ~/wor/backups/shop/source/shop_api_20261128_091402.zip
[OK] Wrote 2 file(s), deleted 1
...
[OK] Push deployed: shop/api
[OK] Pushed main at a1b2c3d to shop/api on wor-prod.

The lines between the backup and the result depend on the service type: composer, the pool, the reload and the readiness gate, as in a deploy.

What is shipped is tuned per service, in the push.* keys of its .wor/deploy.ini: push.exclude, push.follow (for example a composer path repository linked from elsewhere in the repository), push.protect and push.check.

A .wor/hooks/pre-push hook runs on your machine after the built-in checks, under the rules of the deploy hooks (not elevated, a curated environment, no stdin, hooks.timeout). WOR_SERVICE_DIR is the source folder, WOR_COMMIT the commit being pushed and WOR_PREVIOUS_COMMIT the one the last push sent. If it fails, nothing is sent.

wor target

wor target init
wor target add <name> --source=<folder> --service=<domain>/<service> [--into=<folder>] [--dotfiles=<patterns>] [--remote=<ssh host>] [--operator=<account>] [--no-check]
wor target list [--check]
wor target remove <name>
wor target import <file> [--yes]

Writes .wor/targets.ini for you, so a first push needs no reading. Run it inside the repository. It only adds or removes whole sections: every other line of the file, comments included, stays as it was, so editing the file by hand and using these commands mix freely.

$ wor target add api-prod --source=services/api --service=shop/api --remote=wor-prod
[INFO] Checking shop/api on wor-prod...
[OK] shop/api: php service, not pushed to yet (wor 1.0.6 there)
[OK] Added to ~/src/shop/.wor/targets.ini:
[api-prod]
source  = services/api
service = shop/api
remote  = wor-prod

$ wor target list --check
Targets in ~/src/shop/.wor/targets.ini:
  ok   api-local        services/api -> shop-local/api on this machine
       php service, last push: you pushed a1b2c3d at 2026-11-28T09:14:02Z (wor 1.0.6 there)
  ok   api-prod         services/api -> shop/api on wor-prod
       php service, not pushed to yet (wor 1.0.6 there)

rollback

Backs up with source backup, then hard-resets the source and discards all uncommitted local changes. Accepts only domain/service, never a bare domain. Offers a deploy afterwards (skipped when non-interactive).

SSL

wor ssl issue    <host> [--provider=letsencrypt|self-signed|custom|none]
                 [--preferred=<host>] [--redirect|--no-redirect]
wor ssl redirect <host> on|off
wor ssl sync     <host> [--skip-if-busy]
wor ssl hook     <host>
wor ssl renew    <host>
wor ssl status   <host> [--json]
wor ssl remove   <host> [--yes]
wor ssl install  <host> --cert=/path/fullchain.pem --key=/path/privkey.pem

The behaviour behind these, including why wor keeps its own certificate copy, is on the SSL & certificates page. In short:

Output of ssl issue, ssl redirect and ssl status:

$ wor ssl issue myapp.example.com --provider=self-signed --no-redirect
[OK] Self-signed SSL installed: myapp.example.com
[INFO] HTTP -> HTTPS redirect: off (change it with `wor ssl redirect myapp.example.com on|off`)
$ wor ssl redirect myapp.example.com on
[OK] HTTPS redirect for myapp.example.com is now on.
$ wor ssl status myapp.example.com
SSL Enabled          : true
Current Provider     : self-signed
Certificate File     : ~/wor/ssl/hosts/myapp.example.com/fullchain.pem
Private Key File     : ~/wor/ssl/hosts/myapp.example.com/privkey.pem
Certificate Expiration: Jan  1 00:00:00 2029 GMT
Auto Renew Status    : unsupported
HTTP -> HTTPS Redirect: on

Inspect

wor info <host|domain/service>

One summary: type, enabled, source path, bound hosts with per-host SSL status, real process status through that service's provider (pm2 describe, systemctl status, or pool socket, version and group), whether the web server user can reach WOR_HOME and the docroot (Debian family, static and php only), host and service CPU and memory, and git status if the source is a repository. For a pooled php service it lists the settings .wor/php.ini asks for and marks them NOT APPLIED when the running pool differs.

Output:

$ wor info myapp.example.com
WOR Info
--------
Target   : myapp.example.com
Domain   : com-example
Service  : myapp
Type     : static
Enabled  : true
Source   : ~/wor/domains/com-example/myapp
Hosts    :
  - myapp.example.com  [ssl: none]

Process:
  static -- served directly by the web server, no process

Reachability:
  not checked (only auto-detected on Debian/Ubuntu)

wor health --json

Fleet-wide: are my services actually serving? Read-only, exit 1 when a problem is found. Full description on Operations.

wor diagnose <host|domain/service>

Read-only root-cause analysis for one broken target, ending in a single root cause, evidence and copy-pasteable fix commands. Exit 1 when a problem is found. Full description on Operations.

Output of health and diagnose is shown on Operations.

wor path [.|./<path>|<domain>[/<service>]]
wor shell-init
wor goto [same target]        # shell function installed by shell-init

Output:

$ wor path com-example/myapp
~/wor/domains/com-example/myapp

Global flags

--json

Accepted by five read-only reports, version, doctor, health, ssl status and service status, and by the two forms of deploy that a push uses, deploy --plan and deploy --from=-. Prints one JSON document on stdout instead of the text. Anywhere else it is a usage error that names them. The full contract is on Operations.

--non-interactive

Accepted by every command, anywhere on the line (or WOR_NONINTERACTIVE=1). Any question ends the command with an error naming it, and sudo runs as sudo -n. Details on Operations.