Command line
Everything ProjectWikit does outside the browser is a subcommand of the pwikit executable:
pwikit <command> [options]Options start with one dash (-name value or -name=value); two dashes work too. Boolean options are switched on by naming them (-force). Add -h to any command to list its options, and run a command group such as pwikit backup on its own to see its subcommands.
The examples write pwikit on its own, which works once pwikit is installed. Until then, write ./pwikit from pwikit's directory (.\pwikit.exe on Windows).
| Command | Purpose |
|---|---|
serve | Run the web server |
createsite | Create a site |
site list | List the sites and their domains |
site rebind | Move a site to another domain |
admin create | Create the first administrator, or take over an imported account |
admin grant | Give an existing account every right |
admin revoke | Take every right back from an account |
user merge | Join two accounts into one |
seed | Write the starter pages |
import | Import a Wikidot site from a wikitCLI backup |
reindex | Put every page of a site back into the search index |
backup create | Back up the instance or one site |
backup list | List the backups in backups/ |
backup verify | Check a backup file |
backup restore | Restore a backup |
service | Install, start, stop and remove the system service |
path | Make pwikit runnable by name from any directory |
update | Install a new release, roll back, or manage automatic updates |
migrate status | Show which schema migrations the database has |
migrate up | Apply missing schema migrations |
render | Render wikitext in the terminal |
modules | List the [[module]] names pwikit knows |
version | Show which release this is |
help | Print the command list |
Common options
Data directory
All state lives in the data directory: pwikit.toml, files/, secrets/, pgdata/, backups/, logs/ and so on. pwikit picks it in this order:
-data-dir <dir>- the
PWIKIT_DATA_DIRenvironment variable - the directory that holds the
pwikitexecutable
Commands that accept -data-dir must be given the same directory as the running server, or they work on a different instance. See Deployment for the layout.
How commands find the database
serve, createsite, site, admin, user, seed, import, migrate, backup create and backup restore connect to the database in this order:
-database <connection string>- the
DATABASE_URLenvironment variable databaseinpwikit.toml- otherwise, the bundled PostgreSQL in the data directory
With the bundled PostgreSQL:
- If
pwikit serveis running from the same data directory, the command uses the PostgreSQL thatservestarted. - If nothing is running, the command starts the bundled PostgreSQL, uses it, and stops it when the command finishes.
- If another pwikit command is using it, the command stops with
another pwikit command, process <pid>, is already running the bundled PostgreSQL in this directory. Wait for that command to finish.pwikit serverefuses to start for the same reason. - Run commands from the account that owns the data directory; when pwikit runs as a system service, that is the account the service runs as. On Linux, root works too, and the bundled PostgreSQL then runs under its own account (see Running as root). On macOS the bundled PostgreSQL does not run as root.
A connection string looks like postgres://user:password@host:5432/dbname. backup list, backup verify, service, render and modules do not use this lookup.
serve
pwikit serve [options]Runs the web server. On start, serve:
- creates the data directory and writes a commented-out
pwikit.tomltemplate if there is none; - creates
secrets/session-keyif no session key is configured; - starts the bundled PostgreSQL, unless a database is configured;
- refuses a PostgreSQL older than 14;
- applies pending schema migrations, unless
-no-migrateis given; - starts listening.
Stop it with Ctrl+C, or through the system service. It also stops the bundled PostgreSQL.
If something is already listening on port 5432 and no database is configured, serve prints a hint that a PostgreSQL of your own is running and how to use it with -database. It never connects to it by itself; the bundled PostgreSQL uses its own port.
Each setting is taken from the command line first, then the environment variable, then pwikit.toml, then the default. See Configuration.
| Option | Default | Environment variable | pwikit.toml | Meaning |
|---|---|---|---|---|
-data-dir | executable's directory | PWIKIT_DATA_DIR | Data directory | |
-database | bundled PostgreSQL | DATABASE_URL | database | PostgreSQL connection string |
-listen | 127.0.0.1:8080, or :80 when HTTPS is on | server.listen | Address for plain HTTP. When HTTPS is on, this port redirects to HTTPS | |
-tls | off, or auto when a site has a public domain (see below) | PWIKIT_TLS | tls.mode | off: plain HTTP, for use behind a reverse proxy. file: HTTPS with a certificate you supply. auto: HTTPS with certificates obtained over ACME |
-tls-listen | :443 | PWIKIT_TLS_LISTEN | tls.listen | Address for HTTPS |
-tls-cert | PWIKIT_TLS_CERT | tls.cert | Certificate chain in PEM form, for -tls=file | |
-tls-key | PWIKIT_TLS_KEY | tls.key | Private key in PEM form, for -tls=file | |
-acme-email | PWIKIT_ACME_EMAIL | tls.acme_email | Contact address registered with the certificate authority | |
-acme-directory | Let's Encrypt | PWIKIT_ACME_DIRECTORY | tls.acme_directory | ACME directory URL |
-trusted-proxies | none | server.trusted_proxies | Reverse proxy addresses or CIDR ranges, comma separated, whose X-Forwarded-* headers are believed | |
-upload-limit | 0 (no limit) | MEDIA_UPLOAD_LIMIT | server.upload_limit | Total size the files attached to pages may reach, such as 4GB |
-storage-limit | 0 (no limit) | ABSOLUTE_MEDIA_UPLOAD_LIMIT | server.storage_limit | Total size of all uploaded files on disk, deleted files included |
-secret-key | contents of secrets/session-key | SECRET_KEY | Key that signs sign-in cookies and the links sent by mail | |
-no-migrate | off | Start without applying pending schema migrations | ||
-log-file | standard error | File to append log lines to. It is rotated at 10 MB and five old files are kept | ||
-static-dir | built-in assets | Directory to serve the web interface's asset files from instead of the built-in copy, under /-/static/. Needed only when changing the web interface | ||
-sidecar | PWIKIT_FTML_SIDECAR | Developer option: path to a separate renderer program. Leave empty | ||
-dev | off | Development mode, see below | ||
-update-auto | true | PWIKIT_UPDATE_AUTO | update.auto | Install new releases by themselves when running as a system service |
-update-public-banner | true | PWIKIT_UPDATE_PUBLIC_BANNER | update.public_banner | Show the automatic update banner to every visitor |
-update-check | true | PWIKIT_UPDATE_CHECK | update.check | Look for new releases |
-update-window | 03:00-05:00 | PWIKIT_UPDATE_WINDOW | update.window | Hours in which releases are installed automatically, read in -update-time-zone |
-update-time-zone | empty | PWIKIT_UPDATE_TIME_ZONE | update.time_zone | Time zone the update window is read in, such as Asia/Shanghai; empty uses the server's time zone |
-update-min-age | 0s | PWIKIT_UPDATE_MIN_AGE | update.min_age | How long a release must have been out before it is installed automatically |
-update-mirror | PWIKIT_UPDATE_MIRROR | update.mirror | Mirror to use when GitHub cannot be reached. See Updating and rolling back |
Sizes are a number with an optional unit: B, KB, MB, GB or TB (1 KB = 1024 bytes).
Automatic HTTPS. When none of -tls, -listen and -trusted-proxies is set (on the command line, in the environment or in pwikit.toml), serve looks at the sites in the database. If any site is bound to a public domain name, it switches to -tls=auto and listens on :80 and :443. Otherwise it serves plain HTTP on 127.0.0.1:8080. Switching from HTTP to HTTPS takes a restart; an instance already serving HTTPS picks up a newly bound domain without one. See Deployment.
Development mode
pwikit serve -dev serves plain HTTP that only this machine can reach, whatever the sites and settings say. Use it to look at a copy of a live site locally.
- It listens on
127.0.0.1:8080.-listen 9000or-listen :9000picks another port on the same address;-listen localhost:9000and other loopback addresses are accepted. - An address other machines can reach, such as
-listen 0.0.0.0:9000, is refused with an error. -tls=autoor-tls=filetogether with-devis refused with an error.- The TLS, listen address and trusted proxy settings from the environment and
pwikit.tomlare ignored. The database, session key and upload limits are read as usual.
Examples
# Bundled PostgreSQL, automatic HTTPS once a site has a public domain
pwikit serve
# Local copy of a site on http://127.0.0.1:9000
pwikit serve -dev -listen 9000
# Behind a reverse proxy on the same machine
pwikit serve -tls=off -listen 127.0.0.1:8080 -trusted-proxies 127.0.0.1
# Your own certificate
pwikit serve -tls=file -tls-cert /etc/pwikit/fullchain.pem -tls-key /etc/pwikit/privkey.pem
# Your own PostgreSQL
pwikit serve -database "postgres://pwikit:secret@db.internal:5432/pwikit"createsite
pwikit createsite -slug <slug> -domain <domain> -title <title> -headline <subtitle> [options]Creates a site. -slug, -domain, -title and -headline are required. The command first creates files/, archive/ and secrets/ in the data directory and writes the pwikit.toml template when there is none, as serve does, so a new instance shows its whole layout once this command has run. Before creating the site, the command applies the migrations the database is missing, as migrate up does, and prints applied <name> or adopted <name> for each, so it also works on a new, empty database.
| Option | Default | Meaning |
|---|---|---|
-slug | Site identifier: letters, digits, - and _ | |
-domain | Domain the pages are served on, without scheme or path. A port is allowed, such as localhost:8080 | |
-media-domain | value of -domain | Domain uploaded files are served on |
-title | Site title | |
-headline | Site subtitle | |
-database | see How commands find the database | PostgreSQL connection string |
-data-dir | executable's directory | Data directory |
The command prints created site <slug> (<id>) on <domain>. When the domain is a public domain name, it adds that https://<domain> answers once pwikit serve starts, or restarts if it is already running.
pwikit createsite -slug main -domain wiki.example.org -media-domain files.example.org \
-title "Example Wiki" -headline "A wiki about examples"site list
pwikit site list [-database <url>] [-data-dir <dir>]Prints the identifier, domain and media domain of every site.
SLUG DOMAIN MEDIA DOMAIN
main wiki.example.org files.example.orgsite rebind
pwikit site rebind -slug <slug> -domain <domain> [-media-domain <domain>] [options]Points a site at another domain. Use it when the stored domain can no longer be reached, for example after the domain changed and nobody can open the admin panel. The change applies to the running server at once; moving a site from HTTP to a public domain with HTTPS needs a restart.
| Option | Default | Meaning |
|---|---|---|
-slug | Site to change | |
-domain | New domain for the pages | |
-media-domain | value of -domain | New domain for uploaded files. Pass it again if the site uses a separate media domain |
-database | see How commands find the database | PostgreSQL connection string |
-data-dir | executable's directory | Data directory |
pwikit site rebind -slug main -domain wiki.example.net -media-domain files.example.netmain: wiki.example.org -> wiki.example.net
main: files.example.org -> files.example.net (media)
https://wiki.example.net answers once pwikit serve starts, or restarts if it is already runningadmin
pwikit admin <create|grant|revoke> -name <name> [options]An account with every right is a superuser: it has every permission regardless of roles and can open the admin panel.
| Option | Default | Meaning |
|---|---|---|
-name | Account name. Spaces and non-Latin scripts are allowed | |
-password-stdin | off | create only: read the password from standard input instead of prompting |
-yes | off | create only: create a new account without asking |
-database | see How commands find the database | PostgreSQL connection string |
-data-dir | executable's directory | Data directory |
Account names
-name is the name as people see it. Runs of spaces are collapsed, and the name must:
- be at most 50 characters long;
- contain at least one letter or digit;
- not start with a combining mark or contain invisible characters;
- not have the form
wkt-uid-<number>, which is reserved.
The account's username is derived from it: lowercase, with every run of characters that are not letters or digits replaced by one -. -name "Site Admin" gives the username site-admin. The commands print the username and account number, such as site-admin (#1).
admin create
Makes an account a superuser and sets its password.
- Imported account. If an account with that username or Wikidot username exists and has no password yet,
createtakes it over: it sets the password, activates the account and makes it a superuser. The pages and posts it brought in stay with it. The command printstook over <username> (#<id>), imported as "<Wikidot name>". Import the Wikidot site first, see Importing from Wikidot. - Existing account with a password. The command stops and tells you to run
pwikit admin grantinstead. - No such account. The command explains that a new, empty account will be created and asks
Create a new account? [y/N]. Anything butycancels.-yesskips the question.
The password is prompted for without echo. With -password-stdin, or when standard input is not a terminal, the first line of standard input is used. When the confirmation question is asked, it is also read from standard input, so scripts that create a new account should pass -yes.
The password must be at least 8 characters, not entirely digits, not a commonly used password and not too similar to the account name.
pwikit admin create -name "Site Admin"printf '%s\n' "$ADMIN_PASSWORD" | pwikit admin create -name "Site Admin" -yes -password-stdinadmin grant
pwikit admin grant -name <name>Makes an existing account a superuser. The account can be found by username or Wikidot username. If it already is one, nothing changes.
admin revoke
pwikit admin revoke -name <name>Removes superuser rights from an account; the account itself stays. When it was the last superuser, the command warns that nobody can reach the admin panel until pwikit admin grant runs.
user merge
pwikit user merge -from <account> -into <account> [options]Moves everything one account holds, on every site of the instance, onto another account, and then deletes the first. Use it to join two accounts of the same person, such as an account registered before a Wikidot site was imported and the wd: account the import created alongside it.
| Option | Default | Description |
|---|---|---|
-from | Account to merge away | |
-into | Account that keeps everything | |
-yes | off | Merge without asking |
-database | see How commands find the database | PostgreSQL connection string |
-data-dir | directory holding the executable | Data directory |
Both options name an account in one of three ways:
name: by user name. The name is turned into a user name by the rules in Account names.wd:name: by the account's name on Wikidot, whether or not it has been claimed.#number: by account number.
When merging:
- Every record that points at
-fromis pointed at-into: page authorship, revisions, ratings, favourites, forum threads and posts, likes, roles, sanctions, private messages, notifications and watches, user reports and support tickets. - Where both accounts have a record for the same thing, the one of
-intois kept. For example, if both rated the same page, the rating of-intostays; if both hold the same role, it is kept once. - If
-intohas no Wikidot name and number, it takes those of-from, so sites imported later go straight to-into. It also takes the display name, avatar and bio when its own are empty. The user name, email, password and superuser rights of-intoare always kept. -fromis deleted, and sessions still signed in as it become signed out.
The command refuses when both options name the same account; when -into is an unclaimed Wikidot account, which cannot sign in, so merge the other way round; and when the two accounts come from two different Wikidot accounts.
Without -yes, the command explains what will happen and asks Merge? [y/N]; any answer other than y cancels. A merge cannot be undone, so run pwikit backup create first. When it finishes, the command prints, for each kind of record, how many were moved and how many were dropped as duplicates, and then merged <from> into <into>.
pwikit user merge -from wd:Kakushi -into kakushiseed
pwikit seed [-site <slug>] [options]Writes the starter pages of a new site: main, nav:top, nav:top-impl, nav:side, search:site, forum:start, forum:category, forum:thread, forum:new-thread and forum:recent-posts. Pages that already exist are left alone, so running it again is safe. It prints each page it writes and then <n> of 10 pages written, the rest were already there.
| Option | Default | Meaning |
|---|---|---|
-site | the only site | Site to write into. Required when the database holds more than one |
-database | see How commands find the database | PostgreSQL connection string |
-data-dir | executable's directory | Data directory |
pwikit seedimport
pwikit import [directory] [options]Imports a Wikidot site from an unpacked wikitCLI backup. The directory is a site directory, or the directory holding several of them next to _users/. Naming a site directory also reads the _users/ next to it. Without a directory, archive/ in the data directory is read. Options may come before or after the directory. See Importing from Wikidot.
| Option | Default | Meaning |
|---|---|---|
-site | the only site | Site to write into. Required when the database holds more than one |
-from | the only site in the backup | Site inside the backup. Required when it holds more than one |
-no-tags | off | Leave the tags out |
-no-votes | off | Leave the ratings out |
-no-files | off | Leave the attachments out |
-no-accounts | off | Create no accounts, even when the backup holds some, leaving everything without an author |
-own-users | off | Read accounts only from the _users/ inside the site directory, not the shared _users/ next to it |
-used-users | off | Create accounts only for the users named by the imported revisions, ratings, attachments and forum |
-user-backfill | off | On pages that already exist, fill in the missing authors and ratings from the backup; see Importing from Wikidot |
-update | off | Bring pages that already exist up to a newer backup and add the missing ratings, attachments and forum posts, after confirmation; see Importing from Wikidot |
-yes | off | With -update, go ahead without asking |
-database | see How commands find the database | PostgreSQL connection string |
-data-dir | executable's directory | Data directory; the backup is read from its archive/ when no directory is given, and attachments are copied into its files/ |
pwikit import
pwikit import /srv/wikidot-backup -from my-wikireindex
pwikit reindex [-site <slug>] [options]
pwikit reindex -all [options]Reads every page of a site, including hidden ones, and writes it into the search index again. Use it after a page turns out to be missing from search results, or after importing pages. Pages with no source are skipped. For each site it prints <slug>: <n> pages indexed.
| Option | Default | Meaning |
|---|---|---|
-site | the only site | Site to go through. Required when the database holds more than one |
-all | off | Go through every site in the database. Cannot be combined with -site |
-database | see How commands find the database | PostgreSQL connection string |
-data-dir | executable's directory | Data directory |
-sidecar | value of PWIKIT_FTML_SIDECAR | Developer option: path to a separate renderer program |
pwikit reindex
pwikit reindex -allbackup
pwikit backup <create|list|verify|restore> [options] [file]A backup is one .pwbak file holding the database and, unless left out, the uploaded files. The backup file name may come before or after the options. See Operations for what a backup contains and how to use it.
| Option | Used by | Default | Meaning |
|---|---|---|---|
-output | create | backups/pwikit-<UTC time>.pwbak | File to write |
-no-files | create, restore | off | create: leave the uploaded files out. restore: leave files/ unchanged |
-site | create | whole instance | Export one site on its own |
-keep-passwords | create | off | Keep account passwords in a single-site export |
-dir | list | backups/ | Directory to list |
-force | restore | off | Replace a database that already holds sites, accounts or pages |
-no-safety-backup | restore | off | Skip the backup of the current state that restore takes first |
-database | create, restore | see How commands find the database | PostgreSQL connection string |
-data-dir | all | executable's directory | Data directory |
backup create
pwikit backup create [-output <file>] [-no-files] [-site <slug> [-keep-passwords]]Writes a backup. It can run while pwikit serve is running. Progress goes to standard error; at the end the command prints the file path and a summary such as 63 tables, 12840 rows, 312 files, 85.2 MB. Without -output, the file goes to backups/ as pwikit-20260911-030000.pwbak, or pwikit-<slug>-20260911-030000.pwbak for a single-site export (time in UTC).
pwikit backup create
pwikit backup create -output /mnt/backup/wiki.pwbak
pwikit backup create -site mainbackup list
pwikit backup list [-dir <dir>]Lists the .pwbak files in backups/, newest first. It needs no database.
FILE MADE PWIKIT POSTGRES ROWS FILES SIZE
pwikit-20260911-030000.pwbak 2026-09-11 03:00 0a1b2c3d4e5f 18.6 12840 312 85.2 MBMADE is in UTC. FILES is no for a backup made with -no-files. A file that cannot be read shows UNREADABLE, and the reason is printed after the table.
backup verify
pwikit backup verify <file>Reads the whole backup and checks it against its manifest. It needs no database. It prints when and by which pwikit the backup was made, the PostgreSQL version, what it holds, any notes and any problems, then sound if there are none. The command exits with an error when the backup is not sound.
backups/pwikit-20260911-030000.pwbak
made 2026-09-11T03:00:00Z by pwikit 0a1b2c3d4e5f
postgres 18.6
holds 63 tables, 12840 rows, 312 files
soundbackup restore
pwikit backup restore <file> [-force] [-no-safety-backup] [-no-files] [-database <url>]Replaces the database, and the uploaded files if the backup holds them and -no-files is not given, with the contents of the backup. Stop pwikit serve first. Before changing anything, the command backs up the current state to backups/before-restore-pwikit-<UTC time>.pwbak, unless -no-safety-backup is given or the database holds no data yet. See Restoring a backup.
pwikit backup restore backups/pwikit-20260911-030000.pwbak -forceservice
pwikit service <install|uninstall|start|stop|status|print> [options] [-- serve options]Registers pwikit with the operating system so that pwikit serve starts at boot: a systemd unit on Linux, a launchd job on macOS, a Windows service on Windows. See Deployment for installing and Operations for day-to-day use.
| Subcommand | Meaning |
|---|---|
install | Register the service, start it now and at every boot |
uninstall | Stop the service and remove it |
start | Start the installed service |
stop | Stop the installed service |
status | Show whether the service is running |
print | Show what install would register, without registering it |
| Option | Default | Meaning |
|---|---|---|
-name | pwikit | Name the service is registered under: letters, digits, ., - and _ |
-user | the account sudo was run from | install and print on Linux and macOS: account the service runs as. On Linux, installed by root without it, the service runs as root; on macOS it cannot be root |
-data-dir | executable's directory | install and print: data directory the service uses |
-no-path | off | install and uninstall: leave the pwikit command alone |
Everything after -- is passed to pwikit serve and checked at install time. install also lets pwikit through the firewall: on Windows with an inbound rule for the program; on macOS, for a service installed with sudo, through the application firewall when it is on; on Linux by opening the needed ports in firewalld or ufw when one of them is running. uninstall removes what install added and closes only the ports it opened.
| Platform | install / uninstall / start / stop | status |
|---|---|---|
| Linux | sudo | any account |
| macOS | sudo for a service that starts at boot; without sudo, a service that starts when you log in. Use the same choice for every later command | same as install |
| Windows | a terminal opened with Run as administrator | any account |
install also runs pwikit path install by default, so that pwikit can be typed from any directory, and uninstall undoes it. When that step fails, a warning is printed and the service is installed anyway.
install also registers the task that looks for and installs new releases, and uninstall removes it. See Updating and rolling back.
install refuses to run from go run; build pwikit and install the built executable.
sudo ./pwikit service install
sudo ./pwikit service install -- -tls=auto -acme-email admin@example.org
./pwikit service printpath
pwikit path <install|uninstall|status> [options]Makes pwikit runnable by name from any directory. Run this command itself as ./pwikit (.\pwikit.exe on Windows). See Deployment for background and for its use when moving an instance.
| Subcommand | Meaning |
|---|---|
install | On Linux and macOS, create a pwikit link that leads to this program; on Windows, add the directory holding it to your own Path |
uninstall | Undo install, removing only a link that leads to this program or leads nowhere |
status | Show where the pwikit command leads, whether it still works, and whether its directory is on PATH |
| Option | Default | Meaning |
|---|---|---|
-dir | /usr/local/bin, or ~/.local/bin when that cannot be written | Linux and macOS only: directory the link goes in |
-force | off | Replace a link that leads to another pwikit, or a plain file of the same name |
An old link that leads to a location that no longer exists is replaced without asking, so running install again from the new location is all a moved instance needs. -dir does not apply on Windows; open a new terminal afterwards.
sudo ./pwikit path install
./pwikit path install -dir ~/bin
pwikit path statusupdate
pwikit update [check|status|rollback|unpin|postpone|skip|mirror] [options] [-- serve options]Installs a new release, goes back to the previous one, or manages automatic updates. See Updating and rolling back for the full picture.
| Subcommand | Meaning |
|---|---|
| none | Install the newest release |
check | Look up the newest release and change nothing |
status | Show the last check, the scheduled update, the last update's outcome and the rollback point |
rollback | Go back to the release before the last update, with the database when the rollback point holds it |
unpin | Release the hold set by -to or rollback |
postpone | Cancel the scheduled update and update nothing automatically for 24 hours |
skip | Cancel the scheduled update and never install that release automatically |
mirror [address] | Without an address, show the mirror in pwikit.toml. With one, write it into [update] mirror and leave the rest of the file as it is. An empty address clears it |
| Option | Default | Meaning |
|---|---|---|
-to | the newest release | Release to install. When it is older than the running one, it is held after installing |
-service | pwikit | Name of the installed service |
-data-dir | executable's directory | Data directory |
-mirror | [update] mirror | Mirror to use when GitHub cannot be reached |
-yes | off | rollback: do not ask for confirmation |
Options after -- are the ones the service was installed with, such as -database, so the command finds the same database and settings.
For an instance running as a system service, installing and rolling back need sudo on Linux and macOS and a terminal opened with Run as administrator on Windows. For an instance that does not run as a service, stop pwikit serve first.
sudo pwikit update
sudo pwikit update -to v1.0.1
pwikit update check
pwikit update status
sudo pwikit update rollbackmigrate
pwikit migrate <status|up> [-database <url>] [-data-dir <dir>]migrate status
Lists every schema migration and its state. It changes nothing.
STATUS MIGRATION
applied 0001_baseline.sql
applied 0002_admin_log_and_addresses.sql
pending 0003_site_columns.sql| Status | Meaning |
|---|---|
applied | The database has this migration |
pending | The database is missing it; pwikit serve, pwikit createsite or pwikit migrate up applies it |
existing | The database was created by an earlier ProjectWikit release and already has this schema; it is recorded as applied without being run |
newer | A migration a newer pwikit applied. This pwikit does not carry it, but it is declared compatible with older releases, so this pwikit keeps running |
newer-breaking | A migration a newer pwikit applied and declared incompatible with older releases. This pwikit refuses to start on the database |
migrate up
Applies the missing migrations and prints applied <name> for each. A migration listed as existing is recorded without being run and printed as adopted <name>. When nothing is missing, the command prints already up to date. pwikit serve does the same on start unless -no-migrate is given.
render
pwikit render [options] < page.txt
pwikit render -file page.txt [options]Renders wikitext from standard input or a file and prints the result. Use it to check how a piece of wikitext renders without opening a browser. Without -dsn no database is used: links are never resolved and includes find nothing. This command reads only -dsn, not DATABASE_URL, pwikit.toml or the bundled PostgreSQL.
| Option | Default | Meaning |
|---|---|---|
-file | standard input | File to read |
-mode | article | article, message, inline, system or system-with-modules |
-output | html | html; text; backlinks, which prints the pages included and linked; code, which prints the [[code]] and [[html]] blocks |
-dsn | PostgreSQL connection string | |
-site | the only site | Site identifier; required with -dsn when the database holds more than one site |
-page | page | Page name the text is rendered as |
-category | _default | Category of that page |
-domain | example.org | Site domain |
-modules | real | real renders modules; stub prints each module's name and arguments instead |
-trace | Write the renderer's requests to this file, or - for standard error | |
-data-dir | executable's directory | Data directory, for role icons |
-sidecar | value of PWIKIT_FTML_SIDECAR | Developer option: path to a separate renderer program |
echo "**bold** [[[main]]]" | pwikit render -output textmodules
pwikit modulesLists every [[module]] name pwikit recognizes.
| Column | Meaning |
|---|---|
MODULE | Module name |
BODY | true when the module takes content up to [[/module]] |
STATUS | ported: available. pending: recognized but not available in this release. removed: no longer available |
See Modules for how to use them.
version
pwikit versionShows which release this executable is, without connecting to the network. Include this output when reporting a problem.
pwikit v1.0.0
commit 1a2b3c4d5e6f
committed 2026-09-13T05:58:17Z
platform linux/amd64
postgresql 18.6.0, bundled
go go1.26.4| Line | Meaning |
|---|---|
pwikit | The release. A build made without a release number shows its commit instead |
commit | The commit it was built from, followed by -modified when there were uncommitted changes |
committed | When that commit was made, in UTC |
platform | Operating system and processor architecture |
postgresql | The version of the bundled PostgreSQL, or not bundled for a build without it |
go | The Go version it was built with |
